java.lang.classfile.TypeKind improvements

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 23
    • Affects Version/s: 23
    • Component/s: core-libs
    • None

      java.lang.classfile.TypeKind has a few problems:
      1. inconsistent method names newarraycode() and fromNewArrayCode(int)
      2. fromDescriptor(String) can throw IndexOutOfBoundsException instead of always throwing IllegalArgumentException
      3. from(TypeDescriptor.OfField) is slow for Class objects for reference types.

      Proposed improvements:
      1. Rename the methods to newarrayCode and fromNewarrayCode, `newarray` is a bytecode name and is a word like `invokestatic`.
      2. Change fromDescriptor to throw IAE for 0-length input Strings
      3. Update implementation to speed up from() when provided a Class object

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

              Created:
              Updated:
              Resolved: