[ 
https://issues.apache.org/jira/browse/MJAVADOC-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864817#comment-17864817
 ] 

ASF GitHub Bot commented on MJAVADOC-799:
-----------------------------------------

Marcono1234 opened a new pull request, #295:
URL: https://github.com/apache/maven-javadoc-plugin/pull/295

   As mentioned in 
[MJAVADOC-799](https://issues.apache.org/jira/browse/MJAVADOC-799) there is 
currently a mismatch for the `AbstractFixJavadocMojo#defaultVersion` parameter 
default value:
   - documented value: `$Id:$`
   - initial field value: `$Id: $`
   - `@Parameter#defaultValue`: `$Id: $Id`
   
   It seems `@Parameter#defaultValue` overwrites the initial field value. This 
can be seen when running `mvn 
org.apache.maven.plugins:maven-javadoc-plugin:3.7.0:fix` on a dummy project; it 
will add `@version $Id: $Id` to the Javadoc.
   
   As mentioned in the Jira issue I am not sure if `$Id: $Id` is really a good 
/ the intended default value, but it is the value currently used by the Mojo, 
therefore I have kept it. And I have adjusted the expected unit test results 
because they don't seem to create the Mojo instance the way Maven normally 
does, and are therefore using the initial field value (which was previously 
incorrect) instead of `@Parameter#defaultValue`.
   
   I have also included some small changes for URLs and `defaultValue` for 
other parameters. Please let me know if I should omit that because it is not 
directly related to this.
   
   ----
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MJAVADOC) filed
          for the change (usually before you start working on it).  Trivial 
changes like typos do not
          require a JIRA issue.  Your pull request should address just this 
issue, without
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MJAVADOC-XXX] - Fixes bug in 
ApproximateQuantiles`,
          where you replace `MJAVADOC-XXX` with the appropriate JIRA issue. 
Best practice
          is to use the JIRA issue title in the pull request title and in the 
first line of the
          commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify -Prun-its` to make sure basic checks pass. A 
more thorough check will
          be performed on your pull request automatically.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> `defaultVersion` parameter has incorrect default value
> ------------------------------------------------------
>
>                 Key: MJAVADOC-799
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-799
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: fix
>    Affects Versions: 3.7.0
>            Reporter: Marcono1234
>            Priority: Trivial
>
> The {{defaultVersion}} parameter of the {{javadoc:fix}} has an inconsistent / 
> incorrect default value (though I am not sure what the 'correct' value would 
> be).
> h3. Inconsistencies
> - The Javadoc says "By default, it is {{$Id:$}}"
> - The actual and documented (on the Mojo help) default is {{$Id: $Id}}
> - The field in the code has the initial value {{$Id: $}}, with a space (using 
> Unicode escapes)
> This value seems to have no effect because {{@Parameter#defaultValue}} 
> overwrites the initial field value.
> Maybe it would therefore be easiest to:
> - Remove the "By default, it is ..." sentence from the Javadoc
> It is redundant because the Mojo help documents the 
> {{@Parameter#defaultValue}}.
> - Remove the initial field value
> - Optionally remove the {{DEFAULT_VERSION_VALUE}} field and directly inline 
> the value
> - Optionally change the default to the intended default value (whatever that 
> is)
> h3. Historical background
> It seems originally the default value was supposed to be {{$Id$}}, but that 
> was apparently causing issues with SVN, so commit 
> [0cecfaa|https://github.com/apache/maven-javadoc-plugin/commit/0cecfaac31113f44c7db4c29021fa6f92877e458]
>  tried to fix this by using the field initializer and Unicode escapes instead 
> of {{default-value=}}. But this caused the first inconsistency because the 
> Javadoc said {{$Id:$}} (without space) but the value was {{$Id: $}} (with 
> space).
> Later commit 
> [3dcd209|https://github.com/apache/maven-javadoc-plugin/commit/3dcd209a1595a95effd824be5a080f1d19f6f37e#diff-987d1364c087fc6899bde7ad2cdeba3e3c883d3c26e9ffbe86ecdce23d7ee1faR204]
>  refactored the code to use {{@Parameter}} and added a {{defaultValue}}, but 
> that is {{$Id: $Id}} (with duplicate "Id").



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to