improve exception message

This commit is contained in:
Mike McCandless 2017-09-19 14:23:08 -04:00
parent 7cc9ee6563
commit 4e5597716a
1 changed files with 2 additions and 1 deletions

View File

@ -321,7 +321,8 @@ public class SynonymMap {
throw new IllegalArgumentException("term: " + text + " analyzed to a zero-length token");
}
if (posIncAtt.getPositionIncrement() != 1) {
throw new IllegalArgumentException("term: " + text + " analyzed to a token with posinc != 1");
throw new IllegalArgumentException("term: " + text + " analyzed to a token (" + termAtt +
") with position increment != 1 (got: " + posIncAtt.getPositionIncrement() + ")");
}
reuse.grow(reuse.length() + length + 1); /* current + word + separator */
int end = reuse.length();