[Fix] Fixed ObjectHelper.isIn() with Collection, Array
This commit is contained in:
parent
926fc10607
commit
1082170d02
|
@ -222,26 +222,38 @@ public class ObjectHelper {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (right instanceof Collection) {
|
if (right instanceof Collection) {
|
||||||
if (left instanceof Collection) {
|
|
||||||
Collection<?> collectionRight = (Collection) right;
|
Collection<?> collectionRight = (Collection) right;
|
||||||
Collection<?> collectionleft = (Collection) left;
|
|
||||||
for (Object oLeft : collectionleft) {
|
if (left instanceof Collection) {
|
||||||
for (Object oRight : collectionRight) {
|
Collection<?> collectionLeft = (Collection) left;
|
||||||
if (equals(oRight, oLeft, ignoreCase))
|
for (Object l : collectionLeft) {
|
||||||
|
for (Object r : collectionRight) {
|
||||||
|
if (equals(r, l, ignoreCase))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
} else if (left instanceof String[]) {
|
||||||
|
String[] leftArr = (String[]) left;
|
||||||
|
for (Object r : collectionRight) {
|
||||||
|
for (Object l : leftArr) {
|
||||||
|
if (equals(r, l, ignoreCase))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Collection<?> collection = (Collection) right;
|
for (Object o : collectionRight) {
|
||||||
for (Object o : collection) {
|
|
||||||
if (equals(o, left, ignoreCase))
|
if (equals(o, left, ignoreCase))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right instanceof Object[]) {
|
if (right instanceof Object[]) {
|
||||||
|
|
Loading…
Reference in New Issue