lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r897707 - in /lucene/java/trunk: ./ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/ ...
Date Sun, 10 Jan 2010 21:09:59 GMT
Author: rmuir
Date: Sun Jan 10 21:09:58 2010
New Revision: 897707

URL: http://svn.apache.org/viewvc?rev=897707&view=rev
Log:
LUCENE-2200: final classes had non-overriding protected members

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilter.java
    lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java
    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilterTest.java
    lucene/java/trunk/src/java/org/apache/lucene/analysis/CharReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Sun Jan 10 21:09:58 2010
@@ -58,6 +58,10 @@
   which reader the int doc, passed to customScore, refers to.  (Paul
   chez Jamespot via Mike McCandless)
 
+* LUCENE-2200: Several final classes had non-overriding protected
+  members. These were converted to private and unused protected
+  constructors removed.  (Steven Rowe via Robert Muir)
+
 Bug fixes
 
 * LUCENE-2092: BooleanQuery was ignoring disableCoord in its hashCode

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.java
Sun Jan 10 21:09:58 2010
@@ -30,8 +30,8 @@
 
 public final class ArabicNormalizationFilter extends TokenFilter {
 
-  protected ArabicNormalizer normalizer = null;
-  private TermAttribute termAtt;
+  private final ArabicNormalizer normalizer;
+  private final TermAttribute termAtt;
   
   public ArabicNormalizationFilter(TokenStream input) {
     super(input);

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.java
Sun Jan 10 21:09:58 2010
@@ -64,22 +64,15 @@
     }
   }
 
-  private int minGram;
-  private int maxGram;
+  private final int minGram;
+  private final int maxGram;
   private Side side;
   private char[] curTermBuffer;
   private int curTermLength;
   private int curGramSize;
   
-  private TermAttribute termAtt;
-  private OffsetAttribute offsetAtt;
-
-
-  protected EdgeNGramTokenFilter(TokenStream input) {
-    super(input);
-    this.termAtt = addAttribute(TermAttribute.class);
-    this.offsetAtt = addAttribute(OffsetAttribute.class);
-  }
+  private final TermAttribute termAtt;
+  private final OffsetAttribute offsetAtt;
 
   /**
    * Creates EdgeNGramTokenFilter that can generate n-grams in the sizes of the given range

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilter.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilter.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilter.java
Sun Jan 10 21:09:58 2010
@@ -38,17 +38,10 @@
  */
 public final class DelimitedPayloadTokenFilter extends TokenFilter {
   public static final char DEFAULT_DELIMITER = '|';
-  protected char delimiter = DEFAULT_DELIMITER;
-  protected TermAttribute termAtt;
-  protected PayloadAttribute payAtt;
-  protected PayloadEncoder encoder;
-
-  /**
-   * Construct a token stream filtering the given input.
-   */
-  protected DelimitedPayloadTokenFilter(TokenStream input) {
-    this(input, DEFAULT_DELIMITER, new IdentityEncoder());
-  }
+  private final char delimiter;
+  private final TermAttribute termAtt;
+  private final PayloadAttribute payAtt;
+  private final PayloadEncoder encoder;
 
 
   public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder)
{

Modified: lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java
Sun Jan 10 21:09:58 2010
@@ -33,9 +33,9 @@
  */
 public final class ShingleAnalyzerWrapper extends Analyzer {
 
-  protected Analyzer defaultAnalyzer;
-  protected int maxShingleSize = 2;
-  protected boolean outputUnigrams = true;
+  private final Analyzer defaultAnalyzer;
+  private int maxShingleSize = 2;
+  private boolean outputUnigrams = true;
 
   public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer) {
     super();

Modified: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilterTest.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilterTest.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/payloads/DelimitedPayloadTokenFilterTest.java
Sun Jan 10 21:09:58 2010
@@ -34,7 +34,9 @@
 
   public void testPayloads() throws Exception {
     String test = "The quick|JJ red|JJ fox|NN jumped|VB over the lazy|JJ brown|JJ dogs|NN";
-    DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new WhitespaceTokenizer(new
StringReader(test)));
+    DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter
+      (new WhitespaceTokenizer(new StringReader(test)), 
+       DelimitedPayloadTokenFilter.DEFAULT_DELIMITER, new IdentityEncoder());
     TermAttribute termAtt = filter.getAttribute(TermAttribute.class);
     PayloadAttribute payAtt = filter.getAttribute(PayloadAttribute.class);
     assertTermEquals("The", filter, termAtt, payAtt, null);
@@ -53,7 +55,9 @@
   public void testNext() throws Exception {
 
     String test = "The quick|JJ red|JJ fox|NN jumped|VB over the lazy|JJ brown|JJ dogs|NN";
-    DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new WhitespaceTokenizer(new
StringReader(test)));
+    DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter
+      (new WhitespaceTokenizer(new StringReader(test)), 
+       DelimitedPayloadTokenFilter.DEFAULT_DELIMITER, new IdentityEncoder());
     assertTermEquals("The", filter, null);
     assertTermEquals("quick", filter, "JJ".getBytes("UTF-8"));
     assertTermEquals("red", filter, "JJ".getBytes("UTF-8"));

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/CharReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/CharReader.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/CharReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/CharReader.java Sun Jan 10 21:09:58
2010
@@ -28,7 +28,7 @@
  */
 public final class CharReader extends CharStream {
 
-  protected Reader input;
+  private final Reader input;
   
   public static CharStream get(Reader input) {
     return input instanceof CharStream ?

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java?rev=897707&r1=897706&r2=897707&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java Sun Jan 10 21:09:58
2010
@@ -164,7 +164,7 @@
   /**
    * @throws AlreadyClosedException if this FieldsReader is closed
    */
-  protected final void ensureOpen() throws AlreadyClosedException {
+  private void ensureOpen() throws AlreadyClosedException {
     if (closed) {
       throw new AlreadyClosedException("this FieldsReader is closed");
     }



Mime
View raw message