Fixed bug in matchInitialSubstring() where the lower and upper bounds are both set to the upper bound because they reference the same byte array. An array copy operation is added to create two byte arrays for the lower and upper bounds.
The previous procedures outlined in issue 618 to reproduce the problem were ran and it now produces the correct result.
Fix for issue 618
| | |
| | | // Set the upper bound for a range search. |
| | | // We need a key for the upper bound that is of equal length |
| | | // but slightly greater than the lower bound. |
| | | byte[] upper = bytes; |
| | | byte[] upper = new byte[bytes.length]; |
| | | System.arraycopy(bytes,0, upper, 0, bytes.length); |
| | | |
| | | for (int i = upper.length-1; i >= 0; i--) |
| | | { |
| | | if (upper[i] == 0xFF) |
| | |
| | | OrderingMatchingRule orderingRule = |
| | | getAttributeType().getOrderingMatchingRule(); |
| | | |
| | | byte[] normBytes; |
| | | |
| | | // Set the lower bound for a range search. |
| | | byte[] lower = orderingRule.normalizeValue(lowerValue.getValue()).value(); |
| | | |