it passes the definitely written analysis.
[IRC.git] / Robust / src / Analysis / SSJava / DefinitelyWrittenCheck.java
index cec3a49d32ea1b075bdcfea5edb1bf3f2045368a..c1dfbbbcdb46c57dd775880c0500e2eceb1f477d 100644 (file)
@@ -35,6 +35,8 @@ public class DefinitelyWrittenCheck {
   State state;
   CallGraph callGraph;
 
+  int debugcount = 0;
+
   // maps a descriptor to its known dependents: namely
   // methods or tasks that call the descriptor's method
   // AND are part of this analysis (reachable from main)
@@ -833,6 +835,10 @@ public class DefinitelyWrittenCheck {
 
     writtenAnalysis_analyzeLoop();
 
+    if (debugcount > 0) {
+      throw new Error();
+    }
+
   }
 
   private void writtenAnalysis_analyzeLoop() {
@@ -999,7 +1005,6 @@ public class DefinitelyWrittenCheck {
         // READ_bound set
         // of callee: callee has 'read' requirement!
 
-
         for (Iterator iterator = calleeUnionBoundReadSet.iterator(); iterator.hasNext();) {
           NTuple<Descriptor> read = (NTuple<Descriptor>) iterator.next();
           Hashtable<FlatNode, Boolean> gen = curr.get(read);
@@ -1174,13 +1179,15 @@ public class DefinitelyWrittenCheck {
         NTuple<Descriptor> write = (NTuple<Descriptor>) iterator.next();
         if (hp.startsWith(write)) {
           // it has write effect!
-          //throw new Error(
-          System.out.println("###"+
-              "There is a variable, which is reachable through references "
+          // throw new Error(
+          System.out
+              .println("###"
+                  + "There is a variable, which is reachable through references "
                   + hp
                   + ", who comes back to the same read statement without being overwritten at the out-most iteration at "
                   + methodContainingSSJavaLoop.getClassDesc().getSourceFileName() + "::"
                   + fn.getNumLine());
+          debugcount++;
         }
       }
     }
@@ -1323,7 +1330,6 @@ public class DefinitelyWrittenCheck {
 
     }
 
-
   }
 
   private void methodReadOverWrite_nodeActions(FlatNode fn, Set<NTuple<Descriptor>> writtenSet,