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

Avoid redundant allocations in WindowsPreferences

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 19
    • None
    • core-libs
    • None
    • b26

    Description

      Found 2 redundant allocations in java.util.prefs.WindowsPreferences
      1.
              if ((windowsName.length() > 1) &&
                      (windowsName.substring(0, 2).equals("/!"))) {
                  return toJavaAlt64Name(windowsName);
              }
      No need to call substring here. We can use startWith instead.

      2. String array allocated and then unused in a method childrenNamesSpi

          String[] subkeys = new String[subKeysNumber];

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: