changes.
[IRC.git] / Robust / src / Analysis / SSJava / LocationInfo.java
index 048f5cf1c492f013245ab92f560245df71f5ded5..c7cedcdf125833000d9fdda5f8989107bc5b01b0 100644 (file)
@@ -2,7 +2,6 @@ package Analysis.SSJava;
 
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -30,6 +29,15 @@ public class LocationInfo {
     this.cd = cd;
   }
 
+  public Descriptor getDescIdentifier() {
+    if (md != null) {
+      return md;
+    }
+    {
+      return cd;
+    }
+  }
+
   public Map<String, Set<Descriptor>> getMapLocSymbolToDescSet() {
     return mapLocSymbolToDescSet;
   }
@@ -45,9 +53,15 @@ public class LocationInfo {
     }
     mapLocSymbolToRelatedInferLocSet.get(locSymbol).add(
         new Pair<Descriptor, Descriptor>(enclosingDesc, desc));
+
+    addMapLocSymbolToDescSet(locSymbol, desc);
   }
 
   public Set<Pair<Descriptor, Descriptor>> getRelatedInferLocSet(String locSymbol) {
+
+    if (!mapLocSymbolToRelatedInferLocSet.containsKey(locSymbol)) {
+      mapLocSymbolToRelatedInferLocSet.put(locSymbol, new HashSet<Pair<Descriptor, Descriptor>>());
+    }
     return mapLocSymbolToRelatedInferLocSet.get(locSymbol);
   }
 
@@ -70,7 +84,7 @@ public class LocationInfo {
 
       newInferLoc.addLocation(loc);
       mapDescToInferCompositeLocation.put(desc, newInferLoc);
-      addMapLocSymbolToDescSet(desc.getSymbol(), desc);
+      // addMapLocSymbolToDescSet(desc.getSymbol(), desc);
       addMapLocSymbolToRelatedInferLoc(desc.getSymbol(), enclosingDesc, desc);
     }
     return mapDescToInferCompositeLocation.get(desc);
@@ -97,6 +111,7 @@ public class LocationInfo {
   public void removeRelatedInferLocSet(String oldLocSymbol, String newSharedLoc) {
     Set<Descriptor> descSet = getDescSet(oldLocSymbol);
     getDescSet(newSharedLoc).addAll(descSet);
+    // getRelatedInferLocSet(newSharedLoc).addAll(getRelatedInferLocSet(oldLocSymbol));
     mapLocSymbolToDescSet.remove(oldLocSymbol);
     mapLocSymbolToRelatedInferLocSet.remove(oldLocSymbol);
   }