* ******************************************************************/
package org.aspectj.weaver;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@Override
public boolean isExposedToWeaver() {
- return (delegate == null) || delegate.isExposedToWeaver(); // ??? where
- // does this
- // belong
+ return (delegate == null) || delegate.isExposedToWeaver();
}
@Override
}
return parameterizedInterfaces;
}
+ if (delegate.isCacheable()) {
+ parameterizedInterfaces = delegateInterfaces;
+ }
+
return delegateInterfaces;
}
+ private String toString(ResolvedType[] delegateInterfaces) {
+ StringBuffer sb = new StringBuffer();
+ if (delegateInterfaces != null) {
+ for (ResolvedType rt : delegateInterfaces) {
+ sb.append(rt).append(" ");
+ }
+ }
+ return sb.toString();
+ }
+
/**
* Locates the named type variable in the list of those on this generic type and returns the type parameter from the second list
* supplied. Returns null if it can't be found
return delegate.getModifiers();
}
+ WeakReference<ResolvedType> superclassReference = new WeakReference<ResolvedType>(null);
+
@Override
public ResolvedType getSuperclass() {
+ ResolvedType ret = null;// superclassReference.get();
+ if (ret != null) {
+ return ret;
+ }
if (newSuperclass != null) {
if (this.isParameterizedType() && newSuperclass.isParameterizedType()) {
return newSuperclass.parameterize(getMemberParameterizationMap()).resolve(getWorld());
}
+ if (delegate.isCacheable()) {
+ superclassReference = new WeakReference<ResolvedType>(ret);
+ }
return newSuperclass;
}
- ResolvedType ret = null;
try {
world.setTypeVariableLookupScope(this);
ret = delegate.getSuperclass();
if (this.isParameterizedType() && ret.isParameterizedType()) {
ret = ret.parameterize(getMemberParameterizationMap()).resolve(getWorld());
}
+ if (delegate.isCacheable()) {
+ superclassReference = new WeakReference<ResolvedType>(ret);
+ }
return ret;
}
parameterizedInterfaces = null;
parameterizedMethods = null;
parameterizedPointcuts = null;
+ superclassReference = new WeakReference<ResolvedType>(null);
}
public int getEndPos() {
annotationTypes = null;
newSuperclass = null;
newInterfaces = null;
+ parameterizedInterfaces = null;
+ superclassReference = new WeakReference<ResolvedType>(null);
}
@Override
public void addParent(ResolvedType newParent) {
if (newParent.isClass()) {
newSuperclass = newParent;
+ superclassReference = new WeakReference<ResolvedType>(null);
} else {
if (newInterfaces == null) {
newInterfaces = new ResolvedType[1];
System.arraycopy(newInterfaces, 0, newNewInterfaces, 1, newInterfaces.length);
newNewInterfaces[0] = newParent;
newInterfaces = newNewInterfaces;
- parameterizedInterfaces = null;// invalidate cached info
}
+ parameterizedInterfaces = null;// invalidate cached info
}
}
}
\ No newline at end of file