summaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
authormwebster <mwebster>2006-08-16 14:54:03 +0000
committermwebster <mwebster>2006-08-16 14:54:03 +0000
commit4ce6cb8b0cd79d8ba746473af86a76774755b6b8 (patch)
tree417784193fe8c858af3a8059449da13f66f3de27 /loadtime
parentc1c9215efa1c1e332859dd50c103e2a0021e15fe (diff)
downloadaspectj-4ce6cb8b0cd79d8ba746473af86a76774755b6b8.tar.gz
aspectj-4ce6cb8b0cd79d8ba746473af86a76774755b6b8.zip
Bug 150487 "Tracing and Logging Framework" (new/fixed trace points)
Diffstat (limited to 'loadtime')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Aj.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
index 97dbd4d82..f7afb1c6f 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
@@ -36,7 +36,7 @@ public class Aj implements ClassPreProcessor {
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>");
}
@@ -57,15 +57,15 @@ public class Aj implements ClassPreProcessor {
* @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);
@@ -73,15 +73,16 @@ public class Aj implements ClassPreProcessor {
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;
}
}