changes.
[IRC.git] / Robust / src / Analysis / SSJava / SSJavaAnalysis.java
index 84c8b3e3754c2f803f74b9078119f4c73f541efd..afc629cf8792d667d103255f3fb101c9e7065e5f 100644 (file)
@@ -134,18 +134,18 @@ public class SSJavaAnalysis {
   public void doCheck() {
     doMethodAnnotationCheck();
 
-    if (state.SSJAVA) {
+    if (state.SSJAVA && !state.SSJAVAINFER) {
       computeLinearTypeCheckMethodSet();
       doLinearTypeCheck();
+      init();
     }
 
-    init();
-
     if (state.SSJAVADEBUG) {
       // debug_printAnnotationRequiredSet();
     }
     if (state.SSJAVAINFER) {
       inference();
+      System.exit(0);
     } else {
       parseLocationAnnotation();
       doFlowDownCheck();
@@ -154,7 +154,7 @@ public class SSJavaAnalysis {
     }
   }
 
-  private void init() {
+  public void init() {
     // perform topological sort over the set of methods accessed by the main
     // event loop
     Set<MethodDescriptor> methodDescriptorsToAnalyze = new HashSet<MethodDescriptor>();
@@ -345,15 +345,23 @@ public class SSJavaAnalysis {
 
   public <T> void writeLatticeDotFile(ClassDescriptor cd, MethodDescriptor md,
       SSJavaLattice<T> locOrder) {
+    writeLatticeDotFile(cd, md, locOrder, "");
+
+  }
+
+  public <T> void writeLatticeDotFile(ClassDescriptor cd, MethodDescriptor md,
+      SSJavaLattice<T> locOrder, String nameSuffix) {
 
     String fileName = "lattice_";
     if (md != null) {
       fileName +=
-          cd.getSymbol().replaceAll("[\\W_]", "") + "_" + md.getSymbol().replaceAll("[\\W_]", "");
+          cd.getSymbol().replaceAll("[\\W_]", "") + "_" + md.toString().replaceAll("[\\W_]", "");
     } else {
       fileName += cd.getSymbol().replaceAll("[\\W_]", "");
     }
 
+    fileName += nameSuffix;
+
     Set<Pair<T, T>> pairSet = locOrder.getOrderingPairSet();
 
     if (pairSet.size() > 0) {