On Wed, 28 Jun 2023 00:18:25 GMT, Chen Liang <li...@openjdk.org> wrote:

>> The API specification for descriptorString not being a strict inverse of 
>> Class::forName and MethodType::fromDescriptorString are not entirely correct.
>> 
>> 1. Class::descriptorString was never an inverse of Class::forName, which 
>> takes a binary name instead. The note about different class loaders is moved 
>> to getName, as ClassDesc requires an explicit lookup for resolution already.
>> 2. MethodType::toMethodDescriptorString ends with a meaningless sentence: 
>> "fromMethodDescriptorString, because the latter requires a suitable class 
>> loader argument.", and the "Note:" section can be replaced with an 
>> `@apiNote`.
>> 3. Both of these didn't mention hidden classes (or other 
>> non-nominally-describable classes) as a reason that prevents the inversion 
>> operation, in addition to distinct class loaders. Added valid method type 
>> descriptor/binary name as a prerequisite for the distinct class loader 
>> explanation.
>> 
>> A few user-defined anchor links are replaced with updated javadoc link tag 
>> format as well. The explicit html-style links in `@see` tags are unchanged 
>> in order to retain the non-code output.
>> 
>> The rendered specifications:
>> https://cr.openjdk.org/~liach/8309819/09/java.base/java/lang/Class.html
>> https://cr.openjdk.org/~liach/8309819/09/java.base/java/lang/invoke/MethodType.html
>
> Chen Liang has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains 15 additional commits since 
> the last revision:
> 
>  - Merge branch 'master' into fix/descstring-spec
>  - Update the distinct class note, thanks to mandy
>  - Merge branch 'master' into fix/descstring-spec
>  - produce identical component descriptors in descriptor strings -> cannot be 
> distinguished in descriptor strings
>  - Reword of the distinct-class-same-descriptor note
>  - Missed recommendations from Alan
>  - Review and updates for 8310242
>  - Merge branch 'master' into fix/descstring-spec
>  - Update the note for getName
>  - Convert the note in fromDescriptorString to apiNote
>  - ... and 5 more: https://git.openjdk.org/jdk/compare/cd5b8fd8...ef7004e4

I have published the updated javadoc with Class.forName spec update integrated: 
https://cr.openjdk.org/~liach/8309819/09/java.base/java/lang/Class.html

The CSR has been re-finalized as well.

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

PR Comment: https://git.openjdk.org/jdk/pull/14411#issuecomment-1610438288

Reply via email to