Lines Matching defs:defc

435     static Object[][] accessCases(Class<?> defc, String name, boolean isSpecial) {
439 } else if (name.contains("pkg_") || !Modifier.isPublic(defc.getModifiers())) {
445 boolean pubc = Modifier.isPublic(defc.getModifiers());
451 if (defc != Example.class && cases[cases.length-1][1] == EXAMPLE)
455 static Object[][] accessCases(Class<?> defc, String name) {
456 return accessCases(defc, name, false);
459 static Lookup maybeMoveIn(Lookup lookup, Class<?> defc) {
463 return lookup.in(defc);
489 void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
490 for (Object[] ac : accessCases(defc, name)) {
491 testFindStatic((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
494 void testFindStatic(Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
495 testFindStatic(true, lookup, defc, ret, name, params);
497 void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
504 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
505 target = maybeMoveIn(lookup, defc).findStatic(defc, methodName, type);
515 System.out.println("findStatic "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
571 void testFindVirtual(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
572 Class<?> rcvc = defc;
573 testFindVirtual(rcvc, defc, ret, name, params);
575 void testFindVirtual(Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
576 for (Object[] ac : accessCases(defc, name)) {
577 testFindVirtual((Boolean)ac[0], (Lookup)ac[1], rcvc, defc, ret, name, params);
580 void testFindVirtual(Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
581 testFindVirtual(true, lookup, rcvc, defc, ret, name, params);
583 void testFindVirtual(boolean positive, Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
590 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
591 target = maybeMoveIn(lookup, defc).findVirtual(defc, methodName, type);
601 System.out.println("findVirtual "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
606 Class<?> selfc = defc;
645 Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
647 testFindSpecial(false, EXAMPLE, specialCaller, defc, ret, name, params);
648 testFindSpecial(false, PRIVATE, specialCaller, defc, ret, name, params);
649 testFindSpecial(false, PACKAGE, specialCaller, defc, ret, name, params);
650 testFindSpecial(true, SUBCLASS, specialCaller, defc, ret, name, params);
651 testFindSpecial(false, PUBLIC, specialCaller, defc, ret, name, params);
654 testFindSpecial(true, EXAMPLE, specialCaller, defc, ret, name, params);
655 testFindSpecial(true, PRIVATE, specialCaller, defc, ret, name, params);
656 testFindSpecial(false, PACKAGE, specialCaller, defc, ret, name, params);
657 testFindSpecial(false, SUBCLASS, specialCaller, defc, ret, name, params);
658 testFindSpecial(false, PUBLIC, specialCaller, defc, ret, name, params);
661 Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
668 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
670 target = maybeMoveIn(lookup, specialCaller).findSpecial(defc, methodName, type, specialCaller);
680 System.out.println("findSpecial from "+specialCaller.getName()+" to "+defc.getName()+"."+name+"/"+type+" => "+target
712 Class<?> defc, Class<?>... params) throws Throwable {
718 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" <init>"+type);
719 target = lookup.findConstructor(defc, type);
725 System.out.println("findConstructor "+defc.getName()+".<init>/"+type+" => "+target
731 assertEquals(type.changeReturnType(defc), target.type());
733 printCalled(target, defc.getSimpleName(), args);
735 if (!(defc == Example.class && params.length < 2))
736 assertCalled(defc.getSimpleName()+".<init>", args);
737 assertTrue("instance of "+defc.getName(), defc.isInstance(obj));
758 void testBind(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
759 for (Object[] ac : accessCases(defc, name)) {
760 testBind((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
764 void testBind(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
768 Object receiver = randomArg(defc);
772 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
773 target = maybeMoveIn(lookup, defc).bind(receiver, methodName, type);
827 void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
828 for (Object[] ac : accessCases(defc, name)) {
829 testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, (isStatic ? null : defc), ret, name, params);
832 void testUnreflect(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
833 for (Object[] ac : accessCases(defc, name)) {
834 testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
839 Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
843 Method rmethod = defc.getDeclaredMethod(methodName, params);
849 if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
853 target = maybeMoveIn(lookup, defc).unreflect(rmethod);
863 System.out.println("unreflect"+(isSpecial?"Special":"")+" "+defc.getName()+"."+name+"/"+type
883 assertEquals(defc, target.type().parameterType(0));
894 void testUnreflectSpecial(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
895 for (Object[] ac : accessCases(defc, name, true)) {
897 testUnreflectMaybeSpecial(specialCaller, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);