Project: AspectJ
Bug 113511 LTW enhancements
Reported: 2005-10-24 05:39:33 | Status: resolved fixed

Alex, here is the basic patch that is working well before you leave for the weekend ;-) I'll let Matthew post it officially to bugzilla since it was his idea. The earlier return from !enabled is a small addition I made that seems to help further. It would be great to have this in HEAD so I can report performance numbers based on it in part 2 of my article on developerworks ;-) Hope you are enjoying your new addition! Thanks! Index: ClassLoaderWeavingAdaptor.java =================================================================== RCS file: /home/technology/org.aspectj/modules/loadtime/src/org/aspectj/weaver/loadtim e/ClassLoaderWeavingAdaptor.java,v retrieving revision 1.18 diff -u -r1.18 ClassLoaderWeavingAdaptor.java --- ClassLoaderWeavingAdaptor.java 19 Oct 2005 13:11:36 -0000 1.18 +++ ClassLoaderWeavingAdaptor.java 21 Oct 2005 16:04:41 -0000 @@ -107,8 +107,13 @@ // register the definitions registerDefinitions(weaver, loader); + if (!enabled) { + return; + } messageHandler = bcelWorld.getMessageHandler(); + bcelWorld.setResolutionLoader((ClassLoader)null);//loader.getParent()); + // after adding aspects weaver.prepareForWeave(); } @@ -148,7 +153,11 @@ definitions.add(DocumentParser.parse(xml)); } } - + if (definitions.isEmpty()) { + enabled = false; + return; + } + // still go thru if definitions is empty since we will configure // the default message handler in there registerOptions(weaver, loader, definitions);

Files changed in fix:
loadtime/src/org/aspectj/weaver/loadtime/Aj.java loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java