summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-02-09 16:39:32 +0000
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-02-09 16:39:32 +0000
commit0940370343d08e42be624650d0a9077dc838b4f9 (patch)
treead668b19b540cb236b90bd538001531e79969385
parent59dcdf0551f844861aeb6768509b1b0ba220a8f0 (diff)
downloadjavassist-0940370343d08e42be624650d0a9077dc838b4f9.tar.gz
javassist-0940370343d08e42be624650d0a9077dc838b4f9.zip
Repair previous mistake when commiting
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@350 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r--src/main/javassist/bytecode/SignatureAttribute.java5
-rw-r--r--src/main/javassist/scopedpool/ScopedClassPool.java46
2 files changed, 37 insertions, 14 deletions
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 <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;
}