From 4e5597716a100c70ac0066fe70f5b096806d5679 Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Tue, 19 Sep 2017 14:23:08 -0400 Subject: [PATCH] improve exception message --- .../java/org/apache/lucene/analysis/synonym/SynonymMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java index 7371e235085..97db1deb3e4 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java @@ -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();