import com.google.common.collect.ImmutableMap;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collections;
return q1.getLocalName().compareToIgnoreCase(q2.getLocalName());
}
};
- private static final Lookup LOOKUP = MethodHandles.publicLookup();
private final Map<QName, ValueContext> keyValueContexts;
private final List<QName> keysInBindingOrder;
private final ListSchemaNode schema;
this.identifiable = identifiable;
try {
- ctor = LOOKUP.unreflectConstructor(getConstructor(keyClass));
+ ctor = MethodHandles.publicLookup().unreflectConstructor(getConstructor(keyClass));
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Missing construct in class " + keyClass);
}
return new NodeIdentifierWithPredicates(schema.getQName(), values);
}
-
@SuppressWarnings("unchecked")
private static Constructor<? extends Identifier<?>> getConstructor(final Class<? extends Identifier<?>> clazz) {
for (@SuppressWarnings("rawtypes") final Constructor constr : clazz.getConstructors()) {
}
throw new IllegalArgumentException("Supplied class " + clazz + "does not have required constructor.");
}
-
}
\ No newline at end of file