src/java.base/share/classes/jdk/internal/jrtfs/JrtFileStore.java

Print this page

        

@@ -28,10 +28,11 @@
 import java.nio.file.FileStore;
 import java.nio.file.FileSystem;
 import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.attribute.BasicFileAttributeView;
 import java.nio.file.attribute.FileStoreAttributeView;
+import java.util.Objects;
 
 /**
  * File store implementation for jrt file systems.
  *
  * @implNote This class needs to maintain JDK 8 source compatibility.

@@ -42,11 +43,11 @@
  */
 final class JrtFileStore extends FileStore {
 
     protected final FileSystem jrtfs;
 
-    JrtFileStore(AbstractJrtPath jrtPath) {
+    JrtFileStore(JrtPath jrtPath) {
         this.jrtfs = jrtPath.getFileSystem();
     }
 
     @Override
     public String name() {

@@ -69,13 +70,11 @@
     }
 
     @Override
     @SuppressWarnings("unchecked")
     public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) {
-        if (type == null) {
-            throw new NullPointerException();
-        }
+        Objects.requireNonNull(type, "type");
         return (V) null;
     }
 
     @Override
     public long getTotalSpace() throws IOException {

@@ -97,9 +96,9 @@
         throw new UnsupportedOperationException("does not support " + attribute);
     }
 
     @Override
     public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) {
-        return (type == BasicFileAttributeView.class
-                || type == JrtFileAttributeView.class);
+        return type == BasicFileAttributeView.class ||
+               type == JrtFileAttributeView.class;
     }
 }