aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2009-02-06 00:15:57 +0000
committeraclement <aclement>2009-02-06 00:15:57 +0000
commit1b54b4b7555176c8548dbbffded063191ad0b46a (patch)
tree01a7144108150aafb505e219d1a093101cc4fc3c /weaver
parent1ddce9bd6611ca86047af27ba04ce0e6849ede2c (diff)
downloadaspectj-1b54b4b7555176c8548dbbffded063191ad0b46a.tar.gz
aspectj-1b54b4b7555176c8548dbbffded063191ad0b46a.zip
263837: make reweavable field in BcelClassWeaver non-static
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java17
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java2
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java8
3 files changed, 12 insertions, 15 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
index 940cef5e2..8d1ad6f8a 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
@@ -94,9 +94,13 @@ class BcelClassWeaver implements IClassWeaver {
/**
* This is called from {@link BcelWeaver} to perform the per-class weaving process.
+ *
*/
- public static boolean weave(BcelWorld world, LazyClassGen clazz, List shadowMungers, List typeMungers, List lateTypeMungers) {
- boolean b = new BcelClassWeaver(world, clazz, shadowMungers, typeMungers, lateTypeMungers).weave();
+ public static boolean weave(BcelWorld world, LazyClassGen clazz, List shadowMungers, List typeMungers, List lateTypeMungers,
+ boolean inReweavableMode) {
+ BcelClassWeaver classWeaver = new BcelClassWeaver(world, clazz, shadowMungers, typeMungers, lateTypeMungers);
+ classWeaver.setReweavableMode(inReweavableMode);
+ boolean b = classWeaver.weave();
// System.out.println(clazz.getClassName() + ", " +
// clazz.getType().getWeaverState());
// clazz.print();
@@ -118,8 +122,7 @@ class BcelClassWeaver implements IClassWeaver {
private final List addedLazyMethodGens = new ArrayList();
private final Set addedDispatchTargets = new HashSet();
- // Static setting across BcelClassWeavers
- private static boolean inReweavableMode = false;
+ private boolean inReweavableMode = false;
private List addedSuperInitializersAsList = null; // List<IfaceInitList>
private final Map addedSuperInitializers = new HashMap(); // Interface ->
@@ -3070,13 +3073,11 @@ class BcelClassWeaver implements IClassWeaver {
return world;
}
- // Called by the BcelWeaver to let us know all BcelClassWeavers need to
- // collect reweavable info
- public static void setReweavableMode(boolean mode) {
+ public void setReweavableMode(boolean mode) {
inReweavableMode = mode;
}
- public static boolean getReweavableMode() {
+ public boolean getReweavableMode() {
return inReweavableMode;
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index 3a50e7c76..97d462b12 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -116,7 +116,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
}
if (changed && munger.changesPublicSignature()) {
- WeaverStateInfo info = weaver.getLazyClassGen().getOrCreateWeaverStateInfo(BcelClassWeaver.getReweavableMode());
+ WeaverStateInfo info = weaver.getLazyClassGen().getOrCreateWeaverStateInfo(weaver.getReweavableMode());
info.addConcreteMunger(this);
}
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index 7ba56af66..f5298dd11 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -1729,7 +1729,8 @@ public class BcelWeaver {
boolean isChanged = false;
if (mightNeedToWeave)
- isChanged = BcelClassWeaver.weave(world, clazz, shadowMungers, typeMungers, lateTypeMungerList);
+ isChanged = BcelClassWeaver.weave(world, clazz, shadowMungers, typeMungers, lateTypeMungerList,
+ inReweavableMode);
if (mightNeedBridgeMethods)
isChanged = BcelClassWeaver.calculateAnyRequiredBridgeMethods(world, clazz) || isChanged;
@@ -1841,13 +1842,8 @@ public class BcelWeaver {
}
public void setReweavableMode(boolean xNotReweavable) {
- if (trace.isTraceEnabled())
- trace.enter("setReweavableMode", this, xNotReweavable);
inReweavableMode = !xNotReweavable;
WeaverStateInfo.setReweavableModeDefaults(!xNotReweavable, false, true);
- BcelClassWeaver.setReweavableMode(!xNotReweavable);
- if (trace.isTraceEnabled())
- trace.exit("setReweavableMode");
}
public boolean isReweavable() {