8177332: The presence of a file with a Japanese ShiftJIS name can cause javac to fail
Reviewed-by: jjg, jlahoda
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java Tue Apr 04 14:06:54 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java Tue Apr 04 15:15:59 2017 -0700
@@ -473,10 +473,14 @@
}
} else {
if (isValidFile(fname, fileKinds)) {
- RelativeFile file = new RelativeFile(subdirectory, fname);
- JavaFileObject fe = PathFileObject.forDirectoryPath(JavacFileManager.this,
- file.resolveAgainst(directory), userPath, file);
- resultList.append(fe);
+ try {
+ RelativeFile file = new RelativeFile(subdirectory, fname);
+ JavaFileObject fe = PathFileObject.forDirectoryPath(JavacFileManager.this,
+ file.resolveAgainst(directory), userPath, file);
+ resultList.append(fe);
+ } catch (InvalidPathException e) {
+ throw new IOException("error accessing directory " + directory + e);
+ }
}
}
}