Lines Matching refs:klass

33     PrimitiveType(char shorty, Class klass, Object value) {  in PrimitiveType()  argument
35 mClass = klass; in PrimitiveType()
144 for (Class klass : new Class<?>[] { ParentClass.class, ParentInterface.class }) { in runTest()
146 checkField(klass, "field" + baseName, isStatic, visibility, expected, in runTest()
148 checkMethod(klass, "method" + baseName, isStatic, visibility, expected, in runTest()
183 private static void checkMemberCallback(Class<?> klass, String name, in checkMemberCallback() argument
191 klass.getField(name); in checkMemberCallback()
193 klass.getMethod(name); in checkMemberCallback()
197 klass.getDeclaredField(name); in checkMemberCallback()
199 klass.getDeclaredMethod(name); in checkMemberCallback()
221 private static void checkField(Class<?> klass, String name, boolean isStatic, in checkField() argument
228 if (klass.isInterface() && (!isStatic || !isPublic)) { in checkField()
235 if (Reflection.canDiscoverWithGetDeclaredField(klass, name) != canDiscover) { in checkField()
236 throwDiscoveryException(klass, name, true, "getDeclaredField()", canDiscover); in checkField()
239 if (Reflection.canDiscoverWithGetDeclaredFields(klass, name) != canDiscover) { in checkField()
240 throwDiscoveryException(klass, name, true, "getDeclaredFields()", canDiscover); in checkField()
243 if (Reflection.canDiscoverWithGetField(klass, name) != (canDiscover && isPublic)) { in checkField()
244 throwDiscoveryException(klass, name, true, "getField()", (canDiscover && isPublic)); in checkField()
247 if (Reflection.canDiscoverWithGetFields(klass, name) != (canDiscover && isPublic)) { in checkField()
248 throwDiscoveryException(klass, name, true, "getFields()", (canDiscover && isPublic)); in checkField()
253 if (JNI.canDiscoverField(klass, name, isStatic) != canDiscover) { in checkField()
254 throwDiscoveryException(klass, name, true, "JNI", canDiscover); in checkField()
261 if (JLI.canDiscoverWithLookupFindGetter(lookup, klass, name, int.class) in checkField()
263 throwDiscoveryException(klass, name, true, "MethodHandles.lookup().findGetter()", in checkField()
266 if (JLI.canDiscoverWithLookupFindStaticGetter(lookup, klass, name, int.class) in checkField()
268 throwDiscoveryException(klass, name, true, "MethodHandles.lookup().findStaticGetter()", in checkField()
277 if (JLI.canDiscoverWithLookupFindSetter(publicLookup, klass, name, int.class) in checkField()
279 throwDiscoveryException(klass, name, true, "MethodHandles.publicLookup().findSetter()", in checkField()
282 if (JLI.canDiscoverWithLookupFindStaticSetter(publicLookup, klass, name, int.class) in checkField()
284 throwDiscoveryException(klass, name, true, "MethodHandles.publicLookup().findStaticSetter()", in checkField()
292 if (Reflection.canDiscoverFieldWithMetaReflection(klass, name, true) != canDiscover) { in checkField()
293 throwDiscoveryException(klass, name, false, in checkField()
299 if (Reflection.canDiscoverFieldWithMetaReflection(klass, name, false) != true) { in checkField()
300 throwDiscoveryException(klass, name, false, in checkField()
308 if (Reflection.canObserveFieldHiddenAccessFlags(klass, name)) { in checkField()
309 throwModifiersException(klass, name, true); in checkField()
314 if (!Reflection.canGetField(klass, name)) { in checkField()
315 throwAccessException(klass, name, true, "Field.getInt()"); in checkField()
317 if (!Reflection.canSetField(klass, name)) { in checkField()
318 throwAccessException(klass, name, true, "Field.setInt()"); in checkField()
320 if (!JNI.canGetField(klass, name, isStatic)) { in checkField()
321 throwAccessException(klass, name, true, "getIntField"); in checkField()
323 if (!JNI.canSetField(klass, name, isStatic)) { in checkField()
324 throwAccessException(klass, name, true, "setIntField"); in checkField()
329 checkMemberCallback(klass, name, isPublic, true /* isField */, invokesMemberCallback); in checkField()
332 private static void checkMethod(Class<?> klass, String name, boolean isStatic, in checkMethod() argument
337 if (klass.isInterface() && !isPublic) { in checkMethod()
346 if (Reflection.canDiscoverWithGetDeclaredMethod(klass, name) != canDiscover) { in checkMethod()
347 throwDiscoveryException(klass, name, false, "getDeclaredMethod()", canDiscover); in checkMethod()
350 if (Reflection.canDiscoverWithGetDeclaredMethods(klass, name) != canDiscover) { in checkMethod()
351 throwDiscoveryException(klass, name, false, "getDeclaredMethods()", canDiscover); in checkMethod()
354 if (Reflection.canDiscoverWithGetMethod(klass, name) != (canDiscover && isPublic)) { in checkMethod()
355 throwDiscoveryException(klass, name, false, "getMethod()", (canDiscover && isPublic)); in checkMethod()
358 if (Reflection.canDiscoverWithGetMethods(klass, name) != (canDiscover && isPublic)) { in checkMethod()
359 throwDiscoveryException(klass, name, false, "getMethods()", (canDiscover && isPublic)); in checkMethod()
364 if (JNI.canDiscoverMethod(klass, name, isStatic) != canDiscover) { in checkMethod()
365 throwDiscoveryException(klass, name, false, "JNI", canDiscover); in checkMethod()
372 if (JLI.canDiscoverWithLookupFindVirtual(lookup, klass, name, methodType) != canDiscover) { in checkMethod()
373 throwDiscoveryException(klass, name, false, "MethodHandles.lookup().findVirtual()", in checkMethod()
377 if (JLI.canDiscoverWithLookupFindStatic(lookup, klass, name, methodType) != canDiscover) { in checkMethod()
378 throwDiscoveryException(klass, name, false, "MethodHandles.lookup().findStatic()", in checkMethod()
386 if (Reflection.canDiscoverMethodWithMetaReflection(klass, name, true) != canDiscover) { in checkMethod()
387 throwDiscoveryException(klass, name, false, in checkMethod()
393 if (Reflection.canDiscoverMethodWithMetaReflection(klass, name, false) != true) { in checkMethod()
394 throwDiscoveryException(klass, name, false, in checkMethod()
404 if (Reflection.canObserveMethodHiddenAccessFlags(klass, name)) { in checkMethod()
405 throwModifiersException(klass, name, false); in checkMethod()
409 if (!klass.isInterface() || isStatic) { in checkMethod()
410 if (!Reflection.canInvokeMethod(klass, name)) { in checkMethod()
411 throwAccessException(klass, name, false, "invoke()"); in checkMethod()
413 if (!JNI.canInvokeMethodA(klass, name, isStatic)) { in checkMethod()
414 throwAccessException(klass, name, false, "CallMethodA"); in checkMethod()
416 if (!JNI.canInvokeMethodV(klass, name, isStatic)) { in checkMethod()
417 throwAccessException(klass, name, false, "CallMethodV"); in checkMethod()
423 checkMemberCallback(klass, name, isPublic, false /* isField */, invokesMemberCallback); in checkMethod()
426 private static void checkConstructor(Class<?> klass, Visibility visibility, Hiddenness hiddenness, in checkConstructor() argument
443 if (Reflection.canDiscoverWithGetDeclaredConstructor(klass, args) != canDiscover) { in checkConstructor()
444 throwDiscoveryException(klass, fullName, false, "getDeclaredConstructor()", canDiscover); in checkConstructor()
447 if (Reflection.canDiscoverWithGetDeclaredConstructors(klass, args) != canDiscover) { in checkConstructor()
448 throwDiscoveryException(klass, fullName, false, "getDeclaredConstructors()", canDiscover); in checkConstructor()
451 if (Reflection.canDiscoverWithGetConstructor(klass, args) != (canDiscover && isPublic)) { in checkConstructor()
453 klass, fullName, false, "getConstructor()", (canDiscover && isPublic)); in checkConstructor()
456 if (Reflection.canDiscoverWithGetConstructors(klass, args) != (canDiscover && isPublic)) { in checkConstructor()
458 klass, fullName, false, "getConstructors()", (canDiscover && isPublic)); in checkConstructor()
463 if (JNI.canDiscoverConstructor(klass, signature) != canDiscover) { in checkConstructor()
464 throwDiscoveryException(klass, fullName, false, "JNI", canDiscover); in checkConstructor()
470 if (JLI.canDiscoverWithLookupFindConstructor(lookup, klass, methodType) != canDiscover) { in checkConstructor()
471 throwDiscoveryException(klass, fullName, false, "MethodHandles.lookup().findConstructor", in checkConstructor()
476 if (JLI.canDiscoverWithLookupFindConstructor(publicLookup, klass, methodType) != canDiscover) { in checkConstructor()
477 throwDiscoveryException(klass, fullName, false, in checkConstructor()
486 if (Reflection.canDiscoverConstructorWithMetaReflection(klass, args, true) != canDiscover) { in checkConstructor()
487 throwDiscoveryException(klass, fullName, false, in checkConstructor()
493 if (Reflection.canDiscoverConstructorWithMetaReflection(klass, args, false) != true) { in checkConstructor()
494 throwDiscoveryException(klass, fullName, false, in checkConstructor()
502 if (!Reflection.canInvokeConstructor(klass, args, initargs)) { in checkConstructor()
503 throwAccessException(klass, fullName, false, "invoke()"); in checkConstructor()
505 if (!JNI.canInvokeConstructorA(klass, signature)) { in checkConstructor()
506 throwAccessException(klass, fullName, false, "NewObjectA"); in checkConstructor()
508 if (!JNI.canInvokeConstructorV(klass, signature)) { in checkConstructor()
509 throwAccessException(klass, fullName, false, "NewObjectV"); in checkConstructor()
514 private static void checkNullaryConstructor(Class<?> klass, Behaviour behaviour) in checkNullaryConstructor() argument
518 if (Reflection.canUseNewInstance(klass) != canAccess) { in checkNullaryConstructor()
520 "be able to construct " + klass.getName() + ". " + configMessage); in checkNullaryConstructor()
534 private static void throwDiscoveryException(Class<?> klass, String name, boolean isField, in throwDiscoveryException() argument
536 throw new RuntimeException("Expected " + (isField ? "field " : "method ") + klass.getName() + in throwDiscoveryException()
541 private static void throwAccessException(Class<?> klass, String name, boolean isField, in throwAccessException() argument
544 klass.getName() + "." + name + " using " + fn + ". " + configMessage); in throwAccessException()
547 private static void throwModifiersException(Class<?> klass, String name, boolean isField) { in throwModifiersException() argument
548 throw new RuntimeException("Expected " + (isField ? "field " : "method ") + klass.getName() + in throwModifiersException()