Lines Matching refs:refc
174 * documented as a parameter named {@code refc} in the lookup methods.
305 * {@code refc} as the containing class in which the member
311 * smgr.checkMemberAccess(refc, Member.PUBLIC)} is called.
313 * the same as or an ancestor of the class loader of {@code refc},
316 * where {@code refcPkg} is the package of {@code refc}.
320 * (Note that {@code defc} might be the same as {@code refc}.)
328 * and if {@code defc} and {@code refc} are in different class loaders,
569 * @param refc the class from which the method is accessed
583 MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
584 MemberName method = resolveOrFail(REF_invokeStatic, refc, name, type);
585 checkSecurityManager(refc, method);
586 return getDirectMethod(REF_invokeStatic, refc, method, findBoundCallerClass(method));
592 * with the receiver type (usually {@code refc}) prepended.
601 * The first argument will be of type {@code refc} if the lookup
619 * @param refc the class or interface from which the method is accessed
632 public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
633 if (refc == MethodHandle.class) {
637 byte refKind = (refc.isInterface() ? REF_invokeInterface : REF_invokeVirtual);
638 MemberName method = resolveOrFail(refKind, refc, name, type);
639 checkSecurityManager(refc, method);
640 return getDirectMethod(refKind, refc, method, findBoundCallerClass(method));
666 * @param refc the class or interface from which the method is accessed
677 public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException {
679 MemberName ctor = resolveOrFail(REF_newInvokeSpecial, refc, name, type);
680 checkSecurityManager(refc, ctor);
681 return getDirectConstructor(refc, ctor);
705 * @param refc the class or interface from which the method is accessed
718 public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
722 MemberName method = specialLookup.resolveOrFail(REF_invokeSpecial, refc, name, type);
723 checkSecurityManager(refc, method);
724 return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, findBoundCallerClass(method));
734 * @param refc the class or interface from which the method is accessed
744 public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
745 MemberName field = resolveOrFail(REF_getField, refc, name, type);
746 checkSecurityManager(refc, field);
747 return getDirectField(REF_getField, refc, field);
757 * @param refc the class or interface from which the method is accessed
767 public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
768 MemberName field = resolveOrFail(REF_putField, refc, name, type);
769 checkSecurityManager(refc, field);
770 return getDirectField(REF_putField, refc, field);
779 * @param refc the class or interface from which the method is accessed
789 public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
790 MemberName field = resolveOrFail(REF_getStatic, refc, name, type);
791 checkSecurityManager(refc, field);
792 return getDirectField(REF_getStatic, refc, field);
801 * @param refc the class or interface from which the method is accessed
811 public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
812 MemberName field = resolveOrFail(REF_putStatic, refc, name, type);
813 checkSecurityManager(refc, field);
814 return getDirectField(REF_putStatic, refc, field);
864 Class<? extends Object> refc = receiver.getClass(); // may get NPE
865 MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type);
866 checkSecurityManager(refc, method);
867 MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, findBoundCallerClass(method));
1007 MemberName resolveOrFail(byte refKind, Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
1008 checkSymbolicClass(refc); // do this before attempting to resolve
1010 return IMPL_NAMES.resolveOrFail(refKind, new MemberName(refc, name, type, refKind), lookupClassOrNull(),
1014 MemberName resolveOrFail(byte refKind, Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
1015 checkSymbolicClass(refc); // do this before attempting to resolve
1017 return IMPL_NAMES.resolveOrFail(refKind, new MemberName(refc, name, type, refKind), lookupClassOrNull(),
1021 void checkSymbolicClass(Class<?> refc) throws IllegalAccessException {
1023 if (caller != null && !VerifyAccess.isClassAccessible(refc, caller, allowedModes))
1024 throw new MemberName(refc).makeAccessException("symbolic reference class is not public", this);
1069 void checkSecurityManager(Class<?> refc, MemberName m) {
1080 final Class<?> clazz = refc;
1090 !VerifyAccess.classLoaderIsAncestor(lookupClass, refc)) {
1091 ReflectUtil.checkPackageAccess(refc);
1113 if (defc != refc) {
1118 void checkMethod(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
1128 { checkAccess(refKind, refc, m); return; }
1132 void checkField(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
1138 { checkAccess(refKind, refc, m); return; }
1142 void checkAccess(byte refKind, Class<?> refc, MemberName m) throws IllegalAccessException {
1152 if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()) && allowedModes != 0)
1156 if (VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
1165 throw m.makeAccessException(accessFailedMessage(refc, m), this);
1168 String accessFailedMessage(Class<?> refc, MemberName m) {
1173 (defc == refc ||
1174 Modifier.isPublic(refc.getModifiers())));
1177 (defc == refc ||
1178 VerifyAccess.isClassAccessible(refc, lookupClass(), ALL_MODES)));
1228 private MethodHandle getDirectMethod(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
1229 return getDirectMethodCommon(refKind, refc, method,
1234 private MethodHandle getDirectMethodNoRestrict(byte refKind, Class<?> refc, MemberName method, Class<?> callerClass) throws IllegalAccessException {
1235 return getDirectMethodCommon(refKind, refc, method, false, callerClass);
1237 private MethodHandle getDirectMethodCommon(byte refKind, Class<?> refc, MemberName method,
1239 checkMethod(refKind, refc, method);
1245 refc != lookupClass() &&
1246 refc != (refcAsSuper = lookupClass().getSuperclass()) &&
1247 refc.isAssignableFrom(lookupClass())) {
1261 refc = refcAsSuper;
1263 checkMethod(refKind, refc, method);
1266 MethodHandle mh = DirectMethodHandle.make(refc, method);
1288 private MethodHandle getDirectField(byte refKind, Class<?> refc, MemberName field) throws IllegalAccessException {
1289 checkField(refKind, refc, field);
1290 MethodHandle mh = DirectMethodHandle.make(refc, field);
1297 private MethodHandle getDirectConstructor(Class<?> refc, MemberName ctor) throws IllegalAccessException {
1299 checkAccess(REF_newInvokeSpecial, refc, ctor);