提交 00f0725a 编写于 作者: A alanb

8026876: (fs) Build issue with...

8026876: (fs) Build issue with src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
Reviewed-by: psandoz
上级 7142b15a
...@@ -47,11 +47,14 @@ class SolarisUserDefinedFileAttributeView ...@@ -47,11 +47,14 @@ class SolarisUserDefinedFileAttributeView
private byte[] nameAsBytes(UnixPath file, String name) throws IOException { private byte[] nameAsBytes(UnixPath file, String name) throws IOException {
byte[] bytes = Util.toBytes(name); byte[] bytes = Util.toBytes(name);
// "", "." and ".." not allowed // "", "." and ".." not allowed
if ((bytes.length == 0 || bytes[0] == '.') && if (bytes.length == 0 || bytes[0] == '.') {
((bytes.length <= 1 || (bytes.length == 2 && bytes[1] == '.')) { if (bytes.length <= 1 ||
(bytes.length == 2 && bytes[1] == '.'))
{
throw new FileSystemException(file.getPathForExceptionMessage(), throw new FileSystemException(file.getPathForExceptionMessage(),
null, "'" + name + "' is not a valid name"); null, "'" + name + "' is not a valid name");
} }
}
return bytes; return bytes;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册