< 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,81 **** Object value, LinkOption... options) throws IOException { String[] s = split(attribute); ! if (s[0].length() == 0) 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); --- 71,81 ---- Object value, LinkOption... options) throws IOException { String[] s = split(attribute); ! 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,94 **** @Override public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options) throws IOException { String[] s = split(attributes); ! if (s[0].length() == 0) 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(",")); --- 84,94 ---- @Override public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options) throws IOException { String[] s = split(attributes); ! 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 >