From d367fc0c178d112ef8086f560c95df438ebe3caa Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Fri, 18 Oct 2013 15:51:43 +0100 Subject: [PATCH] 8026876: (fs) Build issue with src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java Reviewed-by: psandoz --- .../nio/fs/SolarisUserDefinedFileAttributeView.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java index 334aac548d6..d3a34cac129 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java @@ -46,11 +46,14 @@ class SolarisUserDefinedFileAttributeView private byte[] nameAsBytes(UnixPath file, String name) throws IOException { byte[] bytes = Util.toBytes(name); - // "", "." and ".." not allowed - if ((bytes.length == 0 || bytes[0] == '.') && - ((bytes.length <= 1 || (bytes.length == 2 && bytes[1] == '.')) { - throw new FileSystemException(file.getPathForExceptionMessage(), - null, "'" + name + "' is not a valid name"); + // "", "." and ".." not allowed + if (bytes.length == 0 || bytes[0] == '.') { + if (bytes.length <= 1 || + (bytes.length == 2 && bytes[1] == '.')) + { + throw new FileSystemException(file.getPathForExceptionMessage(), + null, "'" + name + "' is not a valid name"); + } } return bytes; }