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

Migrate descriptor parsing from generics to BytecodeDescriptor

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • core-libs
    • None
    • behavioral
    • minimal
    • Some previously accepted but illegal descriptor strings are now rejected. Such strings would already fail when consumed by other tools.
    • Java API
    • Implementation

      Summary

      Introduce more accurate parsing of descriptor strings in core reflection.

      Problem

      Using generic string parser to parse descriptor strings is inaccurate; it may accidentally accept generic strings. In addition, we aim to remove this legacy generic string parser, known to be erroneous sometimes, in the future to reduce maintenance cost around evolution of signatures.

      Such legacy parser usage occurs for the EnclosingMethods attribute and the annotation structures in the class file format.

      Solution

      We can simply reuse BytecodeDescriptor since it is behaviorally compatible, including exceptional contracts. Migrating to BytecodeDescriptor would also align JDK's handling of the descriptor strings closer to that by other tools or consumers of class files.

      Specification

      None. This is a purely implementation/behavioral change.

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

              Created:
              Updated: