< prev index next >

src/java.base/macosx/classes/sun/nio/fs/DefaultFileSystemProvider.java

Print this page
8213406: (fs) More than one instance of built-in FileSystem observed in heap
Reviewed-by: alanb, cushon, weijun

@@ -23,21 +23,23 @@
  * questions.
  */
 
 package sun.nio.fs;
 
-import java.nio.file.spi.FileSystemProvider;
+import javaimport java.nio.file.FileSystem;
 
 /**
- * Creates this platform's default FileSystemProvider.
+ * Creates this platform's system-default ("builtin") FileSystemProvider.
  */
 
 public class DefaultFileSystemProvider {
     private DefaultFileSystemProvider() { }
 
-    /**
-     * Returns the default FileSystemProvider.
-     */
-    public static FileSystemProvider create() {
-        return new MacOSXFileSystemProvider();
+    /** The unique instance of the system-default file system provider. */
+    public static final MacOSXFileSystemProvider FILE_SYSTEM_PROVIDER
+        = new MacOSXFileSystemProvider();
+
+    /** Returns the unique instance of the system-default file system. */
+    public static FileSystem theFileSystem() {
+        return FILE_SYSTEM_PROVIDER.theFileSystem;
     }
 }
< prev index next >