1 package Analysis.SSJava;
3 import java.util.HashMap;
4 import java.util.HashSet;
9 import IR.MethodDescriptor;
11 public class MethodLocationInfo extends LocationInfo {
19 Map<Integer, String> mapParamIdxToLocName;
20 Set<String> paramLocNameSet;
21 Map<FlowNode, CompositeLocation> mapFlowNodeToLocation;
23 public MethodLocationInfo(MethodDescriptor md) {
25 this.mapParamIdxToLocName = new HashMap<Integer, String>();
26 this.paramLocNameSet = new HashSet<String>();
27 this.PCLocName = SSJavaAnalysis.TOP;
28 this.mapFlowNodeToLocation = new HashMap<FlowNode, CompositeLocation>();
31 public void mapFlowNodeToInferLocation(FlowNode node, CompositeLocation location) {
32 mapFlowNodeToLocation.put(node, location);
35 public CompositeLocation getInferLocation(FlowNode node) {
36 return mapFlowNodeToLocation.get(node);
39 public String getReturnLocName() {
43 public void setReturnLocName(String returnLocName) {
44 this.returnLocName = returnLocName;
47 public String getThisLocName() {
51 public void setThisLocName(String thisLocName) {
52 this.thisLocName = thisLocName;
55 public String getPCLocName() {
59 public void setPCLocName(String pCLocName) {
60 PCLocName = pCLocName;
63 public void addParameter(String name, Descriptor desc, int idx) {
64 mapParamIdxToLocName.put(new Integer(idx), name);
65 addMappingOfLocNameToDescriptor(name, desc);
68 public Set<String> getParameterLocNameSet() {
69 Set<String> paramSet = new HashSet<String>();
71 paramSet.add(PCLocName);
73 if (thisLocName != null) {
74 paramSet.add(thisLocName);
77 if (returnLocName != null) {
78 paramSet.add(returnLocName);
81 paramSet.addAll(mapParamIdxToLocName.values());