felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r747183 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ExtensionManager.java searchpolicy/ModuleImpl.java
Date Mon, 23 Feb 2009 22:49:33 GMT
Author: rickhall
Date: Mon Feb 23 22:49:31 2009
New Revision: 747183

URL: http://svn.apache.org/viewvc?rev=747183&view=rev
Log:
Extension manager module should throw CNFE exception, not log it. A few other
class loading improvements. (FELIX-953)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.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=747183&r1=747182&r2=747183&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 Mon
Feb 23 22:49:31 2009
@@ -649,18 +649,7 @@
                 return null;
             }
 
-            try
-            {
-                return getClass().getClassLoader().loadClass(name);
-            }
-            catch (ClassNotFoundException ex)
-            {
-                m_logger.log(
-                    Logger.LOG_WARNING,
-                    ex.getMessage(),
-                    ex);
-            }
-            return null;
+            return getClass().getClassLoader().loadClass(name);
         }
 
         public URL getResourceByDelegation(String name)

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java?rev=747183&r1=747182&r2=747183&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
Mon Feb 23 22:49:31 2009
@@ -414,22 +414,22 @@
 
     public Class getClassByDelegation(String name) throws ClassNotFoundException
     {
-        Set pkgCycleSet = (Set) m_cycleCheck.get();
-        if (pkgCycleSet == null)
+        Set requestSet = (Set) m_cycleCheck.get();
+        if (requestSet == null)
         {
-            pkgCycleSet = new HashSet();
-            m_cycleCheck.set(pkgCycleSet);
+            requestSet = new HashSet();
+            m_cycleCheck.set(requestSet);
         }
-        if (!pkgCycleSet.contains(name))
+        if (!requestSet.contains(name))
         {
-            pkgCycleSet.add(name);
+            requestSet.add(name);
             try
             {
                 return getClassLoader().loadClass(name);
             }
             finally
             {
-                pkgCycleSet.remove(name);
+                requestSet.remove(name);
             }
         }
         return null;
@@ -437,15 +437,15 @@
 
     public URL getResourceByDelegation(String name)
     {
-        Set pkgCycleSet = (Set) m_cycleCheck.get();
-        if (pkgCycleSet == null)
+        Set requestSet = (Set) m_cycleCheck.get();
+        if (requestSet == null)
         {
-            pkgCycleSet = new HashSet();
-            m_cycleCheck.set(pkgCycleSet);
+            requestSet = new HashSet();
+            m_cycleCheck.set(requestSet);
         }
-        if (!pkgCycleSet.contains(name))
+        if (!requestSet.contains(name))
         {
-            pkgCycleSet.add(name);
+            requestSet.add(name);
             try
             {
                 return (URL) findClassOrResourceByDelegation(name, false);
@@ -463,7 +463,7 @@
             }
             finally
             {
-                pkgCycleSet.remove(name);
+                requestSet.remove(name);
             }
         }
 
@@ -608,22 +608,22 @@
 
     public Enumeration getResourcesByDelegation(String name)
     {
-        Set pkgCycleSet = (Set) m_cycleCheck.get();
-        if (pkgCycleSet == null)
+        Set requestSet = (Set) m_cycleCheck.get();
+        if (requestSet == null)
         {
-            pkgCycleSet = new HashSet();
-            m_cycleCheck.set(pkgCycleSet);
+            requestSet = new HashSet();
+            m_cycleCheck.set(requestSet);
         }
-        if (!pkgCycleSet.contains(name))
+        if (!requestSet.contains(name))
         {
-            pkgCycleSet.add(name);
+            requestSet.add(name);
             try
             {
                 return findResourcesByDelegation(name);
             }
             finally
             {
-                pkgCycleSet.remove(name);
+                requestSet.remove(name);
             }
         }
 
@@ -1368,7 +1368,7 @@
             {
                 try
                 {
-                    return (Class) findClassOrResourceByDelegation(name, true);
+                    clazz = (Class) findClassOrResourceByDelegation(name, true);
                 }
                 catch (ResourceNotFoundException ex)
                 {
@@ -1398,13 +1398,7 @@
 
         protected Class findClass(String name) throws ClassNotFoundException
         {
-            // Do a quick check here to see if we can short-circuit this
-            // entire process if the class was already loaded.
             Class clazz = null;
-            synchronized (this)
-            {
-                clazz = findLoadedClass(name);
-            }
 
             // Search for class in module.
             if (clazz == null)



Mime
View raw message