summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-04-04 08:10:19 +0000
committeraclement <aclement>2006-04-04 08:10:19 +0000
commit680e72392c69c9d37db19ffeceaa61e89acf550f (patch)
tree80ba9b3713a10acf94ba4f61b51366e3ec9b8923
parent24d3c4539ea77e5eeebe8baf9dcb6cb373cdcb11 (diff)
downloadaspectj-680e72392c69c9d37db19ffeceaa61e89acf550f.tar.gz
aspectj-680e72392c69c9d37db19ffeceaa61e89acf550f.zip
future work (see 133532)
-rw-r--r--weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java8
-rw-r--r--weaver/src/org/aspectj/weaver/CrosscuttingMembers.java32
2 files changed, 40 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java b/weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java
index 24ce48348..ef9a88029 100644
--- a/weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java
@@ -25,6 +25,14 @@ public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparab
this.aspectType = aspectType;
}
+ // An EclipseTypeMunger and a BcelTypeMunger may say TRUE for equivalentTo()...
+ public boolean equivalentTo(Object other) {
+ if (! (other instanceof ConcreteTypeMunger)) return false;
+ ConcreteTypeMunger o = (ConcreteTypeMunger) other;
+ return ((o.getMunger() == null) ? (getMunger() == null) : o.getMunger().equals(getMunger()))
+ && ((o.getAspectType() == null) ? (getAspectType() == null) : o.getAspectType().equals(getAspectType()));
+ }
+
//public abstract boolean munge(LazyClassGen gen);
diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
index 78fc05868..fcbd967cf 100644
--- a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
+++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
@@ -277,6 +277,38 @@ public class CrosscuttingMembers {
otherTypeMungers.addAll(other.typeMungers);
}
+ // initial go at equivalence logic rather than set compare (see pr133532)
+// if (theseTypeMungers.size()!=otherTypeMungers.size()) {
+// changed = true;
+// typeMungers = other.typeMungers;
+// } else {
+// boolean foundInequality=false;
+// for (Iterator iter = theseTypeMungers.iterator(); iter.hasNext() && !foundInequality;) {
+// Object thisOne = (Object) iter.next();
+// boolean foundInOtherSet = false;
+// for (Iterator iterator = otherTypeMungers.iterator(); iterator.hasNext();) {
+// Object otherOne = (Object) iterator.next();
+// if (thisOne instanceof ConcreteTypeMunger && otherOne instanceof ConcreteTypeMunger) {
+// if (((ConcreteTypeMunger)thisOne).equivalentTo(otherOne)) {
+// foundInOtherSet=true;
+// } else if (thisOne.equals(otherOne)) {
+// foundInOtherSet=true;
+// }
+// } else {
+// if (thisOne.equals(otherOne)) {
+// foundInOtherSet=true;
+// }
+// }
+// }
+// if (!foundInOtherSet) foundInequality=true;
+// }
+// if (foundInequality) {
+// changed = true;
+// typeMungers = other.typeMungers;
+//// } else {
+//// typeMungers = other.typeMungers;
+// }
+// }
if (!theseTypeMungers.equals(otherTypeMungers)) {
changed = true;
typeMungers = other.typeMungers;