Skip to content

Apache Lucene open-source search software

fix tests-only ob1 in AutomatonTestUtil.getRandomCodePoint

Michael McCandlessc49d474454c3
diff --git a/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java b/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
index 1886869058e..6b9ef6e223e 100644
--- a/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
+++ b/lucene/src/test/org/apache/lucene/util/automaton/AutomatonTestUtil.java
@@ -92,7 +92,7 @@ public class AutomatonTestUtil {
} else if (t.min >= UnicodeUtil.UNI_SUR_HIGH_START) {
if (t.max > UnicodeUtil.UNI_SUR_LOW_END) {
// after surrogates
- code = 1+UnicodeUtil.UNI_SUR_LOW_END+r.nextInt(t.max-UnicodeUtil.UNI_SUR_LOW_END+1);
+ code = 1+UnicodeUtil.UNI_SUR_LOW_END+r.nextInt(t.max-UnicodeUtil.UNI_SUR_LOW_END);
} else {
throw new IllegalArgumentException("transition accepts only surrogates: " + t);
}