changes: building field/method hierarchy graph + inserting combination nodes at the...
[IRC.git] / Robust / src / Analysis / SSJava / LocationInfo.java
index ed90ed501c32618b491fad6ae0009deadf237ed2..c7cedcdf125833000d9fdda5f8989107bc5b01b0 100644 (file)
@@ -45,7 +45,7 @@ public class LocationInfo {
   public Map<Descriptor, CompositeLocation> getMapDescToInferLocation() {
     return mapDescToInferCompositeLocation;
   }
-  
+
   public void addMapLocSymbolToRelatedInferLoc(String locSymbol, Descriptor enclosingDesc,
       Descriptor desc) {
     if (!mapLocSymbolToRelatedInferLocSet.containsKey(locSymbol)) {
@@ -53,11 +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);
   }
 
@@ -80,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);