Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

improve exception message

Mike McCandless4e5597716a10
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();