RFR: 8309819: Fix specification about descriptor inverses in Class and MethodType [v3]

Mandy Chung mchung at openjdk.org
Wed Jun 14 02:02:12 UTC 2023


On Wed, 14 Jun 2023 01:26:25 GMT, Chen Liang <liach at openjdk.org> wrote:

>> This method was added prior to `MethodTypeDesc`.    MethodTypeDesc::ofDescriptor` and `MethodTypeDesc::resolveConstantDesc` would be the alternative way to get back the method type.  I tend to think that `descriptorString` would not need that distinct class loader note (as it would use the Lookup class to resolve instead).
>
> Since the method type descriptor info is available in `descriptorString` but it's a reason `toMethodDescriptorString` is not a strict inverse of `fromMethodDescriptorString`, I propose to reword the notes sections to the following:
> 
>      * @apiNote
>      * This is not a strict inverse of {@link #fromMethodDescriptorString
>      * fromMethodDescriptorString} which requires a method type descriptor
>      * (JVMS {@jvms 4.3.3}) and a suitable class loader argument. Two distinct
>      * classes which share a common name but have different class loaders will
>      * appear identical when viewed within descriptor strings.
>      * <p>
>      * This method is included for the benefit of applications that must
>      * generate bytecodes that process method handles and {@code invokedynamic}.

That's good.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14411#discussion_r1228884412


More information about the core-libs-dev mailing list