You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2020/09/01 17:11:19 UTC

[lucene-solr] branch LUCENE-9215 updated: LUCENE-9215: remove @Overrides and add some missing docs instead of changing visibility

This is an automated email from the ASF dual-hosted git repository.

rmuir pushed a commit to branch LUCENE-9215
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/LUCENE-9215 by this push:
     new 590a73c  LUCENE-9215: remove @Overrides and add some missing docs instead of changing visibility
590a73c is described below

commit 590a73cdc7ff63c3a47f4cd4530232fbd364ecc4
Author: Robert Muir <rm...@apache.org>
AuthorDate: Tue Sep 1 13:11:13 2020 -0400

    LUCENE-9215: remove @Overrides and add some missing docs instead of changing visibility
    
    We don't rely on the presence of the @Override annotation anymore, so
    let's address this problem separately. We use the "Dawid algorithm"
    instead which works here even if it is missing.
    
    Fix visibility back on some (not all) of the crazy classes lacking javadocs. At
    least they are all marked @lucene.internal because no care was given to
    documenting them, so they are candidates to hide later.
---
 .../lucene/analysis/compound/hyphenation/TernaryTree.java     |  6 +++++-
 .../core/src/java/org/apache/lucene/index/BaseTermsEnum.java  |  1 -
 .../org/apache/lucene/index/FilterSortedNumericDocValues.java |  7 -------
 .../org/apache/lucene/index/FilterSortedSetDocValues.java     | 11 -----------
 .../java/org/apache/lucene/search/MultiCollectorManager.java  |  6 +++++-
 .../org/apache/lucene/search/similarities/AxiomaticF1EXP.java |  4 +---
 .../org/apache/lucene/search/similarities/AxiomaticF1LOG.java |  4 +---
 .../org/apache/lucene/search/similarities/AxiomaticF2EXP.java |  4 +---
 .../org/apache/lucene/search/similarities/AxiomaticF2LOG.java |  4 +---
 .../org/apache/lucene/search/similarities/AxiomaticF3EXP.java |  4 +---
 .../org/apache/lucene/search/similarities/AxiomaticF3LOG.java |  4 +---
 .../java/org/apache/lucene/search/similarities/LambdaTTF.java |  1 -
 12 files changed, 16 insertions(+), 40 deletions(-)

diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java
index 6f9d72f..6d1d71a 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/TernaryTree.java
@@ -456,7 +456,11 @@ public class TernaryTree implements Cloneable {
     return new Iterator();
   }
 
-  private class Iterator implements Enumeration<String> {
+  /**
+   * Enumeration over TST keys
+   * @lucene.internal
+   */
+  public class Iterator implements Enumeration<String> {
 
     /**
      * current node index
diff --git a/lucene/core/src/java/org/apache/lucene/index/BaseTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/BaseTermsEnum.java
index 77416c2..0b0d094 100644
--- a/lucene/core/src/java/org/apache/lucene/index/BaseTermsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/index/BaseTermsEnum.java
@@ -66,7 +66,6 @@ public abstract class BaseTermsEnum extends TermsEnum {
     }
   }
 
-  @Override
   public AttributeSource attributes() {
     if (atts == null) {
       atts = new AttributeSource();
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterSortedNumericDocValues.java b/lucene/core/src/java/org/apache/lucene/index/FilterSortedNumericDocValues.java
index 2db66a5..1597eb0 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilterSortedNumericDocValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilterSortedNumericDocValues.java
@@ -33,37 +33,30 @@ public abstract class FilterSortedNumericDocValues extends SortedNumericDocValue
     this.in = in;
   }
 
-  @Override
   public boolean advanceExact(int target) throws IOException {
     return in.advanceExact(target);
   }
 
-  @Override
   public long nextValue() throws IOException {
     return in.nextValue();
   }
 
-  @Override
   public int docValueCount() {
     return in.docValueCount();
   }
 
-  @Override
   public int docID() {
     return in.docID();
   }
 
-  @Override
   public int nextDoc() throws IOException {
     return in.nextDoc();
   }
 
-  @Override
   public int advance(int target) throws IOException {
     return in.advance(target);
   }
 
-  @Override
   public long cost() {
     return in.cost();
   }
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterSortedSetDocValues.java b/lucene/core/src/java/org/apache/lucene/index/FilterSortedSetDocValues.java
index fcee9aa..b403460 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilterSortedSetDocValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilterSortedSetDocValues.java
@@ -36,57 +36,46 @@ public class FilterSortedSetDocValues extends SortedSetDocValues {
     this.in = in;
   }
 
-  @Override
   public boolean advanceExact(int target) throws IOException {
     return in.advanceExact(target);
   }
 
-  @Override
   public long nextOrd() throws IOException {
     return in.nextOrd();
   }
 
-  @Override
   public BytesRef lookupOrd(long ord) throws IOException {
     return in.lookupOrd(ord);
   }
 
-  @Override
   public long getValueCount() {
     return in.getValueCount();
   }
 
-  @Override
   public long lookupTerm(BytesRef key) throws IOException {
     return in.lookupTerm(key);
   }
 
-  @Override
   public TermsEnum termsEnum() throws IOException {
     return in.termsEnum();
   }
 
-  @Override
   public TermsEnum intersect(CompiledAutomaton automaton) throws IOException {
     return in.intersect(automaton);
   }
 
-  @Override
   public int docID() {
     return in.docID();
   }
 
-  @Override
   public int nextDoc() throws IOException {
     return in.nextDoc();
   }
 
-  @Override
   public int advance(int target) throws IOException {
     return in.advance(target);
   }
 
-  @Override
   public long cost() {
     return in.cost();
   }
diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiCollectorManager.java b/lucene/core/src/java/org/apache/lucene/search/MultiCollectorManager.java
index bb6062b..611f518 100644
--- a/lucene/core/src/java/org/apache/lucene/search/MultiCollectorManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/MultiCollectorManager.java
@@ -87,7 +87,11 @@ public class MultiCollectorManager implements CollectorManager<MultiCollectorMan
       return scoreMode;
     }
 
-    private class LeafCollectors implements LeafCollector {
+    /**
+     * Wraps multiple leaf collectors and delegates collection across each one
+     * @lucene.internal
+     */
+    public class LeafCollectors implements LeafCollector {
 
       private final LeafCollector[] leafCollectors;
 
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1EXP.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1EXP.java
index be179d1..1879109 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1EXP.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1EXP.java
@@ -114,13 +114,11 @@ public class AxiomaticF1EXP extends Axiomatic {
             "dl, length of field"));
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, equals to 1");
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as " +
@@ -130,4 +128,4 @@ public class AxiomaticF1EXP extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1LOG.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1LOG.java
index 6096728..5f8559f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1LOG.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF1LOG.java
@@ -106,13 +106,11 @@ public class AxiomaticF1LOG extends Axiomatic {
             "dl, length of field"));
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, equals to 1");
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as log((N + 1) / n) from:",
@@ -121,4 +119,4 @@ public class AxiomaticF1LOG extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2EXP.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2EXP.java
index 276eb47..4446258 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2EXP.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2EXP.java
@@ -106,7 +106,6 @@ public class AxiomaticF2EXP extends Axiomatic {
         "ln, document length, equals to 1");
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, " +
@@ -119,7 +118,6 @@ public class AxiomaticF2EXP extends Axiomatic {
             "avgdl, average length of field across all documents"));
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as " +
@@ -129,4 +127,4 @@ public class AxiomaticF2EXP extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2LOG.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2LOG.java
index 05718f4..5568737 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2LOG.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF2LOG.java
@@ -98,7 +98,6 @@ public class AxiomaticF2LOG extends Axiomatic {
         "ln, document length, equals to 1");
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, " +
@@ -111,7 +110,6 @@ public class AxiomaticF2LOG extends Axiomatic {
             "avgdl, average length of field across all documents"));
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as log((N + 1) / n) from:",
@@ -120,4 +118,4 @@ public class AxiomaticF2LOG extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3EXP.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3EXP.java
index 6382481..b9ed346 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3EXP.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3EXP.java
@@ -108,13 +108,11 @@ public class AxiomaticF3EXP extends Axiomatic {
         "ln, document length, equals to 1");
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, equals to 1");
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as " +
@@ -124,4 +122,4 @@ public class AxiomaticF3EXP extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3LOG.java b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3LOG.java
index 08ec1cc..ea772e0 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3LOG.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/AxiomaticF3LOG.java
@@ -97,13 +97,11 @@ public class AxiomaticF3LOG extends Axiomatic {
         "ln, document length, equals to 1");
   };
 
-  @Override
   protected Explanation tflnExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) tfln(stats, freq, docLen),
         "tfln, mixed term frequency and document length, equals to 1");
   };
 
-  @Override
   protected Explanation idfExplain(BasicStats stats, double freq, double docLen){
     return Explanation.match((float) idf(stats, freq, docLen),
         "idf, inverted document frequency computed as log((N + 1) / n) from:",
@@ -112,4 +110,4 @@ public class AxiomaticF3LOG extends Axiomatic {
         Explanation.match((float) stats.getDocFreq(),
             "n, number of documents containing term"));
   };
-}
\ No newline at end of file
+}
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/LambdaTTF.java b/lucene/core/src/java/org/apache/lucene/search/similarities/LambdaTTF.java
index b13bbd1..72eae4c 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/LambdaTTF.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/LambdaTTF.java
@@ -38,7 +38,6 @@ public class LambdaTTF extends Lambda {
     return lambda;
   }
 
-  @Override
   public final Explanation explain(BasicStats stats) {
     return Explanation.match(
         lambda(stats),