generate annotated source code again but it's still not the correct one...
[IRC.git] / Robust / src / Analysis / SSJava / MethodLocationInfo.java
index f4780e06123a72658257158d9f6813bb3a8be819..3f93fe2f331b5b683e7c27ba58af6e3a46131f29 100644 (file)
@@ -10,78 +10,68 @@ import IR.MethodDescriptor;
 
 public class MethodLocationInfo extends LocationInfo {
 
-  String returnLocName;
   String thisLocName;
-  String PCLocName;
+  CompositeLocation pcLoc;
+  CompositeLocation returnLoc;
+
+  public CompositeLocation getReturnLoc() {
+    return returnLoc;
+  }
+
+  public void setReturnLoc(CompositeLocation returnLoc) {
+    this.returnLoc = returnLoc;
+  }
+
   String globalLocName;
 
-  Map<Integer, String> mapParamIdxToLocName;
+  Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
   Set<String> paramLocNameSet;
 
   public MethodLocationInfo(MethodDescriptor md) {
     this.md = md;
-    this.mapParamIdxToLocName = new HashMap<Integer, String>();
     this.paramLocNameSet = new HashSet<String>();
-    this.PCLocName = SSJavaAnalysis.TOP;
+    this.pcLoc = new CompositeLocation(new Location(md, Location.TOP));
+    this.mapParamIdxToInferLoc = new HashMap<Integer, CompositeLocation>();
   }
 
-  /*
-   * public void mapFlowNodeToInferLocation(FlowNode node, CompositeLocation
-   * location) { mapFlowNodeToLocation.put(node, location); }
-   * 
-   * public CompositeLocation getInferLocation(FlowNode node) { return
-   * mapFlowNodeToLocation.get(node); }
-   */
-
-  public void setGlobalLocName(String globalLocName) {
-    this.globalLocName = globalLocName;
+  public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
+    mapParamIdxToInferLoc.put(paramIdx, inferLoc);
   }
 
-  public String getReturnLocName() {
-    return returnLocName;
+  public int getNumParam() {
+    return mapParamIdxToInferLoc.keySet().size();
   }
 
-  public void setReturnLocName(String returnLocName) {
-    this.returnLocName = returnLocName;
+  public CompositeLocation getParamCompositeLocation(int idx) {
+    return mapParamIdxToInferLoc.get(idx);
   }
 
-  public String getThisLocName() {
-    return thisLocName;
+  public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
+    return mapParamIdxToInferLoc;
   }
 
-  public void setThisLocName(String thisLocName) {
-    this.thisLocName = thisLocName;
+  public String getGlobalLocName() {
+    return globalLocName;
   }
 
-  public String getPCLocName() {
-    return PCLocName;
+  public void setGlobalLocName(String globalLocName) {
+    this.globalLocName = globalLocName;
   }
 
-  public void setPCLocName(String pCLocName) {
-    PCLocName = pCLocName;
+  public String getThisLocName() {
+    return thisLocName;
   }
 
-  public void addParameter(String name, Descriptor desc, int idx) {
-    mapParamIdxToLocName.put(new Integer(idx), name);
-    // addMappingOfLocNameToDescriptor(name, desc);
+  public void setThisLocName(String thisLocName) {
+    this.thisLocName = thisLocName;
   }
 
-  public Set<String> getParameterLocNameSet() {
-    Set<String> paramSet = new HashSet<String>();
-
-    paramSet.add(PCLocName);
-
-    if (thisLocName != null) {
-      paramSet.add(thisLocName);
-    }
-
-    if (returnLocName != null) {
-      paramSet.add(returnLocName);
-    }
-
-    paramSet.addAll(mapParamIdxToLocName.values());
+  public CompositeLocation getPCLoc() {
+    return pcLoc;
+  }
 
-    return paramSet;
+  public void setPCLoc(CompositeLocation pcLoc) {
+    this.pcLoc = pcLoc;
   }
 
   public void removeMaplocalVarToLocSet(Descriptor localVarDesc) {
@@ -89,4 +79,8 @@ public class MethodLocationInfo extends LocationInfo {
     getDescSet(localVarLocSymbol).remove(localVarDesc);
   }
 
+  public MethodDescriptor getMethodDesc() {
+    return md;
+  }
+
 }