Apache Lucene open-source search software
LUCENE-8408: Highlighter: Remove obsolete private AttributeFactory instance
David Smiley20a7ee9e11f4
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 7697cb7e7e2..8257dbc801f 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -177,7 +177,6 @@ Bug Fixes:TokenStream if a token consisting entirely of delimiter characters wasencountered, but preserve_original was set. (Alan Woodward)-* LUCENE-8398: TieredMergePolicy.getMaxMergedSegmentMB has rounding error (Erick Erickson)Changes in Runtime Behavior:@@ -204,6 +203,9 @@ Other:* LUCENE-8366: Upgrade to ICU 62.1. Emoji handling now uses Unicode 11'sExtended_Pictographic property. (Robert Muir)+* LUCENE-8408: original Highlighter: Remove obsolete static AttributeFactory instance+ in TokenStreamFromTermVector. (Michael Braun, David Smiley)+======================= Lucene 7.4.1 =======================Bug Fixes:diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermVector.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermVector.javaindex 135bfe88e2b..6353930abb5 100644--- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermVector.java+++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermVector.java@@ -21,13 +21,11 @@ import java.io.IOException;import org.apache.lucene.analysis.TokenStream;import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;-import org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl;import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;import org.apache.lucene.index.PostingsEnum;import org.apache.lucene.index.Terms;import org.apache.lucene.index.TermsEnum;-import org.apache.lucene.util.AttributeFactory;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.BytesRefArray;import org.apache.lucene.util.BytesRefBuilder;@@ -52,11 +50,6 @@ import org.apache.lucene.util.UnicodeUtil;*/public final class TokenStreamFromTermVector extends TokenStream {- //This attribute factory uses less memory when captureState() is called.- public static final AttributeFactory ATTRIBUTE_FACTORY =- AttributeFactory.getStaticImplementation(- AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY, PackedTokenAttributeImpl.class);-private final Terms vector;private final CharTermAttribute termAttribute;@@ -89,7 +82,6 @@ public final class TokenStreamFromTermVector extends TokenStream {* @param maxStartOffset if a token's start offset exceeds this then the token is not added. -1 disables the limit.*/public TokenStreamFromTermVector(Terms vector, int maxStartOffset) throws IOException {- super(ATTRIBUTE_FACTORY);this.maxStartOffset = maxStartOffset < 0 ? Integer.MAX_VALUE : maxStartOffset;assert !hasAttribute(PayloadAttribute.class) : "AttributeFactory shouldn't have payloads *yet*";if (!vector.hasPositions() && !vector.hasOffsets()) {