]> source.dussan.org Git - aspectj.git/commitdiff
future work (see 133532)
authoraclement <aclement>
Tue, 4 Apr 2006 08:10:19 +0000 (08:10 +0000)
committeraclement <aclement>
Tue, 4 Apr 2006 08:10:19 +0000 (08:10 +0000)
weaver/src/org/aspectj/weaver/ConcreteTypeMunger.java
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java

index 24ce48348a0e6cd8199098d15e49b735944134d7..ef9a88029da90f1de653696266f47db6ca0972ea 100644 (file)
@@ -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);
 
 
index 78fc058684424d1a7cb96069f86550bb04e54308..fcbd967cf1dff815520220c9b535856d3b12d90f 100644 (file)
@@ -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;