summaryrefslogtreecommitdiffstats
path: root/weaver/src/org
diff options
context:
space:
mode:
authoraclement <aclement>2009-11-02 16:57:15 +0000
committeraclement <aclement>2009-11-02 16:57:15 +0000
commit90525666070cf73478c6dd5dc09d2278dee5ba8f (patch)
tree0da67c86a026e76a792c3148799c687386f6b6fa /weaver/src/org
parent5a228eb0ef0199d24b0a5a7588ab14ff9feb34ce (diff)
downloadaspectj-90525666070cf73478c6dd5dc09d2278dee5ba8f.tar.gz
aspectj-90525666070cf73478c6dd5dc09d2278dee5ba8f.zip
293620: c5
Diffstat (limited to 'weaver/src/org')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java36
1 files changed, 19 insertions, 17 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
index 91c0eb4d7..6aba253d6 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
@@ -14,6 +14,7 @@
package org.aspectj.weaver.bcel;
import java.io.PrintStream;
+import java.lang.ref.WeakReference;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
@@ -108,6 +109,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
private boolean isCodeStyleAspect = false; // not redundant with field
// above!
+ private WeakReference<ResolvedType> superTypeReference = new WeakReference<ResolvedType>(null);
+
private int bitflag = 0x0000;
// discovery bits
@@ -212,18 +215,23 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
if (isObject) {
return null;
}
- ensureGenericSignatureUnpacked();
- if (superclassSignature == null) {
- if (superclassName == null) {
- superclassName = javaClass.getSuperclassName();
+ ResolvedType supertype = superTypeReference.get();
+ if (supertype == null) {
+ ensureGenericSignatureUnpacked();
+ if (superclassSignature == null) {
+ if (superclassName == null) {
+ superclassName = javaClass.getSuperclassName();
+ }
+ superclassSignature = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(superclassName)).getSignature();
}
- superclassSignature = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(superclassName)).getSignature();
+ World world = getResolvedTypeX().getWorld();
+ supertype = world.resolve(UnresolvedType.forSignature(superclassSignature));
+ superTypeReference = new WeakReference<ResolvedType>(supertype);
}
- World world = getResolvedTypeX().getWorld();
- ResolvedType res = world.resolve(UnresolvedType.forSignature(superclassSignature));
- return res;
+ return supertype;
}
+
public World getWorld() {
return getResolvedTypeX().getWorld();
}
@@ -294,13 +302,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
}
if (typeVars == null) {
- GenericSignature.ClassSignature classSig = getGenericClassTypeSignature();// cachedGenericClassTypeSignature
- // ;
- // /
- // /
- // javaClass
- // .
- // getGenericClassTypeSignature();
+ GenericSignature.ClassSignature classSig = getGenericClassTypeSignature();
typeVars = new TypeVariable[classSig.formalTypeParameters.length];
for (int i = 0; i < typeVars.length; i++) {
GenericSignature.FormalTypeParameter ftp = classSig.formalTypeParameters[i];
@@ -588,7 +590,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
return false;
}
ensureAnnotationsUnpacked();
- for (int i = 0; i < annotationTypes.length; i++) {
+ for (int i = 0, max = annotationTypes.length; i < max; i++) {
UnresolvedType ax = annotationTypes[i];
if (ax == null) {
throw new RuntimeException("Annotation entry " + i + " on type " + this.getResolvedTypeX().getName() + " is null!");
@@ -715,7 +717,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
+ "', failed to resolve type '" + typeSignature + "'");
}
annotationTypes[i] = rType;
- annotations[i] = new BcelAnnotation(annotation, w);
+ annotations[i] = new BcelAnnotation(annotation, rType);
}
}
} finally {