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

java.lang.classfile.TypeKind improvements

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 23
    • 23
    • core-libs
    • None

    Description

      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

      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: