Lucene - Core
  1. Lucene - Core
  2. LUCENE-6571

Javadoc error when run in private access level

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.4, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Javadoc error when run in private access level.

        Activity

        Hide
        Cao Manh Dat added a comment -

        Here is patch for this trivial bug.

        Show
        Cao Manh Dat added a comment - Here is patch for this trivial bug.
        Hide
        Christine Poerschke added a comment -

        Hi Cao Manh Dat - just applied your patch to my local trunk working copy and then ran ant javadocs -Djavadoc.access=private on it.

        Seeing some warnings, will check further, might be due to local setup or so.

          [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java:386: warning - Tag @link: can't find setIndexingChain(IndexingChain) in org.apache.lucene.index.IndexWriterConfig
          [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:119: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
          [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:114: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
          [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:109: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
        
        Show
        Christine Poerschke added a comment - Hi Cao Manh Dat - just applied your patch to my local trunk working copy and then ran ant javadocs -Djavadoc.access=private on it. Seeing some warnings, will check further, might be due to local setup or so. [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java:386: warning - Tag @link: can't find setIndexingChain(IndexingChain) in org.apache.lucene.index.IndexWriterConfig [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:119: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:114: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST [javadoc] /mydirectory/lucene/core/src/java/org/apache/lucene/util/fst/FST.java:109: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
        Hide
        Christine Poerschke added a comment -

        With respect to the LiveIndexWriterConfig.java:386 warning, we have currently

        IndexWriterConfig.java

        public final class IndexWriterConfig extends LiveIndexWriterConfig {
          ...
          IndexWriterConfig setIndexingChain(IndexingChain indexingChain) {
            if (indexingChain == null) {
              throw new IllegalArgumentException("indexingChain must not be null");
            }
            this.indexingChain = indexingChain;
            return this;
          }
        
          @Override
          IndexingChain getIndexingChain() {
            return indexingChain;
          }
        

        LiveIndexWriterConfig.java

        public class LiveIndexWriterConfig {
          ...
          protected volatile IndexingChain indexingChain;
          /**
           * Returns the indexing chain set on
           * {@link IndexWriterConfig#setIndexingChain(IndexingChain)}.
           */
          IndexingChain getIndexingChain() {
            return indexingChain;
          }
        

        i.e. @link IndexWriterConfig#setIndexingChain in the base class references a non-public function in the derived class.

        I wonder if the @Override getIndexingChain() function in the derived class could be removed and setIndexingChain be relocated to the base class? And might indexingChain be made private instead of protected then also?

        Show
        Christine Poerschke added a comment - With respect to the LiveIndexWriterConfig.java:386 warning, we have currently IndexWriterConfig.java public final class IndexWriterConfig extends LiveIndexWriterConfig { ... IndexWriterConfig setIndexingChain(IndexingChain indexingChain) { if (indexingChain == null ) { throw new IllegalArgumentException( "indexingChain must not be null " ); } this .indexingChain = indexingChain; return this ; } @Override IndexingChain getIndexingChain() { return indexingChain; } LiveIndexWriterConfig.java public class LiveIndexWriterConfig { ... protected volatile IndexingChain indexingChain; /** * Returns the indexing chain set on * {@link IndexWriterConfig#setIndexingChain(IndexingChain)}. */ IndexingChain getIndexingChain() { return indexingChain; } i.e. @link IndexWriterConfig#setIndexingChain in the base class references a non-public function in the derived class. I wonder if the @Override getIndexingChain() function in the derived class could be removed and setIndexingChain be relocated to the base class? And might indexingChain be made private instead of protected then also?
        Hide
        Michael McCandless added a comment -

        The problem with moving setIndexingChain to LiveIndexWriterConfig is this is not something you can change "live" in an IndexWriter: it only takes effect when IW first starts up.

        We could also remove the setter entirely (hardwire IW to DefaultIndexingChain)? It's already package private, is insanely expert, and devs playing with this are clearly expert enough to modify Lucene's sources to do their experiments.

        Show
        Michael McCandless added a comment - The problem with moving setIndexingChain to LiveIndexWriterConfig is this is not something you can change "live" in an IndexWriter : it only takes effect when IW first starts up. We could also remove the setter entirely (hardwire IW to DefaultIndexingChain )? It's already package private, is insanely expert, and devs playing with this are clearly expert enough to modify Lucene's sources to do their experiments.
        Hide
        Adrien Grand added a comment -

        We could also remove the setter entirely (hardwire IW to DefaultIndexingChain)? It's already package private, is insanely expert, and devs playing with this are clearly expert enough to modify Lucene's sources to do their experiments.

        +1 It is weird to have a pkg-private method being part of our API.

        Show
        Adrien Grand added a comment - We could also remove the setter entirely (hardwire IW to DefaultIndexingChain)? It's already package private, is insanely expert, and devs playing with this are clearly expert enough to modify Lucene's sources to do their experiments. +1 It is weird to have a pkg-private method being part of our API.
        Hide
        Christine Poerschke added a comment -

        Created LUCENE-6738 for removal of the setter and also removal of the overriding getter since it just 'repeats' the base class getter.

        Show
        Christine Poerschke added a comment - Created LUCENE-6738 for removal of the setter and also removal of the overriding getter since it just 'repeats' the base class getter.
        Hide
        Christine Poerschke added a comment -

        Removing setIndexingChain via LUCENE-6738 removed the LiveIndexWriterConfig.java:386 warning.

        The FST.java warnings remain

        FST.java:119: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
        FST.java:114: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
        FST.java:109: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST
        

        but

        package org.apache.lucene.util.fst;
        ...
        -import org.apache.lucene.util.fst.Builder.UnCompiledNode;
        ...
        -   * @see #shouldExpand(Builder, UnCompiledNode)
        +   * @see #shouldExpand(Builder, Builder.UnCompiledNode)
        ...
            * @see Builder.UnCompiledNode#depth
            */
        -  private boolean shouldExpand(Builder<T> builder, UnCompiledNode<T> node) {
        +  private boolean shouldExpand(Builder<T> builder, Builder.UnCompiledNode<T> node) {
        ...
        

        changes would make the warning go away.

        Show
        Christine Poerschke added a comment - Removing setIndexingChain via LUCENE-6738 removed the LiveIndexWriterConfig.java:386 warning. The FST.java warnings remain FST.java:119: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST FST.java:114: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST FST.java:109: warning - Tag @see: can't find shouldExpand(Builder, UnCompiledNode) in org.apache.lucene.util.fst.FST but package org.apache.lucene.util.fst; ... - import org.apache.lucene.util.fst.Builder.UnCompiledNode; ... - * @see #shouldExpand(Builder, UnCompiledNode) + * @see #shouldExpand(Builder, Builder.UnCompiledNode) ... * @see Builder.UnCompiledNode#depth */ - private boolean shouldExpand(Builder<T> builder, UnCompiledNode<T> node) { + private boolean shouldExpand(Builder<T> builder, Builder.UnCompiledNode<T> node) { ... changes would make the warning go away.
        Hide
        Michael McCandless added a comment -

        +1 to the FST fixes! Thanks Christine Poerschke.

        Show
        Michael McCandless added a comment - +1 to the FST fixes! Thanks Christine Poerschke .
        Hide
        ASF subversion and git services added a comment -

        Commit 1697491 from Christine Poerschke in branch 'dev/trunk'
        [ https://svn.apache.org/r1697491 ]

        LUCENE-6571: fix some private access level javadoc errors and warnings

        Show
        ASF subversion and git services added a comment - Commit 1697491 from Christine Poerschke in branch 'dev/trunk' [ https://svn.apache.org/r1697491 ] LUCENE-6571 : fix some private access level javadoc errors and warnings
        Hide
        ASF subversion and git services added a comment -

        Commit 1697496 from Christine Poerschke in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1697496 ]

        LUCENE-6571: fix some private access level javadoc errors and warnings (merge in revision 1697491 from trunk)

        Show
        ASF subversion and git services added a comment - Commit 1697496 from Christine Poerschke in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1697496 ] LUCENE-6571 : fix some private access level javadoc errors and warnings (merge in revision 1697491 from trunk)
        Hide
        Christine Poerschke added a comment -

        Thanks Cao Manh Dat!

        Show
        Christine Poerschke added a comment - Thanks Cao Manh Dat !
        Hide
        Christine Poerschke added a comment -

        For the log, the changes committed above were for trunk and branch_5x but additional residual ant javadocs -Djavadoc.access=private errors remain, for example jflex generated code gives errors such as

        ... WikipediaTokenizerImpl.java:426: error: bad use of '>'
        /** zzAtEOF == true <=> the scanner is at the EOF */
                              ^
        

        On https://github.com/jflex-de/jflex/issues there is #182 re: doclint but a quick search found no equivalent issue re: javadocs (with private access level).

        Show
        Christine Poerschke added a comment - For the log, the changes committed above were for trunk and branch_5x but additional residual ant javadocs -Djavadoc.access=private errors remain, for example jflex generated code gives errors such as ... WikipediaTokenizerImpl.java:426: error: bad use of '>' /** zzAtEOF == true <=> the scanner is at the EOF */ ^ On https://github.com/jflex-de/jflex/issues there is #182 re: doclint but a quick search found no equivalent issue re: javadocs (with private access level).

          People

          • Assignee:
            Christine Poerschke
            Reporter:
            Cao Manh Dat
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development