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;
}
/**

View file

@ -268,7 +268,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
*
* @implSpec
* The default implementation of this method first checks that the given
* socket option {code name} is not null, then throws {@code
* socket option {@code name} is not null, then throws {@code
* UnsupportedOperationException}. Subclasses should override this method
* with an appropriate implementation.
*
@ -296,7 +296,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
*
* @implSpec
* The default implementation of this method first checks that the given
* socket option {code name} is not null, then throws {@code
* socket option {@code name} is not null, then throws {@code
* UnsupportedOperationException}. Subclasses should override this method
* with an appropriate implementation.
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -81,7 +81,7 @@ public abstract class URLStreamHandler {
*
* @implSpec
* The default implementation of this method first checks that the given
* {code URL} and {code Proxy} are not null, then throws {@code
* {@code URL} and {@code Proxy} are not null, then throws {@code
* UnsupportedOperationException}. Subclasses should override this method
* with an appropriate implementation.
*