summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2005-07-26 14:15:32 +0000
committeraclement <aclement>2005-07-26 14:15:32 +0000
commita3dd516b80debb7dfd0c45fa2b0e8ad7959b4b91 (patch)
treec190ee75eb281833b9ccaf889eae96eacb08a74e /weaver
parent8db7e37a1b2a2c81f977157a9c8e9470a3ff72e6 (diff)
downloadaspectj-a3dd516b80debb7dfd0c45fa2b0e8ad7959b4b91.tar.gz
aspectj-a3dd516b80debb7dfd0c45fa2b0e8ad7959b4b91.zip
minor versioning improvement. dont add the version attribute if someone else already has.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
index 81490d5eb..2bf207c97 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -422,8 +422,15 @@ public final class LazyClassGen {
// }
}
- // Add a weaver version attribute to the file being produced
- myGen.addAttribute(BcelAttributes.bcelAttribute(new AjAttribute.WeaverVersionInfo(),getConstantPoolGen()));
+ // Add a weaver version attribute to the file being produced (if necessary...)
+ boolean hasVersionAttribute = false;
+ Attribute[] attrs = myGen.getAttributes();
+ for (int i = 0; i < attrs.length && !hasVersionAttribute; i++) {
+ Attribute attribute = attrs[i];
+ if (attribute.getName().equals("org.aspectj.weaver.WeaverVersion")) hasVersionAttribute=true;
+ }
+ if (!hasVersionAttribute)
+ myGen.addAttribute(BcelAttributes.bcelAttribute(new AjAttribute.WeaverVersionInfo(),getConstantPoolGen()));
if (myType != null && myType.getWeaverState() != null) {
myGen.addAttribute(BcelAttributes.bcelAttribute(