This commit is contained in:
Jesper Wilhelmsson 2019-06-26 22:16:00 +02:00
commit 16548883ec
11 changed files with 319 additions and 25 deletions

View file

@ -131,8 +131,14 @@ final class MethodTypeDescImpl implements MethodTypeDesc {
}
@Override
public MethodType resolveConstantDesc(MethodHandles.Lookup lookup) {
return MethodType.fromMethodDescriptorString(descriptorString(), lookup.lookupClass().getClassLoader());
public MethodType resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException {
MethodType mtype = MethodType.fromMethodDescriptorString(descriptorString(), lookup.lookupClass().getClassLoader());
// let's check that the lookup has access to all the types in the method type
lookup.accessClass(mtype.returnType());
for (Class<?> paramType: mtype.parameterArray()) {
lookup.accessClass(paramType);
}
return mtype;
}
/**