changes: 1) fixes problems in the original EyeTracking benchmark 2) fix a bug in...
[IRC.git] / Robust / src / Analysis / SSJava / SSJavaAnalysis.java
index adf303d533a74f549615468aa7e2591430ad0ced..da84de637057414a997d1f109248415384feb6e9 100644 (file)
@@ -110,6 +110,8 @@ public class SSJavaAnalysis {
 
   private LinkedList<MethodDescriptor> sortedDescriptors;
 
+  private Map<Location, Set<Descriptor>> mapSharedLocToDescSet;
+
   public SSJavaAnalysis(State state, TypeUtil tu, BuildFlat bf, CallGraph callgraph) {
     this.state = state;
     this.tu = tu;
@@ -129,6 +131,7 @@ public class SSJavaAnalysis {
     this.mapDescriptorToSetDependents = new Hashtable<Descriptor, Set<MethodDescriptor>>();
     this.sortedDescriptors = new LinkedList<MethodDescriptor>();
     this.md2pcLoc = new HashMap<MethodDescriptor, CompositeLocation>();
+    this.mapSharedLocToDescSet = new HashMap<Location, Set<Descriptor>>();
   }
 
   public void doCheck() {
@@ -166,6 +169,17 @@ public class SSJavaAnalysis {
     return (LinkedList<MethodDescriptor>) sortedDescriptors.clone();
   }
 
+  public void addSharedDesc(Location loc, Descriptor fd) {
+    if (!mapSharedLocToDescSet.containsKey(loc)) {
+      mapSharedLocToDescSet.put(loc, new HashSet<Descriptor>());
+    }
+    mapSharedLocToDescSet.get(loc).add(fd);
+  }
+
+  public Set<Descriptor> getSharedDescSet(Location loc) {
+    return mapSharedLocToDescSet.get(loc);
+  }
+
   private void inference() {
     LocationInference inferEngine = new LocationInference(this, state);
     inferEngine.inference();