@@ -13,17 +13,12 @@ | |||
package org.aspectj.weaver; | |||
import java.util.ArrayList; | |||
import java.util.Collection; | |||
import java.util.Collections; | |||
import java.util.Comparator; | |||
import java.util.Iterator; | |||
import java.util.List; | |||
import org.aspectj.apache.bcel.classfile.GenericSignatureParser; | |||
import org.aspectj.apache.bcel.classfile.Signature; | |||
import org.aspectj.apache.bcel.classfile.Signature.ClassSignature; | |||
import org.aspectj.bridge.ISourceLocation; | |||
import org.aspectj.weaver.patterns.Declare; | |||
public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDelegate { | |||
@@ -43,8 +38,6 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele | |||
public final boolean isClass() { | |||
return !isAspect() && !isInterface(); | |||
} | |||
/** | |||
* Designed to be overriden by EclipseType to disable collection of shadow mungers | |||
@@ -62,187 +55,7 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele | |||
return resolvedTypeX; | |||
} | |||
/** | |||
* Create the string representation for a delegate, allowing us to | |||
* more easily compare delegate implementations. | |||
*/ | |||
public String stringifyDelegate() { | |||
StringBuffer result = new StringBuffer(); | |||
result.append("=== Delegate for "+getResolvedTypeX().getName()+"\n"); | |||
result.append("isAspect?"+isAspect()+"\n"); | |||
result.append("isAnnotationStyleAspect?"+isAnnotationStyleAspect()+"\n"); | |||
result.append("isInterface?"+isInterface()+"\n"); | |||
result.append("isEnum?"+isEnum()+"\n"); | |||
result.append("isClass?"+isClass()+"\n"); | |||
result.append("-\n"); | |||
result.append("isAnnotation?"+isAnnotation()+"\n"); | |||
result.append("retentionPolicy="+getRetentionPolicy()+"\n"); | |||
result.append("canAnnotationTargetType?"+canAnnotationTargetType()+"\n"); | |||
AnnotationTargetKind[] kinds = getAnnotationTargetKinds(); | |||
if (kinds!=null && kinds.length>0) { | |||
result.append("annotationTargetKinds:["); | |||
for (int i = 0; i < kinds.length; i++) { | |||
AnnotationTargetKind kind = kinds[i]; | |||
result.append(kind); | |||
if ((i+1)<kinds.length) result.append(" "); | |||
} | |||
result.append("]\n"); | |||
} | |||
result.append("isAnnotationWithRuntimeRetention?"+isAnnotationWithRuntimeRetention()+"\n"); | |||
result.append("-\n"); | |||
result.append("isAnonymous?"+isAnonymous()+"\n"); | |||
result.append("isNested?"+isNested()+"\n"); | |||
result.append("-\n"); | |||
result.append("isGeneric?"+isGeneric()+"\n"); | |||
result.append("declaredGenericSignature="+getDeclaredGenericSignature()+"\n"); | |||
result.append("-\n"); | |||
AnnotationX[] axs = getAnnotations(); | |||
if (axs!=null && axs.length>0) { | |||
result.append("getAnnotations() returns: "+axs.length+" annotations\n"); | |||
for (int i = 0; i < axs.length; i++) { | |||
AnnotationX annotationX = axs[i]; | |||
result.append(" #"+i+") "+annotationX+"\n"); | |||
} | |||
} else { | |||
result.append("getAnnotations() returns nothing\n"); | |||
} | |||
ResolvedType[] axtypes = getAnnotationTypes(); | |||
if (axtypes!=null && axtypes.length>0) { | |||
result.append("getAnnotationTypes() returns: "+axtypes.length+" annotations\n"); | |||
for (int i = 0; i < axtypes.length; i++) { | |||
ResolvedType annotation = axtypes[i]; | |||
result.append(" #"+i+") "+annotation+":"+annotation.getClass()+"\n"); | |||
} | |||
} else { | |||
result.append("getAnnotationTypes() returns nothing\n"); | |||
} | |||
result.append("isExposedToWeaver?"+isExposedToWeaver()+"\n"); | |||
result.append("getSuperclass?"+getSuperclass()+"\n"); | |||
result.append("getResolvedTypeX?"+getResolvedTypeX()+"\n"); | |||
result.append("--\n"); | |||
ResolvedMember[] fields = getDeclaredFields(); | |||
if (fields!=null && fields.length>0) { | |||
result.append("The fields: "+fields.length+"\n"); | |||
for (int i = 0; i < fields.length; i++) { | |||
ResolvedMember member = fields[i]; | |||
result.append("f"+i+") "+member.toDebugString()+"\n"); | |||
} | |||
} | |||
ResolvedMember[] methods = getDeclaredMethods(); | |||
if (methods!=null && methods.length>0) { | |||
result.append("The methods: "+methods.length+"\n"); | |||
for (int i = 0; i < methods.length; i++) { | |||
ResolvedMember member = methods[i]; | |||
result.append("m"+i+") "+member.toDebugString()+"\n"); | |||
} | |||
} | |||
ResolvedType[] interfaces = getDeclaredInterfaces(); | |||
if (interfaces!=null && interfaces.length>0) { | |||
result.append("The interfaces: "+interfaces.length+"\n"); | |||
for (int i = 0; i < interfaces.length; i++) { | |||
ResolvedType member = interfaces[i]; | |||
result.append("i"+i+") "+member+"\n"); | |||
} | |||
} | |||
result.append("getModifiers?"+getModifiers()+"\n"); | |||
result.append("perclause="+getPerClause()+"\n"); | |||
result.append("aj:weaverstate="+getWeaverState()+"\n"); | |||
ResolvedMember[] pointcuts = getDeclaredPointcuts(); | |||
if (pointcuts!=null && pointcuts.length>0) { | |||
result.append("The pointcuts: "+pointcuts.length+"\n"); | |||
// Sort the damn things | |||
List sortedSetOfPointcuts = new ArrayList(); | |||
for (int i = 0; i < pointcuts.length; i++) {sortedSetOfPointcuts.add(pointcuts[i]);} | |||
Collections.sort(sortedSetOfPointcuts); | |||
int i =0; | |||
for (Iterator iter = sortedSetOfPointcuts.iterator(); iter.hasNext();) { | |||
ResolvedMember member = (ResolvedMember) iter.next(); | |||
result.append("p"+i+") "+member.toDebugString()+"\n"); | |||
i++; | |||
} | |||
} | |||
Collection declares = getDeclares(); | |||
if (declares.size()>0) { | |||
result.append("The declares: "+declares.size()+"\n"); | |||
// // Sort the damn things | |||
// List sortedSetOfPointcuts = new ArrayList(); | |||
// for (int i = 0; i < pointcuts.length; i++) {sortedSetOfPointcuts.add(pointcuts[i]);} | |||
// Collections.sort(sortedSetOfPointcuts); | |||
int i=0; | |||
for (Iterator iter = declares.iterator(); iter.hasNext();) { | |||
Declare dec = (Declare) iter.next(); | |||
result.append("d"+i+") "+dec.toString()+"\n"); | |||
i++; | |||
} | |||
} | |||
TypeVariable[] tv = getTypeVariables(); | |||
if (tv!=null && tv.length>0) { | |||
result.append("The type variables: "+tv.length+"\n"); | |||
for (int i = 0; i < tv.length; i++) { | |||
result.append("tv"+i+") "+tv[i]+"\n"); | |||
} | |||
} | |||
Collection tmungers = getTypeMungers(); | |||
if (tmungers.size()>0) { | |||
List sorted = new ArrayList(); | |||
sorted.addAll(tmungers); | |||
Collections.sort(sorted,new Comparator() { | |||
public int compare(Object arg0, Object arg1) { | |||
return arg0.toString().compareTo(arg1.toString()); | |||
} | |||
}); | |||
result.append("The type mungers: "+tmungers.size()+"\n"); | |||
int i=0; | |||
for (Iterator iter = sorted.iterator(); iter.hasNext();) { | |||
ConcreteTypeMunger mun = (ConcreteTypeMunger) iter.next(); | |||
result.append("tm"+i+") "+mun.toString()+"\n"); | |||
i++; | |||
} | |||
} | |||
result.append("doesNotExposeShadowMungers?"+doesNotExposeShadowMungers()+"\n"); | |||
Collection pas = getPrivilegedAccesses(); | |||
if (pas!=null && pas.size()>0) { | |||
// List sorted = new ArrayList(); | |||
// sorted.addAll(tmungers); | |||
// Collections.sort(sorted,new Comparator() { | |||
// public int compare(Object arg0, Object arg1) { | |||
// return arg0.toString().compareTo(arg1.toString()); | |||
// } | |||
// }); | |||
result.append("The privileged accesses: "+pas.size()+"\n"); | |||
int i=0; | |||
for (Iterator iter = pas.iterator(); iter.hasNext();) { | |||
ResolvedMember mun = (ResolvedMember) iter.next(); | |||
result.append("tm"+i+") "+mun.toDebugString()+"\n"); | |||
i++; | |||
} | |||
} | |||
// public Collection getPrivilegedAccesses(); | |||
// public boolean hasAnnotation(UnresolvedType ofType); | |||
result.append("==="); | |||
return result.toString(); | |||
} | |||
public final String getSourcefilename() { | |||
return sourcefilename; |
@@ -72,8 +72,6 @@ public interface Member extends Comparable { | |||
*/ | |||
public String getParameterSignature(); | |||
public boolean isCompatibleWith(Member am); | |||
public int getModifiers(World world); | |||
public int getModifiers(); |
@@ -386,30 +386,9 @@ public class MemberImpl implements Member { | |||
return paramSignature; | |||
} | |||
/* (non-Javadoc) | |||
* @see org.aspectj.weaver.Member#isCompatibleWith(org.aspectj.weaver.Member) | |||
*/ | |||
public boolean isCompatibleWith(Member am) { | |||
if (kind != METHOD || am.getKind() != METHOD) return true; | |||
if (! name.equals(am.getName())) return true; | |||
if (! equalTypes(getParameterTypes(), am.getParameterTypes())) return true; | |||
return getReturnType().equals(am.getReturnType()); | |||
} | |||
private static boolean equalTypes(UnresolvedType[] a, UnresolvedType[] b) { | |||
int len = a.length; | |||
if (len != b.length) return false; | |||
for (int i = 0; i < len; i++) { | |||
if (!a[i].equals(b[i])) return false; | |||
} | |||
return true; | |||
} | |||
// OPTIMIZE see next line. Why the hell are they in here if we only know it once resolution has occurred... | |||
// ---- things we know only with resolution | |||
/* (non-Javadoc) | |||
* @see org.aspectj.weaver.Member#getModifiers(org.aspectj.weaver.World) | |||
*/ | |||
public int getModifiers(World world) { | |||
ResolvedMember resolved = resolve(world); | |||
if (resolved == null) { | |||
@@ -419,9 +398,6 @@ public class MemberImpl implements Member { | |||
return resolved.getModifiers(); | |||
} | |||
/* (non-Javadoc) | |||
* @see org.aspectj.weaver.Member#getExceptions(org.aspectj.weaver.World) | |||
*/ | |||
public UnresolvedType[] getExceptions(World world) { | |||
ResolvedMember resolved = resolve(world); | |||
if (resolved == null) { |
@@ -34,10 +34,10 @@ public interface ResolvedMember extends Member, AnnotatedElement, TypeVariableDe | |||
public ShadowMunger getAssociatedShadowMunger(); | |||
//OPTIMIZE have param annotation (and anno default value) related stuff here rather than above | |||
// ??? true or false? | |||
public boolean isAjSynthetic(); | |||
public boolean isCompatibleWith(Member am); | |||
public boolean hasAnnotations(); | |||
public boolean hasAnnotation(UnresolvedType ofType); |
@@ -1031,7 +1031,22 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno | |||
return buf.toString(); | |||
} | |||
public boolean isCompatibleWith(Member am) { | |||
if (kind != METHOD || am.getKind() != METHOD) return true; | |||
if (! name.equals(am.getName())) return true; | |||
if (! equalTypes(getParameterTypes(), am.getParameterTypes())) return true; | |||
return getReturnType().equals(am.getReturnType()); | |||
} | |||
private static boolean equalTypes(UnresolvedType[] a, UnresolvedType[] b) { | |||
int len = a.length; | |||
if (len != b.length) return false; | |||
for (int i = 0; i < len; i++) { | |||
if (!a[i].equals(b[i])) return false; | |||
} | |||
return true; | |||
} | |||
public TypeVariable getTypeVariableNamed(String name) { | |||
// Check locally... |
@@ -838,6 +838,7 @@ public abstract class World implements Dump.INode { | |||
return targetAspectjRuntimeLevel; | |||
} | |||
// OPTIMIZE are users falling foul of not supplying -1.5 and so targetting the old runtime? | |||
public boolean isTargettingAspectJRuntime12() { | |||
boolean b = false; // pr116679 | |||
if (!isInJava5Mode()) b=true; |
@@ -53,26 +53,24 @@ import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSigna | |||
public final class BcelMethod extends ResolvedMemberImpl { | |||
private Method method; | |||
// these fields are not set for many BcelMethods... | |||
private ShadowMunger associatedShadowMunger; | |||
private ResolvedPointcutDefinition preResolvedPointcut; // used when ajc has pre-resolved the pointcut of some @Advice | |||
private AjAttribute.EffectiveSignatureAttribute effectiveSignature; | |||
// private ResolvedType[] annotationTypes = null; | |||
private AjAttribute.MethodDeclarationLineNumberAttribute declarationLineNumber; | |||
private AnnotationX[] annotations = null; | |||
private AnnotationX[][] parameterAnnotations = null; | |||
private AjAttribute.EffectiveSignatureAttribute effectiveSignature; | |||
private AjAttribute.MethodDeclarationLineNumberAttribute declarationLineNumber; | |||
private BcelObjectType bcelObjectType; | |||
private boolean parameterNamesInitialized = false; | |||
private int bitflags; | |||
private static final int KNOW_IF_SYNTHETIC = 0x0001; | |||
private static final int PARAMETER_NAMES_INITIALIZED = 0x0002; | |||
private static final int CAN_BE_PARAMETERIZED = 0x0004; | |||
private static final int UNPACKED_GENERIC_SIGNATURE = 0x0008; | |||
private static final int KNOW_IF_SYNTHETIC = 0x0001; // used | |||
private static final int PARAMETER_NAMES_INITIALIZED = 0x0002; // used | |||
private static final int CAN_BE_PARAMETERIZED = 0x0004; // used | |||
private static final int UNPACKED_GENERIC_SIGNATURE = 0x0008; // used | |||
private static final int HAS_EFFECTIVE_SIGNATURE = 0x0010; | |||
private static final int HAS_PRERESOLVED_POINTCUT = 0x0020; | |||
private static final int IS_AJ_SYNTHETIC = 0x0040; | |||
@@ -80,14 +78,12 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
private static final int IS_SYNTHETIC_INVERSE = 0x7f7f; // all bits but IS_SYNTHETIC (and topmost bit) | |||
private static final int HAS_ASSOCIATED_SHADOWMUNGER = 0x0100; | |||
private static final int HAS_GENERIC_RETPARAM_TYPES = 0x0200; | |||
private static final int HAS_ANNOTATIONS = 0x0400; | |||
private static final int HAVE_DETERMINED_ANNOTATIONS = 0x0800; | |||
private static final int HAS_ANNOTATIONS = 0x0400; // used | |||
private static final int HAVE_DETERMINED_ANNOTATIONS = 0x0800; // used | |||
private static final int HAS_MD_LINE_NUMBER_ATTRIBUTE= 0x1000; | |||
private boolean canBeParameterized = false; | |||
// genericized version of return and parameter types | |||
private boolean unpackedGenericSignature = false; | |||
private UnresolvedType genericReturnType = null; | |||
private UnresolvedType[] genericParameterTypes = null; | |||
@@ -132,8 +128,8 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
} | |||
public void determineParameterNames() { | |||
if (parameterNamesInitialized) return; | |||
parameterNamesInitialized=true; | |||
if ((bitflags&PARAMETER_NAMES_INITIALIZED)!=0) { return; } | |||
bitflags|=PARAMETER_NAMES_INITIALIZED; | |||
LocalVariableTable varTable = method.getLocalVariableTable(); | |||
int len = getArity(); | |||
if (varTable == null) { | |||
@@ -431,7 +427,7 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
*/ | |||
public boolean canBeParameterized() { | |||
unpackGenericSignature(); | |||
return canBeParameterized; | |||
return (bitflags & CAN_BE_PARAMETERIZED)!=0; | |||
} | |||
@@ -452,8 +448,8 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
public Method getMethod() { return method; } | |||
private void unpackGenericSignature() { | |||
if (unpackedGenericSignature) return; | |||
unpackedGenericSignature = true; | |||
if ((bitflags&UNPACKED_GENERIC_SIGNATURE)!=0) { return; } | |||
bitflags|=UNPACKED_GENERIC_SIGNATURE; | |||
if (!bcelObjectType.getWorld().isInJava5Mode()) { | |||
this.genericReturnType = getReturnType(); | |||
this.genericParameterTypes = getParameterTypes(); | |||
@@ -464,7 +460,7 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
Signature.MethodTypeSignature mSig = new GenericSignatureParser().parseAsMethodSignature(gSig);//method.getGenericSignature()); | |||
if (mSig.formalTypeParameters.length > 0) { | |||
// generic method declaration | |||
canBeParameterized = true; | |||
bitflags|=CAN_BE_PARAMETERIZED; | |||
} | |||
typeVariables = new TypeVariable[mSig.formalTypeParameters.length]; | |||
@@ -517,7 +513,7 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
+ e.getMessage()); | |||
} | |||
if (paramTypeSigs[i] instanceof TypeVariableSignature) { | |||
canBeParameterized = true; | |||
bitflags|=CAN_BE_PARAMETERIZED; | |||
} | |||
} | |||
} else { | |||
@@ -549,10 +545,8 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
private void workOutIfSynthetic() { | |||
if ((bitflags&KNOW_IF_SYNTHETIC)!=0) return; | |||
bitflags|=KNOW_IF_SYNTHETIC; | |||
// knowIfSynthetic=true; | |||
JavaClass jc = bcelObjectType.getJavaClass(); | |||
bitflags&=IS_SYNTHETIC_INVERSE; // unset the bit | |||
// isSynthetic=false; | |||
if (jc==null) return; // what the hell has gone wrong? | |||
if (jc.getMajor()<49/*Java5*/) { | |||
// synthetic is an attribute | |||
@@ -561,7 +555,6 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
for (int i = 0; i < synthetics.length; i++) { | |||
if (synthetics[i].equals("Synthetic")) { | |||
bitflags|=IS_SYNTHETIC; | |||
// isSynthetic=true; | |||
break;} | |||
} | |||
} | |||
@@ -570,7 +563,6 @@ public final class BcelMethod extends ResolvedMemberImpl { | |||
if ((modifiers&4096)!=0) { | |||
bitflags|=IS_SYNTHETIC; | |||
} | |||
// isSynthetic = (modifiers&4096)!=0; | |||
} | |||
} | |||
@@ -24,6 +24,189 @@ import org.aspectj.weaver.patterns.SimpleScope; | |||
public class TestUtils { | |||
private static final String[] ZERO_STRINGS = new String[0]; | |||
// For stringifying a delegate - extracted from AbstractReferenceTypeDelegate, not fixed up | |||
// /** | |||
// * Create the string representation for a delegate, allowing us to | |||
// * more easily compare delegate implementations. | |||
// */ | |||
// public String stringifyDelegate() { | |||
// | |||
// StringBuffer result = new StringBuffer(); | |||
// result.append("=== Delegate for "+getResolvedTypeX().getName()+"\n"); | |||
// | |||
// result.append("isAspect?"+isAspect()+"\n"); | |||
// result.append("isAnnotationStyleAspect?"+isAnnotationStyleAspect()+"\n"); | |||
// result.append("isInterface?"+isInterface()+"\n"); | |||
// result.append("isEnum?"+isEnum()+"\n"); | |||
// result.append("isClass?"+isClass()+"\n"); | |||
// result.append("-\n"); | |||
// result.append("isAnnotation?"+isAnnotation()+"\n"); | |||
// result.append("retentionPolicy="+getRetentionPolicy()+"\n"); | |||
// result.append("canAnnotationTargetType?"+canAnnotationTargetType()+"\n"); | |||
// AnnotationTargetKind[] kinds = getAnnotationTargetKinds(); | |||
// if (kinds!=null && kinds.length>0) { | |||
// result.append("annotationTargetKinds:["); | |||
// for (int i = 0; i < kinds.length; i++) { | |||
// AnnotationTargetKind kind = kinds[i]; | |||
// result.append(kind); | |||
// if ((i+1)<kinds.length) result.append(" "); | |||
// } | |||
// result.append("]\n"); | |||
// } | |||
// result.append("isAnnotationWithRuntimeRetention?"+isAnnotationWithRuntimeRetention()+"\n"); | |||
// result.append("-\n"); | |||
// | |||
// result.append("isAnonymous?"+isAnonymous()+"\n"); | |||
// result.append("isNested?"+isNested()+"\n"); | |||
// result.append("-\n"); | |||
// | |||
// result.append("isGeneric?"+isGeneric()+"\n"); | |||
// result.append("declaredGenericSignature="+getDeclaredGenericSignature()+"\n"); | |||
// result.append("-\n"); | |||
// | |||
// AnnotationX[] axs = getAnnotations(); | |||
// if (axs!=null && axs.length>0) { | |||
// result.append("getAnnotations() returns: "+axs.length+" annotations\n"); | |||
// for (int i = 0; i < axs.length; i++) { | |||
// AnnotationX annotationX = axs[i]; | |||
// result.append(" #"+i+") "+annotationX+"\n"); | |||
// } | |||
// } else { | |||
// result.append("getAnnotations() returns nothing\n"); | |||
// } | |||
// ResolvedType[] axtypes = getAnnotationTypes(); | |||
// if (axtypes!=null && axtypes.length>0) { | |||
// result.append("getAnnotationTypes() returns: "+axtypes.length+" annotations\n"); | |||
// for (int i = 0; i < axtypes.length; i++) { | |||
// ResolvedType annotation = axtypes[i]; | |||
// result.append(" #"+i+") "+annotation+":"+annotation.getClass()+"\n"); | |||
// } | |||
// } else { | |||
// result.append("getAnnotationTypes() returns nothing\n"); | |||
// } | |||
// | |||
// result.append("isExposedToWeaver?"+isExposedToWeaver()+"\n"); | |||
// result.append("getSuperclass?"+getSuperclass()+"\n"); | |||
// result.append("getResolvedTypeX?"+getResolvedTypeX()+"\n"); | |||
// result.append("--\n"); | |||
// | |||
// ResolvedMember[] fields = getDeclaredFields(); | |||
// if (fields!=null && fields.length>0) { | |||
// result.append("The fields: "+fields.length+"\n"); | |||
// for (int i = 0; i < fields.length; i++) { | |||
// ResolvedMember member = fields[i]; | |||
// result.append("f"+i+") "+member.toDebugString()+"\n"); | |||
// } | |||
// } | |||
// ResolvedMember[] methods = getDeclaredMethods(); | |||
// if (methods!=null && methods.length>0) { | |||
// result.append("The methods: "+methods.length+"\n"); | |||
// for (int i = 0; i < methods.length; i++) { | |||
// ResolvedMember member = methods[i]; | |||
// result.append("m"+i+") "+member.toDebugString()+"\n"); | |||
// } | |||
// } | |||
// ResolvedType[] interfaces = getDeclaredInterfaces(); | |||
// if (interfaces!=null && interfaces.length>0) { | |||
// result.append("The interfaces: "+interfaces.length+"\n"); | |||
// for (int i = 0; i < interfaces.length; i++) { | |||
// ResolvedType member = interfaces[i]; | |||
// result.append("i"+i+") "+member+"\n"); | |||
// } | |||
// } | |||
// | |||
// result.append("getModifiers?"+getModifiers()+"\n"); | |||
// | |||
// result.append("perclause="+getPerClause()+"\n"); | |||
// | |||
// result.append("aj:weaverstate="+getWeaverState()+"\n"); | |||
// | |||
// ResolvedMember[] pointcuts = getDeclaredPointcuts(); | |||
// if (pointcuts!=null && pointcuts.length>0) { | |||
// result.append("The pointcuts: "+pointcuts.length+"\n"); | |||
// | |||
// // Sort the damn things | |||
// List sortedSetOfPointcuts = new ArrayList(); | |||
// for (int i = 0; i < pointcuts.length; i++) {sortedSetOfPointcuts.add(pointcuts[i]);} | |||
// Collections.sort(sortedSetOfPointcuts); | |||
// | |||
// int i =0; | |||
// for (Iterator iter = sortedSetOfPointcuts.iterator(); iter.hasNext();) { | |||
// ResolvedMember member = (ResolvedMember) iter.next(); | |||
// result.append("p"+i+") "+member.toDebugString()+"\n"); | |||
// i++; | |||
// } | |||
// } | |||
// | |||
// Collection declares = getDeclares(); | |||
// if (declares.size()>0) { | |||
// result.append("The declares: "+declares.size()+"\n"); | |||
// | |||
//// // Sort the damn things | |||
//// List sortedSetOfPointcuts = new ArrayList(); | |||
//// for (int i = 0; i < pointcuts.length; i++) {sortedSetOfPointcuts.add(pointcuts[i]);} | |||
//// Collections.sort(sortedSetOfPointcuts); | |||
// | |||
// int i=0; | |||
// for (Iterator iter = declares.iterator(); iter.hasNext();) { | |||
// Declare dec = (Declare) iter.next(); | |||
// result.append("d"+i+") "+dec.toString()+"\n"); | |||
// i++; | |||
// } | |||
// } | |||
// | |||
// TypeVariable[] tv = getTypeVariables(); | |||
// if (tv!=null && tv.length>0) { | |||
// result.append("The type variables: "+tv.length+"\n"); | |||
// for (int i = 0; i < tv.length; i++) { | |||
// result.append("tv"+i+") "+tv[i]+"\n"); | |||
// } | |||
// } | |||
// | |||
// Collection tmungers = getTypeMungers(); | |||
// if (tmungers.size()>0) { | |||
// List sorted = new ArrayList(); | |||
// sorted.addAll(tmungers); | |||
// Collections.sort(sorted,new Comparator() { | |||
// public int compare(Object arg0, Object arg1) { | |||
// return arg0.toString().compareTo(arg1.toString()); | |||
// } | |||
// }); | |||
// result.append("The type mungers: "+tmungers.size()+"\n"); | |||
// int i=0; | |||
// for (Iterator iter = sorted.iterator(); iter.hasNext();) { | |||
// ConcreteTypeMunger mun = (ConcreteTypeMunger) iter.next(); | |||
// result.append("tm"+i+") "+mun.toString()+"\n"); | |||
// i++; | |||
// } | |||
// } | |||
// | |||
// result.append("doesNotExposeShadowMungers?"+doesNotExposeShadowMungers()+"\n"); | |||
// | |||
// Collection pas = getPrivilegedAccesses(); | |||
// if (pas!=null && pas.size()>0) { | |||
//// List sorted = new ArrayList(); | |||
//// sorted.addAll(tmungers); | |||
//// Collections.sort(sorted,new Comparator() { | |||
//// public int compare(Object arg0, Object arg1) { | |||
//// return arg0.toString().compareTo(arg1.toString()); | |||
//// } | |||
//// }); | |||
// result.append("The privileged accesses: "+pas.size()+"\n"); | |||
// int i=0; | |||
// for (Iterator iter = pas.iterator(); iter.hasNext();) { | |||
// ResolvedMember mun = (ResolvedMember) iter.next(); | |||
// result.append("tm"+i+") "+mun.toDebugString()+"\n"); | |||
// i++; | |||
// } | |||
// } | |||
// | |||
//// public Collection getPrivilegedAccesses(); | |||
//// public boolean hasAnnotation(UnresolvedType ofType); | |||
// result.append("==="); | |||
// return result.toString(); | |||
// } | |||
/** | |||
* Build a member from a string representation: | |||
* <blockquote><pre> |