diff --git a/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMAAnnotationsTokenizer.java b/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMAAnnotationsTokenizer.java index c33b355c5bd..159d7fabfdb 100644 --- a/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMAAnnotationsTokenizer.java +++ b/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMAAnnotationsTokenizer.java @@ -76,8 +76,7 @@ public final class UIMAAnnotationsTokenizer extends BaseUIMATokenizer { @Override public void end() throws IOException { - if (offsetAttr.endOffset() < finalOffset) - offsetAttr.setOffset(finalOffset, finalOffset); + offsetAttr.setOffset(finalOffset, finalOffset); super.end(); } } diff --git a/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMATypeAwareAnnotationsTokenizer.java b/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMATypeAwareAnnotationsTokenizer.java index 01fa0e1f74f..e2b0bba2158 100644 --- a/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMATypeAwareAnnotationsTokenizer.java +++ b/modules/analysis/uima/src/java/org/apache/lucene/analysis/uima/UIMATypeAwareAnnotationsTokenizer.java @@ -91,8 +91,7 @@ public final class UIMATypeAwareAnnotationsTokenizer extends BaseUIMATokenizer { @Override public void end() throws IOException { - if (offsetAttr.endOffset() < finalOffset) - offsetAttr.setOffset(finalOffset, finalOffset); + offsetAttr.setOffset(finalOffset, finalOffset); super.end(); }