RFR: 8309819: Clarify API note in Class::getName and MethodType::toMethodDescriptorString [v6]
Mandy Chung
mchung at openjdk.org
Tue Jun 27 18:21:12 UTC 2023
On Mon, 26 Jun 2023 22:36:43 GMT, Chen Liang <liach at openjdk.org> wrote:
>> `MethodType::descriptorString` refers to method descriptor and `Class::descriptorString` refers to class descriptor. I don't think it helps to say "produce identical class descriptors in method descriptors".
>
> I think we can put it simple:
> "Two distinct classes which share a common name but have different class loaders cannot be distinguished in descriptor strings"
> which stands for both class and method descriptors. How does this sound?
What about "Two distinct {@code MethodType} objects can have an identical descriptor string as distinct classes can have the same name but different class loaders."?
This api note basically says that from a given descriptor string, `fromMethodDescriptorString` may produce a different `MethodType` with a different class loader.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14411#discussion_r1244169695
More information about the core-libs-dev
mailing list