felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r598084 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
Date Sun, 25 Nov 2007 23:11:00 GMT
Author: pauls
Date: Sun Nov 25 15:11:00 2007
New Revision: 598084

URL: http://svn.apache.org/viewvc?rev=598084&view=rev
Log:
Fix a small oversight in the extension manager that could lead to a null pointer exception
and save some memory by creating less objects.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=598084&r1=598083&r2=598084&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java Sun
Nov 25 15:11:00 2007
@@ -112,15 +112,17 @@
     private Set m_exportNames = null;
     private ISearchPolicy m_searchPolicy = null;
     private IURLPolicy m_urlPolicy = null;
-    private final List m_extensions = new ArrayList();
-    private final Set m_names = new HashSet();
-    private final Map m_sourceToExtensions = new HashMap();
+    private final List m_extensions;
+    private final Set m_names;
+    private final Map m_sourceToExtensions;
     
     // This constructor is only used for the private instance added to the parent
     // classloader.
     private ExtensionManager()
     {
-        
+        m_extensions = new ArrayList();
+        m_names = new HashSet();
+        m_sourceToExtensions = new HashMap();
     }
     
     /**
@@ -136,6 +138,9 @@
      */
     ExtensionManager(Logger logger, Map configMap, BundleInfo systemBundleInfo)
     {
+        m_extensions = null;
+        m_names = null;
+        m_sourceToExtensions = null;
         m_logger = logger;
         m_systemBundleInfo = systemBundleInfo;
 
@@ -262,7 +267,7 @@
             }
         
             // Add the bundle as extension if we support extensions
-            if (this != null) 
+            if (m_extensionManager != null) 
             {
                 // This needs to be the private instance.
                 m_extensionManager.addExtension(felix, bundle);
@@ -339,7 +344,10 @@
      */
     void removeExtensions(Felix felix) 
     {
-        m_extensionManager._removeExtensions(felix);
+        if (m_extensionManager != null)
+        {
+            m_extensionManager._removeExtensions(felix);
+        }
     }
 
     //



Mime
View raw message