fix: keeps SESEstatus for either case(TRUE/FALSE)
authoryeom <yeom>
Thu, 18 Nov 2010 04:05:20 +0000 (04:05 +0000)
committeryeom <yeom>
Thu, 18 Nov 2010 04:05:20 +0000 (04:05 +0000)
Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java
Robust/src/Analysis/OoOJava/RBlockStatusAnalysis.java

index 97fe3ddfc01a04a7d3b7ba87e0633c83fa0b9a01..2b79fa6b876a9e248a397046e872135677f9f65c 100644 (file)
@@ -1041,18 +1041,11 @@ public class OoOJavaAnalysis {
     
     EffectsAnalysis effectsAnalysis = disjointAnalysisTaints.getEffectsAnalysis();
 
-//    System.out.println("current="+currentSESE.getmdEnclosing()+" PARENT=" + currentSESE.getSESEParent());
-
     switch (fn.kind()) {
 
     case FKind.FlatFieldNode:
     case FKind.FlatElementNode: {
 
-      // conflictGraph = sese2conflictGraph.get(currentSESE);
-      // if (conflictGraph == null) {
-      // conflictGraph = new ConflictGraph(state);
-      // }
-
       if (fn instanceof FlatFieldNode) {
         FlatFieldNode ffn = (FlatFieldNode) fn;
         rhs = ffn.getSrc();
index 7675623821608470ac301d58be1cfc64831ab4fe..f0933016b9f72a0ba4aa8147738c9209c514042a 100644 (file)
@@ -129,11 +129,17 @@ public class RBlockStatusAnalysis {
       Entry inEntry = (Entry) inIter.next();
       FlatSESEEnterNode seseContaining = (FlatSESEEnterNode) inEntry.getKey();
       Boolean isAfter = (Boolean) inEntry.getValue();
-
+      
+      if(isAfter==null){
+        isAfter=Boolean.FALSE;
+      }
       Boolean currentIsAfter = current.get(seseContaining);
-      if (currentIsAfter == null || currentIsAfter == Boolean.FALSE) {
-        current.put(seseContaining, isAfter);
+      
+      if (currentIsAfter == null){
+        currentIsAfter=Boolean.FALSE;
       }
+      current.put(seseContaining, (isAfter|currentIsAfter));
+
     }
 
   }
@@ -167,11 +173,11 @@ public class RBlockStatusAnalysis {
     case FKind.FlatCall: {
       Descriptor mdCaller = fm.getMethod();
 
-      FlatCall         fc       = (FlatCall) fn;
+      FlatCall fc = (FlatCall) fn;
       MethodDescriptor mdCallee = fc.getMethod();
-      FlatMethod       fmCallee = state.getMethodFlat( mdCallee );
+      FlatMethod fmCallee = state.getMethodFlat(mdCallee);
 
-         Set<MethodDescriptor> setPossibleCallees = new HashSet<MethodDescriptor>();
+      Set<MethodDescriptor> setPossibleCallees = new HashSet<MethodDescriptor>();
 
       if (mdCallee.isStatic()) {
         setPossibleCallees.add(mdCallee);
@@ -179,14 +185,14 @@ public class RBlockStatusAnalysis {
         TypeDescriptor typeDesc = fc.getThis().getType();
         setPossibleCallees.addAll(callGraph.getMethods(mdCallee, typeDesc));
       }
-      
+
       Iterator<MethodDescriptor> mdItr = setPossibleCallees.iterator();
-      while( mdItr.hasNext() ) {
+      while (mdItr.hasNext()) {
         MethodDescriptor mdPossible = mdItr.next();
-        FlatMethod       fmPossible = state.getMethodFlat( mdPossible );
+        FlatMethod fmPossible = state.getMethodFlat(mdPossible);
       }
-      
-      boolean hasSESECallee=false;
+
+      boolean hasSESECallee = false;
       for (Iterator iterator = setPossibleCallees.iterator(); iterator.hasNext();) {
         MethodDescriptor md = (MethodDescriptor) iterator.next();
         FlatMethod flatMethod = state.getMethodFlat(md);
@@ -199,16 +205,14 @@ public class RBlockStatusAnalysis {
       Stack<FlatSESEEnterNode> seseStack = rra.getRBlockStacks(fm, fn);
       if (!seseStack.isEmpty()) {
         FlatSESEEnterNode currentParent = seseStack.peek();
-        if(!status.containsKey(currentParent)){
-//          System.out.println("currentParent="+currentParent+" fm="+currentParent.getfmEnclosing()+" hasSESECallee="+hasSESECallee);
+        if (!status.containsKey(currentParent)) {
           status.put(currentParent, new Boolean(hasSESECallee));
-        }else{
-          boolean currentParentStatus=status.get(currentParent).booleanValue();
-//          System.out.println("currentParent="+currentParent+" fm="+currentParent.getfmEnclosing()+" hasSESECallee="+hasSESECallee+" currentParentStatus="+currentParentStatus);
-          status.put(currentParent, new Boolean(hasSESECallee|currentParentStatus));
+        } else {
+          boolean currentParentStatus = status.get(currentParent).booleanValue();
+          status.put(currentParent, new Boolean(hasSESECallee | currentParentStatus));
         }
       }
-      
+
     } break;
 
     default: {