changeset 1031:7916df9c99be

7029979: (fs) Path.toRealPath(boolean) should be toRealPath(LinkOption...) Reviewed-by: mcimadamore, jjg
author alanb
date Mon, 04 Apr 2011 18:10:38 +0100
parents 46d720734db3
children 26b065bb4ee7
files src/share/classes/com/sun/tools/javac/nio/PathFileObject.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java	Sun Apr 03 17:00:50 2011 -0700
+++ b/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) {
             }
         }