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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8, 9
    • core-libs
    • b76
    • os_x

        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);
            }

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

                Created:
                Updated:
                Resolved: