Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309819

Clarify API note in Class::getName and MethodType::toMethodDescriptorString

    XMLWordPrintable

Details

    Backports

      Description

        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 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.

        Attachments

          Issue Links

            Activity

              People

                liach Chen Liang
                liach Chen Liang
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: