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

Remove unused method java.lang.Integer::formatUnsignedInt and cleanup Integer/Long classes

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b03

      Description

      package-private method formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) was used before compact strings (JEP 254) were introduced. Since then it's never called and should be removed. The corresponding method in java.lang.Long was already removed in JDK-8148936.

      Other minor things could be cleaned up in java.lang.Integer and java.lang.Long:
      1. s = Objects.requireNonNull(s) could be replaced with Objects.requireNonNull(s)
      2. Dangling javadoc in Long class before formatUnsignedLong0 could be properly attached to formatUnsignedLong0 and formatUnsignedLong0UTF16 (changing character buffer to byte buffer)
      3. Similarly javadoc for remaining Integer::formatUnsignedInt and Integer::formatUnsignedIntUTF16 could be specified
      4. Integer::formatUnsignedInt and Long::formatUnsignedLong0 could be private, similar to formatUnsignedIntUTF16 and formatUnsignedLong0UTF16
      5. Integer::formatUnsignedInt and Integer::formatUnsignedIntUTF16 offset parameter is always zero and could be inlined.

        Attachments

          Activity

            People

            Assignee:
            tvaleev Tagir Valeev
            Reporter:
            tvaleev Tagir Valeev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: