changes: generated annotated code but it still causes type errors + re-formatting...
[IRC.git] / Robust / src / Analysis / SSJava / FlowNode.java
index b71789aeda8b3e3dd8677b82b7054b5721d13c19..31a9ded33afec455c64623cadbdbd9e3b80ed1bf 100644 (file)
@@ -1,9 +1,9 @@
 package Analysis.SSJava;
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
+import IR.ClassDescriptor;
 import IR.Descriptor;
 import IR.FieldDescriptor;
 import IR.VarDescriptor;
@@ -11,7 +11,7 @@ import IR.VarDescriptor;
 public class FlowNode {
 
   // descriptor tuple is a unique identifier of the flow node
-  private NTuple<Descriptor> descTuple;
+  protected NTuple<Descriptor> descTuple;
 
   // if the infer node represents the base type of field access,
   // this set contains fields of the base type
@@ -40,8 +40,6 @@ public class FlowNode {
     return fieldNodeSet;
   }
 
-  private Set<FlowEdge> outEdgeSet;
-
   public FlowNode(NTuple<Descriptor> tuple) {
 
     this.isSkeleton = false;
@@ -63,11 +61,11 @@ public class FlowNode {
     if (desc != null) {
       descTuple.add(desc);
     }
-    outEdgeSet = new HashSet<FlowEdge>();
 
   }
 
   public void setCompositeLocation(CompositeLocation in) {
+    System.out.println("$$$set compLoc=" + in);
     compLoc = in;
   }
 
@@ -87,14 +85,6 @@ public class FlowNode {
     return descTuple.get(descTuple.size() - 1);
   }
 
-  public boolean isReturn() {
-    return isReturn;
-  }
-
-  public void setReturn(boolean isReturn) {
-    this.isReturn = isReturn;
-  }
-
   public boolean isPrimitiveType() {
     Descriptor desc = descTuple.get(descTuple.size() - 1);
     if (desc instanceof VarDescriptor) {
@@ -114,18 +104,6 @@ public class FlowNode {
     return rtr;
   }
 
-  public Iterator<FlowEdge> iteratorOfOutEdges() {
-    return outEdgeSet.iterator();
-  }
-
-  public void addOutEdge(FlowEdge out) {
-    outEdgeSet.add(out);
-  }
-
-  public Set<FlowEdge> getOutEdgeSet() {
-    return outEdgeSet;
-  }
-
   public int hashCode() {
     return 7 + descTuple.hashCode();
   }
@@ -153,6 +131,7 @@ public class FlowNode {
 
   public String getPrettyID() {
     String id = "<";
+    String property = "";
     for (int i = 0; i < descTuple.size(); i++) {
       if (i != 0) {
         id += ",";
@@ -165,7 +144,19 @@ public class FlowNode {
       id += " " + compLoc;
     }
 
-    return id;
+    // if (isReturn()) {
+    // property += "R";
+    // }
+    //
+    // if (isSkeleton()) {
+    // property += "S";
+    // }
+
+    if (property.length() > 0) {
+      property = " [" + property + "]";
+    }
+
+    return id + property;
   }
 
   public void setDeclarationNode() {