Update of /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm/choice
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12883/src/gov/nasa/jpf/jvm/choice
Modified Files:
IntIntervalGenerator.java
Log Message:
bad, bad back porter! half of the ChoiceGenerator interfacing was missing, the other half was wrong. Added some convenience array getters to Config, but those are not terribly efficient
Index: IntIntervalGenerator.java
===================================================================
RCS file: /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm/choice/IntIntervalGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- IntIntervalGenerator.java 8 Sep 2005 23:21:04 -0000 1.1
+++ IntIntervalGenerator.java 9 Sep 2005 04:55:39 -0000 1.2
@@ -40,6 +40,12 @@
throw new JPFException ("IntIntervalGenerator delta value is 0");
}
+ if (min > max) {
+ int t = max;
+ max = min;
+ min = t;
+ }
+
if (delta > 0) {
next = min - delta;
} else {
@@ -76,9 +82,9 @@
public boolean hasMoreChoices () {
if (delta > 0) {
- return (next <= max);
+ return (next < max);
} else {
- return (next >= min);
+ return (next > min);
}
}
|