diff --git a/src/java.base/share/classes/java/lang/constant/ClassDesc.java b/src/java.base/share/classes/java/lang/constant/ClassDesc.java index 3f0604b336a..06601c475b3 100644 --- a/src/java.base/share/classes/java/lang/constant/ClassDesc.java +++ b/src/java.base/share/classes/java/lang/constant/ClassDesc.java @@ -362,6 +363,9 @@ public sealed interface ClassDesc */ String descriptorString(); + @Override + Class resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException; + /** * Compare the specified object with this descriptor for equality. Returns * {@code true} if and only if the specified object is also a diff --git a/src/java.base/share/classes/java/lang/constant/ConstantDesc.java b/src/java.base/share/classes/java/lang/constant/ConstantDesc.java index 2be66b7002c..ee2bc7fce96 100644 --- a/src/java.base/share/classes/java/lang/constant/ConstantDesc.java +++ b/src/java.base/share/classes/java/lang/constant/ConstantDesc.java @@ -99,9 +99,9 @@ public sealed interface ConstantDesc * could not be reflectively resolved in the course of resolution * @throws LinkageError if a linkage error occurs * - * @apiNote {@linkplain MethodTypeDesc} can represent method type descriptors - * that are not representable by {@linkplain MethodType}, such as methods with - * more than 255 parameter slots, so attempts to resolve these may result in errors. + * @apiNote Some constant descriptors, such as {@linkplain MethodTypeDesc}, can represent + * a value that is not representable by run-time entities. Attempts to resolve these may + * result in errors. * * @jvms 5.4.3 Resolution * @jvms 5.4.4 Access Control diff --git a/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java b/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java index 8c9ee15208e..9e8633d26e0 100644 --- a/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java +++ b/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java @@ -204,6 +204,9 @@ public sealed interface MethodHandleDesc */ MethodTypeDesc invocationType(); + @Override + MethodHandle resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException; + /** * Compares the specified object with this descriptor for equality. Returns * {@code true} if and only if the specified object is also a diff --git a/src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java b/src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java index 4750231ce37..175d91bf3f6 100644 --- a/src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java +++ b/src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java @@ -188,6 +189,16 @@ public sealed interface MethodTypeDesc returnType().displayName()); } + /** + * {@inheritDoc} + * + * @apiNote {@linkplain MethodTypeDesc} can represent method type descriptors + * that are not representable by {@linkplain MethodType}, such as methods with + * more than 255 parameter slots, so attempts to resolve these may result in errors. + */ + @Override + MethodType resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException; + /** * Compares the specified object with this descriptor for equality. Returns * {@code true} if and only if the specified object is also a