diff --git a/trie4j/src/main/java/org/trie4j/doublearray/DoubleArray.java b/trie4j/src/main/java/org/trie4j/doublearray/DoubleArray.java index 0e6a707..d20b8c9 100644 --- a/trie4j/src/main/java/org/trie4j/doublearray/DoubleArray.java +++ b/trie4j/src/main/java/org/trie4j/doublearray/DoubleArray.java @@ -710,7 +710,7 @@ private void setCheck(int index, int id){ private int last; private SuccinctBitVector term; private Set chars = new TreeSet(); - private char[] charToCode = new char[Character.MAX_VALUE]; + private char[] charToCode = new char[Character.MAX_VALUE+1]; private static final int BASE_EMPTY = Integer.MAX_VALUE; private static final DoubleArrayNode[] emptyNodes = {}; } diff --git a/trie4j/src/main/java/org/trie4j/doublearray/TailDoubleArray.java b/trie4j/src/main/java/org/trie4j/doublearray/TailDoubleArray.java index ba758c0..afed40f 100644 --- a/trie4j/src/main/java/org/trie4j/doublearray/TailDoubleArray.java +++ b/trie4j/src/main/java/org/trie4j/doublearray/TailDoubleArray.java @@ -657,7 +657,7 @@ private void setCheck(int index, int value){ private SuccinctBitVector term; private TailArray tailArray; private Set chars = new TreeSet(); - private char[] charToCode = new char[Character.MAX_VALUE]; + private char[] charToCode = new char[Character.MAX_VALUE+1]; private static final TermIdNode[] emptyNodes = {}; private static final int BASE_EMPTY = Integer.MAX_VALUE; diff --git a/trie4j/src/main/java/org/trie4j/doublearray/UnsafeDoubleArray.java b/trie4j/src/main/java/org/trie4j/doublearray/UnsafeDoubleArray.java index 33a1b82..64215b5 100644 --- a/trie4j/src/main/java/org/trie4j/doublearray/UnsafeDoubleArray.java +++ b/trie4j/src/main/java/org/trie4j/doublearray/UnsafeDoubleArray.java @@ -745,7 +745,7 @@ private void setCheck(long offset, long nodeOffset){ private long last = Unsafe.ARRAY_INT_BASE_OFFSET; private SuccinctBitVector term; private Set chars = new TreeSet(); - private int[] charToScaledCode = new int[Character.MAX_VALUE]; + private int[] charToScaledCode = new int[Character.MAX_VALUE+1]; private static final int BASE_EMPTY = Integer.MAX_VALUE; private static final DoubleArrayNode[] emptyNodes = {}; }