[libbluray-devel] Simplify

hpi1 git at videolan.org
Fri Apr 15 12:25:26 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr 13 14:43:01 2016 +0300| [84eac20a651647ccb5b23577deb833da8e6944d5] | committer: hpi1

Simplify

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=84eac20a651647ccb5b23577deb833da8e6944d5
---

 .../bdj/java/org/bluray/storage/StorageManager.java         |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/libbluray/bdj/java/org/bluray/storage/StorageManager.java b/src/libbluray/bdj/java/org/bluray/storage/StorageManager.java
index 5ea1c57..d8082af 100644
--- a/src/libbluray/bdj/java/org/bluray/storage/StorageManager.java
+++ b/src/libbluray/bdj/java/org/bluray/storage/StorageManager.java
@@ -20,12 +20,11 @@
 package org.bluray.storage;
 
 public class StorageManager {
+
+    private static final StorageManager instance = new StorageManager();
+
     public static StorageManager getInstance() {
-        synchronized (StorageManager.class) {
-            if (instance == null)
-                instance = new StorageManager();
-            return instance;
-        }
+        return instance;
     }
 
     protected StorageManager() {
@@ -38,6 +37,4 @@ public class StorageManager {
     public DataAreaInfo getPersistentDataAreaInfo() {
         return new PersistentDataAreaInfo();
     }
-
-    private static StorageManager instance = null;
 }



More information about the libbluray-devel mailing list