interim changes: ssjava will have its own class library, not relying on Java Class...
authoryeom <yeom>
Sat, 23 Apr 2011 00:51:14 +0000 (00:51 +0000)
committeryeom <yeom>
Sat, 23 Apr 2011 00:51:14 +0000 (00:51 +0000)
Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java
Robust/src/Analysis/SSJava/FlowDownCheck.java

index bd7ed90621653a0556f51c9c267482c20a4ca6ba..4283d2784bc7171de3f771529d3e1dc8505eca16 100644 (file)
@@ -40,6 +40,31 @@ public class DefinitelyWrittenCheck {
 
   public void definitelyWrittenCheck() {
 
+    SymbolTable classtable = state.getClassSymbolTable();
+    toanalyze.addAll(classtable.getValueSet());
+    toanalyze.addAll(state.getTaskSymbolTable().getValueSet());
+    while (!toanalyze.isEmpty()) {
+      Object obj = toanalyze.iterator().next();
+      ClassDescriptor cd = (ClassDescriptor) obj;
+      toanalyze.remove(cd);
+
+//      if (cd.isClassLibrary()) {
+        // doesn't care about class libraries now
+//        continue;
+//      }
+      for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
+        MethodDescriptor md = (MethodDescriptor) method_it.next();
+        FlatMethod fm = state.getMethodFlat(md);
+        if (fm != null) {
+          
+        }
+
+      }
+    }
+
+    
+    
+    /*
     // creating map
     SymbolTable classtable = state.getClassSymbolTable();
     toanalyze.addAll(classtable.getValueSet());
@@ -51,12 +76,12 @@ public class DefinitelyWrittenCheck {
 
       if (cd.isClassLibrary()) {
         // doesn't care about class libraries now
-//        continue;
+        continue;
       }
       for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
         MethodDescriptor md = (MethodDescriptor) method_it.next();
         FlatMethod fm = state.getMethodFlat(md);
-        if(fm!=null){
+        if (fm != null) {
           LoopFinder loopFinder = new LoopFinder(fm);
           Loops loops = loopFinder.getRootloop(fm);
           Set loopSet = loops.nestedLoops();
@@ -66,7 +91,6 @@ public class DefinitelyWrittenCheck {
             Set loopEntranceSet = rootLoops.loopEntrances();
             for (Iterator iterator2 = loopEntranceSet.iterator(); iterator2.hasNext();) {
               FlatNode loopEnter = (FlatNode) iterator2.next();
-
               String flatNodeLabel = (String) state.fn2labelMap.get(loopEnter);
               if (flatNodeLabel != null && flatNodeLabel.equals("ssjava")) {
                 System.out.println("encounting ss loop:" + loopEnter);
@@ -101,8 +125,12 @@ public class DefinitelyWrittenCheck {
         }
       }
     }
+    */
 
   }
+  
+
+  
 
   private void checkMethodBody(FlatMethod fm) {
 
index ffee22f27e6fda4bdc299ff813cc472c6210f40d..f509cdb795e08f3de2ce05b9c25f858d7198b24e 100644 (file)
@@ -85,10 +85,10 @@ public class FlowDownCheck {
       Object obj = toanalyze.iterator().next();
       ClassDescriptor cd = (ClassDescriptor) obj;
       toanalyze.remove(cd);
-      if (cd.isClassLibrary()) {
+//      if (cd.isClassLibrary()) {
         // doesn't care about class libraries now
-        continue;
-      }
+//        continue;
+//      }
       checkDeclarationInClass(cd);
       for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
         MethodDescriptor md = (MethodDescriptor) method_it.next();
@@ -141,10 +141,10 @@ public class FlowDownCheck {
       Object obj = toanalyze.iterator().next();
       ClassDescriptor cd = (ClassDescriptor) obj;
       toanalyze.remove(cd);
-      if (cd.isClassLibrary()) {
+//      if (cd.isClassLibrary()) {
         // doesn't care about class libraries now
-        continue;
-      }
+//        continue;
+//      }
       checkClass(cd);
       for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
         MethodDescriptor md = (MethodDescriptor) method_it.next();
@@ -810,7 +810,9 @@ public class FlowDownCheck {
       }
 
     }
-    addTypeLocation(an.getSrc().getType(), srcLocation);
+    if(an.getSrc()!=null){
+      addTypeLocation(an.getSrc().getType(), srcLocation);
+    }
     addTypeLocation(an.getDest().getType(), destLocation);
 
     return destLocation;