lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [03/50] [abbrv] lucene-solr:jira/solr-11990: LUCENE-8408: Highlighter: Remove obsolete private AttributeFactory instance
Date Sat, 28 Jul 2018 04:49:26 GMT
LUCENE-8408: Highlighter: Remove obsolete private AttributeFactory instance


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/20a7ee9e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/20a7ee9e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/20a7ee9e

Branch: refs/heads/jira/solr-11990
Commit: 20a7ee9e11f42915161a7d12857e2565040a131d
Parents: c152cae
Author: David Smiley <dsmiley@apache.org>
Authored: Fri Jul 20 12:33:34 2018 -0400
Committer: David Smiley <dsmiley@apache.org>
Committed: Fri Jul 20 12:33:34 2018 -0400

----------------------------------------------------------------------
 lucene/CHANGES.txt                                           | 4 +++-
 .../lucene/search/highlight/TokenStreamFromTermVector.java   | 8 --------
 2 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20a7ee9e/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 7697cb7..8257dbc 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -177,7 +177,6 @@ Bug Fixes:
   TokenStream if a token consisting entirely of delimiter characters was 
   encountered, 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's
   Extended_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:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/20a7ee9e/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenStreamFromTermVector.java
----------------------------------------------------------------------
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.java
index 135bfe8..6353930 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()) {


Mime
View raw message