On Thu, 15 Jun 2023 02:38:08 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. Class::getName was a partial inverse instead.
>> 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 classloaders.
>> 
>> 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/04/java.base/java/lang/Class.html
>> https://cr.openjdk.org/~liach/8309819/04/java.base/java/lang/invoke/MethodType.html
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update the note for getName

src/java.base/share/classes/java/lang/invoke/MethodType.java line 1172:

> 1170:      * It is possible to encounter method types which cannot be
> 1171:      * constructed by this method, because their component types are
> 1172:      * not all reachable from a common class loader, or some component 
> types

"reachable from a common class loader" pre-dates your change but I think it 
should say visible to the given class loader.

src/java.base/share/classes/java/lang/invoke/MethodType.java line 1233:

> 1231:      * (JVMS {@jvms 4.3.3}) and a suitable class loader argument. Two 
> distinct
> 1232:      * classes which share a common name but have different class 
> loaders will
> 1233:      * appear identical when viewed within descriptor strings.

"will appear identical when viewed within descriptor strings".  Would it be 
clearer to say that have equal descriptor strings?

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

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

Reply via email to