7029979: (fs) Path.toRealPath(boolean) should be toRealPath(LinkOption...)
Reviewed-by: mcimadamore, jjg
This commit is contained in:
parent
e3d10322c1
commit
39b8c8c057
@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
|
||||
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 @@ abstract class PathFileObject implements JavaFileObject {
|
||||
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) {
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user