7029979: (fs) Path.toRealPath(boolean) should be toRealPath(LinkOption...)
Reviewed-by: mcimadamore, jjg
--- a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Mon Apr 04 18:10:38 2011 +0100
@@ -37,6 +37,7 @@
import java.nio.CharBuffer;
import java.nio.charset.CharsetDecoder;
import java.nio.file.Files;
+import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import javax.lang.model.element.Modifier;
@@ -170,7 +171,7 @@
if (pn.equalsIgnoreCase(sn)) {
try {
// allow for Windows
- return path.toRealPath(false).getFileName().toString().equals(sn);
+ return path.toRealPath(LinkOption.NOFOLLOW_LINKS).getFileName().toString().equals(sn);
} catch (IOException e) {
}
}