mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8226709: MethodTypeDesc::resolveConstantDesc needs access check per the specification
Reviewed-by: mchung, mcimadamore
This commit is contained in:
parent
5c5126f5ee
commit
b2e7d0367e
4 changed files with 148 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue