Added fields to ReferenceEdgeProperties and combed over all classes that need proper...
[IRC.git] / Robust / src / Analysis / OwnershipAnalysis / HeapRegionNode.java
index 6650e669c343b4c0a0c2206dedc10d45484008a3..4b6464d29191eac78588d5be95d4405d5c040544 100644 (file)
@@ -37,9 +37,11 @@ public class HeapRegionNode extends OwnershipNode {
        this.isNewSummary   = isNewSummary;
        this.allocSite      = allocSite;
        this.alpha          = alpha;
-       this.alphaNew       = null;
        this.description    = description;
 
+       alphaNew = new ReachabilitySet();
+       alphaNew = alphaNew.makeCanonical();
+
        referencers  = new HashSet<OwnershipNode>();
        memberFields = new HashSet<TempDescriptor>();
     }
@@ -60,8 +62,16 @@ public class HeapRegionNode extends OwnershipNode {
     }
 
 
-    public boolean equals( HeapRegionNode hrn ) {
-       assert hrn != null;
+    public boolean equals( Object o ) {
+       if( o == null ) {
+           return false;
+       }
+
+       if( !( o instanceof HeapRegionNode) ) {
+           return false;
+       }
+
+       HeapRegionNode hrn = (HeapRegionNode) o;
 
        return id.equals( hrn.getID() )            &&
            isSingleObject == hrn.isSingleObject() &&
@@ -71,6 +81,10 @@ public class HeapRegionNode extends OwnershipNode {
            description.equals( hrn.getDescription() );
     }
 
+    public int hashCode() {
+       return id.intValue();
+    }
+
 
 
     public boolean isSingleObject() {
@@ -138,8 +152,11 @@ public class HeapRegionNode extends OwnershipNode {
 
     public void applyAlphaNew() {
        assert alphaNew != null;
-       alpha    = alphaNew;
-       alphaNew = null;
+
+       alpha = alphaNew;
+
+       alphaNew = new ReachabilitySet();
+       alphaNew = alphaNew.makeCanonical();
     }