diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java index 3bcd31945c7..294700b8499 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java @@ -32,6 +32,7 @@ package org.apache.lucene.util.automaton; import java.util.*; import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.StringHelper; /** * Construction of basic automata. @@ -216,6 +217,16 @@ final public class Automata { return s; } + private static boolean suffixIsZeros(BytesRef br, int len) { + for(int i=len;i min.length; + + // bar -> bar\0+ + if (maxInclusive == false) { + maxLength--; + } + + if (maxLength == min.length) { + if (minInclusive == false) { + return makeEmpty(); + } else { + return makeBinary(min); + } + } + + Automaton a = new Automaton(); + int lastState = a.createState(); + for (int i=0;i