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

Avoid redundant allocations in WindowsPreferences

XMLWordPrintable

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

      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];

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

              Created:
              Updated:
              Resolved: