--- a/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java Mon Dec 13 15:11:00 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java Mon Dec 13 17:35:57 2010 -0800
@@ -286,9 +286,8 @@
}
public void addFile(File file, boolean warn) {
- File canonFile = fsInfo.getCanonicalFile(file);
- if (contains(file) || canonicalValues.contains(canonFile)) {
- /* Discard duplicates and avoid infinite recursion */
+ if (contains(file)) {
+ // discard duplicates
return;
}
@@ -298,7 +297,17 @@
log.warning(Lint.LintCategory.PATH,
"path.element.not.found", file);
}
- } else if (fsInfo.isFile(file)) {
+ super.add(file);
+ return;
+ }
+
+ File canonFile = fsInfo.getCanonicalFile(file);
+ if (canonicalValues.contains(canonFile)) {
+ /* Discard duplicates and avoid infinite recursion */
+ return;
+ }
+
+ if (fsInfo.isFile(file)) {
/* File is an ordinary file. */
if (!isArchive(file)) {
/* Not a recognized extension; open it to see if
@@ -322,11 +331,11 @@
}
/* Now what we have left is either a directory or a file name
- confirming to archive naming convention */
+ conforming to archive naming convention */
super.add(file);
canonicalValues.add(canonFile);
- if (expandJarClassPaths && fsInfo.exists(file) && fsInfo.isFile(file))
+ if (expandJarClassPaths && fsInfo.isFile(file))
addJarClassPath(file, warn);
}