ArrayValue array = (ArrayValue) arrays[0];
Value callbackValue = arrays[arrays.length - 2];
Callable cmpValue = callbackValue.toCallable(env);
if (! cmpValue.isValid(env))
return NullValue.NULL;
Value callbackKey = arrays[arrays.length - 1];
Callable cmpKey = callbackKey.toCallable(env);
if (! cmpKey.isValid(env))
return NullValue.NULL;
ArrayValue diffArray = new ArrayValueImpl();
boolean isFound = false;
for (Value entryKey : array.keySet()) {
Value entryValue = array.get(entryKey);
for (int k = 1; k < arrays.length - 2 && ! isFound; k++) {
if (! (arrays[k] instanceof ArrayValue)) {
env.warning("Argument #" + (k + 1) + " is not an array");
return NullValue.NULL;
}
ArrayValue checkArray = (ArrayValue) arrays[k];
for (Map.Entry<Value, Value> entry : checkArray.entrySet()) {
try {
boolean valueFound =
cmpValue.call(env, entryValue, entry.getValue()).toLong() == 0;
boolean keyFound = false;
if (valueFound)
keyFound = cmpKey.call(env, entryKey, entry.getKey()).toLong()
== 0;
isFound = valueFound && keyFound;
}
catch (Throwable t) {