incubator-any23-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1245203 - /incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java
Date Thu, 16 Feb 2012 22:06:12 GMT
Author: simonetripodi
Date: Thu Feb 16 22:06:12 2012
New Revision: 1245203

URL: http://svn.apache.org/viewvc?rev=1245203&view=rev
Log:
static instance reference field made final, avoid two or more thread accidentally instantiate
it more than once

Modified:
    incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java

Modified: incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java?rev=1245203&r1=1245202&r2=1245203&view=diff
==============================================================================
--- incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java
(original)
+++ incubator/any23/trunk/core/src/main/java/org/apache/any23/plugin/Any23PluginManager.java
Thu Feb 16 22:06:12 2012
@@ -77,7 +77,7 @@ public class Any23PluginManager {
     /**
      * Singleton lazy instance.
      */
-    private static Any23PluginManager instance;
+    private static final Any23PluginManager instance = new Any23PluginManager();
 
     /**
      * Internal class loader used to dynamically load classes.
@@ -88,9 +88,6 @@ public class Any23PluginManager {
      * @return a singleton instance of {@link Any23PluginManager}.
      */
     public static synchronized Any23PluginManager getInstance() {
-        if(instance == null) {
-            instance = new Any23PluginManager();
-        }
         return instance;
     }
 



Mime
View raw message