Add some extra check for validity of c'tor parameters in TrieRangeFilter

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@739439 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-01-30 22:38:04 +00:00
parent 4d7f92be9b
commit cb55b1671b
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ public final class TrieRangeFilter extends Filter {
this.max=(max==null) ? trieVariant.TRIE_CODED_NUMERIC_MAX : (
maxInclusive ? max : variant.decrementTrieCoded(max)
);
// check encoded values
if (
this.min.length() != trieVariant.TRIE_CODED_LENGTH ||
this.max.length() != trieVariant.TRIE_CODED_LENGTH
) throw new NumberFormatException("Invalid trie encoded numerical value representation (incompatible length).");
}
/**