diff -r d4099818ab70 -r 2a8304e421ed langtools/src/share/classes/com/sun/tools/javac/file/Locations.java --- a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java Thu Oct 25 11:09:36 2012 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java Thu Oct 25 13:33:27 2012 -0700 @@ -420,14 +420,10 @@ if (!options.contains(option)) return false; searchPath = value == null ? null : - Collections.unmodifiableCollection(computePath(value)); + Collections.unmodifiableCollection(createPath().addFiles(value)); return true; } - protected Path computePath(String value) { - return new Path().addFiles(value); - } - @Override Collection getLocation() { return searchPath; @@ -439,10 +435,18 @@ if (files == null) { p = computePath(null); } else { - p = new Path().addFiles(files); + p = createPath().addFiles(files); } searchPath = Collections.unmodifiableCollection(p); } + + protected Path computePath(String value) { + return createPath().addFiles(value); + } + + protected Path createPath() { + return new Path(); + } } /** @@ -477,11 +481,15 @@ // Default to current working directory. if (cp == null) cp = "."; + return createPath().addFiles(cp); + } + + @Override + protected Path createPath() { return new Path() - .expandJarClassPaths(true) // Only search user jars for Class-Paths - .emptyPathDefault(new File(".")) // Empty path elt ==> current directory - .addFiles(cp); - } + .expandJarClassPaths(true) // Only search user jars for Class-Paths + .emptyPathDefault(new File(".")); // Empty path elt ==> current directory + } private void lazy() { if (searchPath == null) @@ -591,7 +599,6 @@ String extdirsOpt = optionValues.get(EXTDIRS); String xbootclasspathPrependOpt = optionValues.get(XBOOTCLASSPATH_PREPEND); String xbootclasspathAppendOpt = optionValues.get(XBOOTCLASSPATH_APPEND); - path.addFiles(xbootclasspathPrependOpt); if (endorseddirsOpt != null)