]> source.dussan.org Git - javassist.git/commitdiff
Repair previous mistake when commiting
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 9 Feb 2007 16:39:32 +0000 (16:39 +0000)
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Fri, 9 Feb 2007 16:39:32 +0000 (16:39 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@350 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/bytecode/SignatureAttribute.java
src/main/javassist/scopedpool/ScopedClassPool.java

index 41748e7cf6baff5f20faf7579ac112e7b25ef868..808809edce08050120b8955136dfe49499f204c2 100644 (file)
@@ -610,10 +610,7 @@ public class SignatureAttribute extends AttributeInfo {
         ObjectType[] ex = (ObjectType[])exceptions.toArray(new ObjectType[exceptions.size()]);
         return new MethodSignature(tp, p, ret, ex);
     }
-boolean getB()
-{
-   return false;
-}
+
     private static TypeParameter[] parseTypeParams(String sig, Cursor cur)
         throws BadBytecode
     {
index 46fdd38f943021616d6c276322bc027dad8ed229..455b673768e874ed2a8b6349da1bbb7e6858f06a 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.6 $
+ * @version $Revision: 1.7 $
  */
 public class ScopedClassPool extends ClassPool {
     protected ScopedClassPoolRepository repository;
@@ -41,6 +41,8 @@ public class ScopedClassPool extends ClassPool {
     protected LoaderClassPath classPath;
 
     protected SoftValueHashMap softcache = new SoftValueHashMap();
+    
+    boolean isBootstrapCl = true;
 
     static {
         ClassPool.doPruning = false;
@@ -56,17 +58,39 @@ public class ScopedClassPool extends ClassPool {
      *            the original class pool
      * @param repository
      *            the repository
+     *@deprecated
      */
     protected ScopedClassPool(ClassLoader cl, ClassPool src,
             ScopedClassPoolRepository repository) {
-        super(src);
-        this.repository = repository;
-        this.classLoader = new WeakReference(cl);
-        if (cl != null) {
-            classPath = new LoaderClassPath(cl);
-            this.insertClassPath(classPath);
-        }
-        childFirstLookup = true;
+       this(cl, src, repository, false);
+    }
+    
+    /**
+     * Create a new ScopedClassPool.
+     * 
+     * @param cl
+     *            the classloader
+     * @param src
+     *            the original class pool
+     * @param repository
+     *            the repository
+     * @param isTemp
+     *            Whether this is a temporary pool used to resolve references
+     */
+    protected ScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean isTemp)
+    {
+       super(src);
+       this.repository = repository;
+       this.classLoader = new WeakReference(cl);
+       if (cl != null) {
+           classPath = new LoaderClassPath(cl);
+           this.insertClassPath(classPath);
+       }
+       childFirstLookup = true;
+       if (!isTemp && cl == null)
+       {
+          isBootstrapCl = true;
+       }
     }
 
     /**
@@ -76,9 +100,11 @@ public class ScopedClassPool extends ClassPool {
      */
     public ClassLoader getClassLoader() {
        ClassLoader cl = getClassLoader0();
-       if (cl == null)
+       if (cl == null && !isBootstrapCl)
+       {
           throw new IllegalStateException(
                   "ClassLoader has been garbage collected");
+       }
        return cl;
     }