8153229: JavacFiler.checkFileReopening drowns in exceptions after Modular Runtime Images change

Using Path.equals instead of Files.isSameFile to speed up Filer checks

Reviewed-by: jjg
This commit is contained in:
Jan Lahoda 2016-12-12 17:00:30 +01:00
parent bc1ae385d3
commit b0e53fc8de

View File

@ -499,11 +499,10 @@ public abstract class PathFileObject implements JavaFileObject {
} }
boolean isSameFile(PathFileObject other) { boolean isSameFile(PathFileObject other) {
try { // By construction, the "path" field should be canonical in all likely, supported scenarios.
return Files.isSameFile(path, other.path); // (Any exceptions would involve the use of symlinks within a package hierarchy.)
} catch (IOException e) { // Therefore, it is sufficient to check that the paths are .equals.
return false; return path.equals(other.path);
}
} }
@Override @Override