Adding missing 'add' into HashSet.
[jpf-core.git] / src / main / gov / nasa / jpf / listener / DPORStateReducer.java
index c9738fa90c21e9479c7ab5d560f69256d320f6e7..0da718cb6e43f787387ddbd99b0fe446248dc955 100644 (file)
@@ -641,8 +641,10 @@ public class DPORStateReducer extends ListenerAdapter {
     }
     currentExecution.mapCGToChoice(icsCG, choiceCounter);
     // Store restorable state object for this state (always store the latest)
-    RestorableVMState restorableState = vm.getRestorableState();
-    restorableStateMap.put(stateId, restorableState);
+    if (!restorableStateMap.containsKey(stateId)) {
+      RestorableVMState restorableState = vm.getRestorableState();
+      restorableStateMap.put(stateId, restorableState);
+    }
   }
 
   private TransitionEvent setupTransition(IntChoiceFromSet icsCG, int stateId, int choiceIndex) {
@@ -1036,9 +1038,9 @@ public class DPORStateReducer extends ListenerAdapter {
       }
     } else {
       choiceSet = new HashSet<>();
-      choiceSet.add(firstChoice);
       doneBacktrackMap.put(stateId, choiceSet);
     }
+    choiceSet.add(firstChoice);
 
     return false;
   }