Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MJAVADOC-799] Remove inconsistent AbstractFixJavadocMojo#defaultVersion default value #295

Merged
merged 1 commit into from
Jul 12, 2024
Merged

[MJAVADOC-799] Remove inconsistent AbstractFixJavadocMojo#defaultVersion default value #295

merged 1 commit into from
Jul 12, 2024

Conversation

Marcono1234
Copy link
Contributor

As mentioned in 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:

  • Make sure there is a JIRA issue 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.
  • Each commit in the pull request should have a meaningful subject line and body.
  • 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.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • 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 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
you have to acknowledge this by using the following check-box.

@michael-o
Copy link
Member

Since the value cannot be reasonably set to empty I would drop the default value, it has no use at all.

@michael-o michael-o changed the title [MJAVADOC-799] Fix inconsistent AbstractFixJavadocMojo#defaultVersion default values [MJAVADOC-799] Remove inconsistent AbstractFixJavadocMojo#defaultVersion default value Jul 12, 2024
@michael-o michael-o self-requested a review July 12, 2024 19:03
…sion` default value

The current default value has no use anymore.

This closes #295
@asfgit asfgit merged commit 57774cf into apache:master Jul 12, 2024
1 check passed
@Marcono1234
Copy link
Contributor Author

Thanks for the adjustments! It seems currently no test covers a custom defaultVersion value, unless I am overlooking something. Should I create a follow-up pull request and adjust the unit test or the integration test to use a custom value?

@michael-o
Copy link
Member

michael-o commented Jul 13, 2024

Thanks for the adjustments! It seems currently no test covers a custom defaultVersion value, unless I am overlooking something. Should I create a follow-up pull request and adjust the unit test or the integration test to use a custom value?

That'd be great. Currently, we cover that there is no default value for defaultVersion. Now we need a test with a custom version set and that the version truly arrives in the modified files.

@Marcono1234 Marcono1234 deleted the MJAVADOC-799-defaultVersion branch July 18, 2024 21:43
@Marcono1234
Copy link
Contributor Author

Have created #305 for adding a test.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants