]> source.dussan.org Git - aspectj.git/commitdiff
134471 - incremental structure model repair code overhaul - so we don't unnecessarily...
authoraclement <aclement>
Thu, 11 May 2006 07:27:45 +0000 (07:27 +0000)
committeraclement <aclement>
Thu, 11 May 2006 07:27:45 +0000 (07:27 +0000)
weaver/src/org/aspectj/weaver/Checker.java

index f123ad36d96ab467ad6cc6689d35dd904b8749e6..a3e2dac1b3ad690e671b16ad4d9399d9bf317b0a 100644 (file)
@@ -101,6 +101,28 @@ public class Checker extends ShadowMunger {
     public boolean mustCheckExceptions() { return true; }
 
 
+       // XXX this perhaps ought to take account of the other fields in advice ...
+    public boolean equals(Object other) {
+        if (! (other instanceof Checker)) return false;
+        Checker o = (Checker) other;
+        return  
+          o.isError == isError &&
+                ((o.pointcut == null) ? (pointcut == null) : o.pointcut.equals(pointcut)) &&
+          (World.compareLocations?((o.getSourceLocation()==null) ? (getSourceLocation()==null): o.getSourceLocation().equals(getSourceLocation())):true) // pr134471 - remove when handles are improved to be independent of location
+               ;
+    }
+
+       private volatile int hashCode = -1;
+    public int hashCode() {
+       if (hashCode == -1) {
+            int result = 17;
+            result = 37*result + (isError?1:0);
+            result = 37*result + ((pointcut == null) ? 0 : pointcut.hashCode());
+            hashCode = result;                 
+               }
+        return hashCode;
+    }
+
        public boolean isError() {
                return isError;
        }