More cleanups for comments and variable names.
authorrtrimana <rtrimana@uci.edu>
Tue, 15 Dec 2020 17:49:27 +0000 (09:49 -0800)
committerrtrimana <rtrimana@uci.edu>
Tue, 15 Dec 2020 17:49:27 +0000 (09:49 -0800)
src/main/gov/nasa/jpf/listener/DPORStateReducerWithSummary.java

index 1de182034a014e31d77f6780f2052943ae1747b8..2f84c9588b51612820b86053b110afb0f9f15249 100755 (executable)
@@ -635,9 +635,9 @@ public class DPORStateReducerWithSummary extends ListenerAdapter {
       return stateSummary.keySet();
     }
 
       return stateSummary.keySet();
     }
 
-    public ReadWriteSet getRWSetForEventChoiceAtState(int choice, int stateId) {
+    public ReadWriteSet getRWSetForEventChoiceAtState(int eventChoice, int stateId) {
       HashMap<Integer, ReadWriteSet> stateSummary = mainSummary.get(stateId);
       HashMap<Integer, ReadWriteSet> stateSummary = mainSummary.get(stateId);
-      return stateSummary.get(choice);
+      return stateSummary.get(eventChoice);
     }
 
     private ReadWriteSet performUnion(ReadWriteSet recordedRWSet, ReadWriteSet rwSet) {
     }
 
     private ReadWriteSet performUnion(ReadWriteSet recordedRWSet, ReadWriteSet rwSet) {
@@ -986,7 +986,7 @@ public class DPORStateReducerWithSummary extends ListenerAdapter {
     // E.g. if we have a conflict between 1 and 3, then we create the list {3, 1, 0, 2}
     // for the original set {0, 1, 2, 3}
     
     // E.g. if we have a conflict between 1 and 3, then we create the list {3, 1, 0, 2}
     // for the original set {0, 1, 2, 3}
     
-    // eventChoice represent the event/transaction that will be put into the backtracking set of
+    // eventChoice represents the event/transaction that will be put into the backtracking set of
     // conflictExecution/conflictChoice
     Integer[] newChoiceList = new Integer[refChoices.length];
     ArrayList<TransitionEvent> conflictTrace = conflictExecution.getExecutionTrace();
     // conflictExecution/conflictChoice
     Integer[] newChoiceList = new Integer[refChoices.length];
     ArrayList<TransitionEvent> conflictTrace = conflictExecution.getExecutionTrace();
@@ -1267,14 +1267,14 @@ public class DPORStateReducerWithSummary extends ListenerAdapter {
   // Update the backtrack sets from previous executions
   private void updateBacktrackSetsFromGraph(int stateId, Execution currExecution, int currChoice) {
     // Get events/choices at this state ID
   // Update the backtrack sets from previous executions
   private void updateBacktrackSetsFromGraph(int stateId, Execution currExecution, int currChoice) {
     // Get events/choices at this state ID
-    Set<Integer> eventsAtStateId = mainSummary.getEventChoicesAtStateId(stateId);
-    for (Integer event : eventsAtStateId) {
+    Set<Integer> eventChoicesAtStateId = mainSummary.getEventChoicesAtStateId(stateId);
+    for (Integer eventChoice : eventChoicesAtStateId) {
       // Get the ReadWriteSet object for this event at state ID
       // Get the ReadWriteSet object for this event at state ID
-      ReadWriteSet rwSet = mainSummary.getRWSetForEventChoiceAtState(event, stateId);
+      ReadWriteSet rwSet = mainSummary.getRWSetForEventChoiceAtState(eventChoice, stateId);
       // Memorize visited TransitionEvent object while performing backward DFS to avoid getting caught up in a cycle
       HashSet<TransitionEvent> visited = new HashSet<>();
       // Update the backtrack sets recursively
       // Memorize visited TransitionEvent object while performing backward DFS to avoid getting caught up in a cycle
       HashSet<TransitionEvent> visited = new HashSet<>();
       // Update the backtrack sets recursively
-      updateBacktrackSetDFS(currExecution, currChoice, event, rwSet, visited);
+      updateBacktrackSetDFS(currExecution, currChoice, eventChoice, rwSet, visited);
     }
   }
 }
     }
   }
 }