From: kkhan Date: Fri, 9 Feb 2007 16:39:32 +0000 (+0000) Subject: Repair previous mistake when commiting X-Git-Tag: rel_3_17_1_ga~285 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0940370343d08e42be624650d0a9077dc838b4f9;p=javassist.git Repair previous mistake when commiting git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@350 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/bytecode/SignatureAttribute.java b/src/main/javassist/bytecode/SignatureAttribute.java index 41748e7c..808809ed 100644 --- a/src/main/javassist/bytecode/SignatureAttribute.java +++ b/src/main/javassist/bytecode/SignatureAttribute.java @@ -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 { diff --git a/src/main/javassist/scopedpool/ScopedClassPool.java b/src/main/javassist/scopedpool/ScopedClassPool.java index 46fdd38f..455b6737 100644 --- a/src/main/javassist/scopedpool/ScopedClassPool.java +++ b/src/main/javassist/scopedpool/ScopedClassPool.java @@ -31,7 +31,7 @@ import javassist.NotFoundException; * @author Bill Burke * @author Adrian Brock * @author Kabir Khan - * @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; }