incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1446234 - /sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
Date Thu, 14 Feb 2013 15:30:44 GMT
Author: cziegeler
Date: Thu Feb 14 15:30:44 2013
New Revision: 1446234

URL: http://svn.apache.org/r1446234
Log:
SLING-2702 :  NPE as repository class loader might not have been instantiated 

Modified:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java?rev=1446234&r1=1446233&r2=1446234&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
Thu Feb 14 15:30:44 2013
@@ -112,12 +112,6 @@ public class ClassLoaderWriterImpl
     private volatile RepositoryClassLoader repositoryClassLoader;
 
     /**
-     * The dynamic class loader used as the parent of the repository
-     * class loader.
-     */
-    private volatile ClassLoader dynamicClassLoader;
-
-    /**
      * Activate this component.
      * @param props The configuration properties
      */
@@ -178,9 +172,9 @@ public class ClassLoaderWriterImpl
             this.repositoryClassLoader = null;
         }
 
-        if (this.dynamicClassLoader != null) {
+        if (this.dynamicClassLoaderManager != null) {
             this.callerBundle.getBundleContext().ungetService(this.dynamicClassLoaderManager);
-            this.dynamicClassLoader = null;
+            this.dynamicClassLoaderManager = null;
         }
     }
 
@@ -219,14 +213,13 @@ public class ClassLoaderWriterImpl
 
             // get the dynamic class loader for the bundle using this
             // class loader writer
-            DynamicClassLoaderManager dclm = (DynamicClassLoaderManager) this.callerBundle.getBundleContext().getService(
+            final DynamicClassLoaderManager dclm = (DynamicClassLoaderManager) this.callerBundle.getBundleContext().getService(
                 this.dynamicClassLoaderManager);
-            this.dynamicClassLoader = dclm.getDynamicClassLoader();
 
             this.repositoryClassLoader = new RepositoryClassLoader(
                     this.classPath,
                     this,
-                    this.dynamicClassLoader);
+                    dclm.getDynamicClassLoader());
         }
         return this.repositoryClassLoader;
     }



Mime
View raw message