changes.
[IRC.git] / Robust / src / Analysis / SSJava / SSJavaAnalysis.java
index e95766fd84714287c23a727f95d82206b1ec8190..afc629cf8792d667d103255f3fb101c9e7065e5f 100644 (file)
@@ -133,16 +133,19 @@ public class SSJavaAnalysis {
 
   public void doCheck() {
     doMethodAnnotationCheck();
-    computeLinearTypeCheckMethodSet();
-    doLinearTypeCheck();
 
-    init();
+    if (state.SSJAVA && !state.SSJAVAINFER) {
+      computeLinearTypeCheckMethodSet();
+      doLinearTypeCheck();
+      init();
+    }
 
     if (state.SSJAVADEBUG) {
       // debug_printAnnotationRequiredSet();
     }
     if (state.SSJAVAINFER) {
       inference();
+      System.exit(0);
     } else {
       parseLocationAnnotation();
       doFlowDownCheck();
@@ -151,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>();
@@ -262,6 +265,10 @@ public class SSJavaAnalysis {
     methodAnnotationChecker = new MethodAnnotationCheck(this, state, tu);
     methodAnnotationChecker.methodAnnoatationCheck();
     methodAnnotationChecker.methodAnnoataionInheritanceCheck();
+    if (state.SSJAVAINFER) {
+      annotationRequireClassSet.add(methodContainingSSJavaLoop.getClassDesc());
+      annotationRequireSet.add(methodContainingSSJavaLoop);
+    }
     state.setAnnotationRequireSet(annotationRequireSet);
   }
 
@@ -338,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) {