提交 a67dbb67 编写于 作者: A alanb

7029979: (fs) Path.toRealPath(boolean) should be toRealPath(LinkOption...)

Reviewed-by: mcimadamore, jjg
上级 f79d7450
...@@ -37,6 +37,7 @@ import java.nio.ByteBuffer; ...@@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer; import java.nio.CharBuffer;
import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetDecoder;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.BasicFileAttributes;
import javax.lang.model.element.Modifier; import javax.lang.model.element.Modifier;
...@@ -170,7 +171,7 @@ abstract class PathFileObject implements JavaFileObject { ...@@ -170,7 +171,7 @@ abstract class PathFileObject implements JavaFileObject {
if (pn.equalsIgnoreCase(sn)) { if (pn.equalsIgnoreCase(sn)) {
try { try {
// allow for Windows // allow for Windows
return path.toRealPath(false).getFileName().toString().equals(sn); return path.toRealPath(LinkOption.NOFOLLOW_LINKS).getFileName().toString().equals(sn);
} catch (IOException e) { } catch (IOException e) {
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册