]> source.dussan.org Git - javassist.git/commitdiff
getClassLoader0() should not throw an exception
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 17 Aug 2006 13:18:11 +0000 (13:18 +0000)
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 17 Aug 2006 13:18:11 +0000 (13:18 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@317 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/scopedpool/ScopedClassPool.java

index 3157afb95234d23bbb2d9debfa695f989595a481..46fdd38f943021616d6c276322bc027dad8ed229 100644 (file)
@@ -31,7 +31,7 @@ import javassist.NotFoundException;
  * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
  */
 public class ScopedClassPool extends ClassPool {
     protected ScopedClassPoolRepository repository;
@@ -75,15 +75,15 @@ public class ScopedClassPool extends ClassPool {
      * @return the class loader
      */
     public ClassLoader getClassLoader() {
-        return getClassLoader0();
+       ClassLoader cl = getClassLoader0();
+       if (cl == null)
+          throw new IllegalStateException(
+                  "ClassLoader has been garbage collected");
+       return cl;
     }
 
     protected ClassLoader getClassLoader0() {
-        ClassLoader cl = (ClassLoader)classLoader.get();
-        if (cl == null)
-            throw new IllegalStateException(
-                    "ClassLoader has been garbage collected");
-        return cl;
+       return (ClassLoader)classLoader.get();
     }
 
     /**