From 15a430755720be88420508141246ea4909cb4ade Mon Sep 17 00:00:00 2001 From: rtrimana Date: Fri, 19 Jun 2020 09:42:07 -0700 Subject: [PATCH] A few hacks to make the list circular: this lets the CG not signal the JPF that the end of the list is the end of the CG execution. --- .../jpf/vm/choice/NumberChoiceFromList.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/gov/nasa/jpf/vm/choice/NumberChoiceFromList.java b/src/main/gov/nasa/jpf/vm/choice/NumberChoiceFromList.java index 4a7b442..ee3d36e 100644 --- a/src/main/gov/nasa/jpf/vm/choice/NumberChoiceFromList.java +++ b/src/main/gov/nasa/jpf/vm/choice/NumberChoiceFromList.java @@ -110,10 +110,18 @@ public abstract class NumberChoiceFromList extends ChoiceGener **/ @Override public boolean hasMoreChoices() { - if (!isDone && (count < values.length-1)) + // TODO: Fix for Groovy's model-checking + // TODO: This is a setter to change the values of the ChoiceGenerator to implement POR + if (!isDone) return true; else return false; + + /* TODO: ORIGINAL CODE + if (!isDone && (count < values.length-1)) + return true; + else + return false;*/ } /** @@ -121,7 +129,15 @@ public abstract class NumberChoiceFromList extends ChoiceGener **/ @Override public void advance() { + // TODO: Fix for Groovy's model-checking + // TODO: This is a setter to change the values of the ChoiceGenerator to implement POR + + // TODO: We make this circular if (count < values.length-1) count++; + else count = 0; + + /* TODO: ORIGINAL CODE + if (count < values.length-1) count++;*/ } /** -- 2.34.1