src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java
changeset 53018 8bf9268df0e2
parent 47216 71c04702a3d5
--- a/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java	Thu Dec 13 16:14:07 2018 +0100
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java	Thu Dec 13 15:31:05 2018 +0100
@@ -58,8 +58,7 @@
         // default directory.
         String propValue = GetPropertyAction
                 .privilegedGetProperty("sun.nio.fs.chdirAllowed", "false");
-        boolean chdirAllowed = (propValue.length() == 0) ?
-            true : Boolean.valueOf(propValue);
+        boolean chdirAllowed = propValue.isEmpty() ? true : Boolean.parseBoolean(propValue);
         if (chdirAllowed) {
             this.needToResolveAgainstDefaultDirectory = true;
         } else {
@@ -269,7 +268,7 @@
             StringBuilder sb = new StringBuilder();
             sb.append(first);
             for (String segment: more) {
-                if (segment.length() > 0) {
+                if (!segment.isEmpty()) {
                     if (sb.length() > 0)
                         sb.append('/');
                     sb.append(segment);