aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
diff options
context:
space:
mode:
authoraclement <aclement>2009-01-05 22:02:29 +0000
committeraclement <aclement>2009-01-05 22:02:29 +0000
commit4316c4456bee9357df9845153d8a5c34e57520b2 (patch)
tree6f5782be1c2e4f470aef47b9d872f64a2f9d8af7 /org.aspectj.matcher
parentd8011d6238c919468419918a902ceb33b8f7cb95 (diff)
downloadaspectj-4316c4456bee9357df9845153d8a5c34e57520b2.tar.gz
aspectj-4316c4456bee9357df9845153d8a5c34e57520b2.zip
259649: equivalentTo() added
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r--org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java b/org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java
index 524d091be..7e25ce8c1 100644
--- a/org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java
+++ b/org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java
@@ -26,13 +26,18 @@ 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()));
- // }
+ /**
+ * Equivalence can be true for an EclipseTypeMunger and a BcelTypeMunger that represent the
+ * same transformation (just at different points in the pipeline).
+ */
+ 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);
@@ -141,4 +146,8 @@ public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparab
}
return false;
}
+
+ public boolean shouldOverwrite() {
+ return true;
+ }
}