Avoid redundant allocations in WindowsPreferences

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 19
    • Affects Version/s: None
    • Component/s: 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];

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

              Created:
              Updated:
              Resolved: