summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;