public Aj(IWeavingContext context){
- if (trace.isTraceEnabled()) trace.enter("<init>",this,new Object[] {context});
+ if (trace.isTraceEnabled()) trace.enter("<init>",this,new Object[] {context, getClass().getClassLoader()});
this.weavingContext = context;
if (trace.isTraceEnabled()) trace.exit("<init>");
}
* @return weaved bytes
*/
public byte[] preProcess(String className, byte[] bytes, ClassLoader loader) {
- if (trace.isTraceEnabled()) trace.enter("preProcess",this,new Object[] {className,bytes,loader});
//TODO AV needs to doc that
if (loader == null || className == null) {
// skip boot loader or null classes (hibernate)
- if (trace.isTraceEnabled()) trace.exit("preProcess",bytes);
return bytes;
}
+ if (trace.isTraceEnabled()) trace.enter("preProcess",this,new Object[] {className, bytes, loader, Thread.currentThread().getContextClassLoader()});
+
try {
synchronized (loader) {
WeavingAdaptor weavingAdaptor = WeaverContainer.getWeaver(loader, weavingContext);
if (trace.isTraceEnabled()) trace.exit("preProcess");
return bytes;
}
- if (trace.isTraceEnabled()) trace.exit("preProcess",bytes);
- return weavingAdaptor.weaveClass(className, bytes);
+ byte[] newBytes = weavingAdaptor.weaveClass(className, bytes);
+ if (trace.isTraceEnabled()) trace.exit("preProcess",newBytes);
+ return newBytes;
}
- } catch (Exception t) {
- trace.error("preProcess",t);
+ } catch (Exception ex) {
+ trace.error("preProcess",ex);
//FIXME AV wondering if we should have the option to fail (throw runtime exception) here
// would make sense at least in test f.e. see TestHelper.handleMessage()
- t.printStackTrace();
- if (trace.isTraceEnabled()) trace.exit("preProcess",bytes);
+ ex.printStackTrace();
+ if (trace.isTraceEnabled()) trace.exit("preProcess",ex);
return bytes;
}
}
import org.aspectj.weaver.patterns.CflowPointcut;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.IVerificationRequired;
+import org.aspectj.weaver.tools.Trace;
+import org.aspectj.weaver.tools.TraceFactory;
/**
* This holds on to all CrosscuttingMembers for a world. It handles
private List /*IVerificationRequired*/ verificationList = null; // List of things to be verified once the type system is 'complete'
+ private static Trace trace = TraceFactory.getTraceFactory().getTrace(CrosscuttingMembersSet.class);
+
public CrosscuttingMembersSet(World world) {
+ trace.enter("<init>",this,world);
+
this.world = world;
+
+ trace.exit("<init>");
}
public boolean addOrReplaceAspect(ResolvedType aspectType) {
* XXX for efficiency we will need a richer representation than this
*/
public boolean addOrReplaceAspect(ResolvedType aspectType, boolean inWeavingPhase) {
+ trace.enter("addOrReplaceAspect",this,new Object[] {aspectType,new Boolean(inWeavingPhase)});
+
boolean change = false;
CrosscuttingMembers xcut = (CrosscuttingMembers)members.get(aspectType);
if (xcut == null) {
change = change || ancestorChange;
}
changedSinceLastReset = changedSinceLastReset || change;
+
+ trace.exit("addOrReplaceAspect",change);
return change;
}
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.weaver.tools.Traceable;
/**
* A UnresolvedType represents a type to the weaver. It has a basic signature that knows
* The wildcard ? extends Foo has signature +LFoo;
* The wildcard ? super Foo has signature -LFoo;
*/
-public class UnresolvedType implements TypeVariableDeclaringElement {
+public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
// common types referred to by the weaver
public static final UnresolvedType[] NONE = new UnresolvedType[0];
}
return null;
}
+
+ public String toTraceString() {
+ return getClass().getName() + "[" + getName() + "]";
+ }
}
private void weaveAndNotify(UnwovenClassFile classFile, BcelObjectType classType,
IWeaveRequestor requestor) throws IOException {
+ trace.enter("weaveAndNotify",this,new Object[] {classFile,classType,requestor});
+
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_TYPE, classType.getResolvedTypeX().getName());
LazyClassGen clazz = weaveWithoutDump(classFile,classType);
classType.finishedWith();
}
classType.weavingCompleted();
CompilationAndWeavingContext.leavingPhase(tok);
+
+ trace.exit("weaveAndNotify");
}
/** helper method - will return NULL if the underlying delegate is an EclipseSourceType and not a BcelObjectType */