summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-23 09:01:53 +0000
committeraclement <aclement>2005-11-23 09:01:53 +0000
commita5ac5af396426f2049abe52036748bd344a7d1fe (patch)
tree187fe4977508a40ae1ee56ea7e160b43c96435eb /weaver
parenta1e4d4694a330ee0f9d1700d1b38c606c2c19d44 (diff)
downloadaspectj-a5ac5af396426f2049abe52036748bd344a7d1fe.tar.gz
aspectj-a5ac5af396426f2049abe52036748bd344a7d1fe.zip
117189: patch from Ron, tidied up by Matthew: reduce overhead when no aspects defined
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
index 6d11ff307..f70215328 100644
--- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
+++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
@@ -186,15 +186,16 @@ public class WeavingAdaptor {
* @exception IOException weave failed
*/
public byte[] weaveClass (String name, byte[] bytes) throws IOException {
- if (shouldWeave(name, bytes)) {
- //System.out.println("WeavingAdaptor.weaveClass " + name);
- info("weaving '" + name + "'");
- bytes = getWovenBytes(name, bytes);
- } else if (shouldWeaveAnnotationStyleAspect(name, bytes)) {
- // an @AspectJ aspect needs to be at least munged by the aspectOf munger
- info("weaving '" + name + "'");
- bytes = getAtAspectJAspectBytes(name, bytes);
- }
+ if (enabled) {
+ if (shouldWeave(name, bytes)) {
+ info("weaving '" + name + "'");
+ bytes = getWovenBytes(name, bytes);
+ } else if (shouldWeaveAnnotationStyleAspect(name, bytes)) {
+ // an @AspectJ aspect needs to be at least munged by the aspectOf munger
+ info("weaving '" + name + "'");
+ bytes = getAtAspectJAspectBytes(name, bytes);
+ }
+ }
return bytes;
}
@@ -205,7 +206,7 @@ public class WeavingAdaptor {
*/
private boolean shouldWeave (String name, byte[] bytes) {
name = name.replace('/','.');
- boolean b = enabled && !generatedClasses.containsKey(name) && shouldWeaveName(name);
+ boolean b = !generatedClasses.containsKey(name) && shouldWeaveName(name);
return b && accept(name, bytes);
// && shouldWeaveAnnotationStyleAspect(name);
// // we recall shouldWeaveAnnotationStyleAspect as we need to add aspectOf methods for @Aspect anyway