< prev index next >

src/java.base/share/classes/sun/nio/fs/AbstractFileSystemProvider.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -71,11 +71,11 @@
                                    Object value,
                                    LinkOption... options)
         throws IOException
     {
         String[] s = split(attribute);
-        if (s[0].length() == 0)
+        if (s[0].isEmpty())
             throw new IllegalArgumentException(attribute);
         DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
         if (view == null)
             throw new UnsupportedOperationException("View '" + s[0] + "' not available");
         view.setAttribute(s[1], value);

@@ -84,11 +84,11 @@
     @Override
     public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options)
         throws IOException
     {
         String[] s = split(attributes);
-        if (s[0].length() == 0)
+        if (s[0].isEmpty())
             throw new IllegalArgumentException(attributes);
         DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
         if (view == null)
             throw new UnsupportedOperationException("View '" + s[0] + "' not available");
         return view.readAttributes(s[1].split(","));
< prev index next >