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

(prefs) Unused variable in src/java.prefs/share/classes/java/util/prefs/MacOSXPreferences.java

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b76
    • OS:
      os_x

      Backports

        Description

        In src/macosx/classes/java/util/prefs/MacOSXPreferences.java, the variable:

        int componentCount = 0;

        is not used:

            private MacOSXPreferencesFile cfFileForNode(boolean isUser)
            {
                String name = path;
                // /one/two/three/four/five/
                // The fourth slash is the end of the first three components.
                // If there is no fourth slash, the name has fewer than 3 components
                int componentCount = 0;
                int pos = -1;
                for (int i = 0; i < 4; i++) {
                    pos = name.indexOf('/', pos+1);
                    if (pos == -1) break;
                }

                if (pos == -1) {
                    // fewer than three components - use default name
                    name = defaultAppName;
                } else {
                    // truncate to three components, no leading or trailing '/'
                    // replace '/' with '.' to make filesystem happy
                    // convert to all lowercase to survive on HFS+
                    name = name.substring(1, pos);
                    name = name.replace('/', '.');
                    name = name.toLowerCase();
                }

                return MacOSXPreferencesFile.getFile(name, isUser);
            }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sdrach Steve Drach (Inactive)
                Reporter:
                cbensen Chris Bensen (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: