Skip to content

Docs xmlnode deprecations followup#11576

Open
anukalp2804 wants to merge 2 commits into
apache:masterfrom
anukalp2804:docs-xmlnode-deprecations-followup
Open

Docs xmlnode deprecations followup#11576
anukalp2804 wants to merge 2 commits into
apache:masterfrom
anukalp2804:docs-xmlnode-deprecations-followup

Conversation

@anukalp2804
Copy link
Copy Markdown
Contributor

This pull request completes the deprecation documentation for XmlNode
constants and methods by adding consistent Javadoc rationale and
explicit replacement references.

No functional behavior is changed.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the Core IT successfully.

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.

@anukalp2804 anukalp2804 force-pushed the docs-xmlnode-deprecations-followup branch from 7d8333e to b159b3d Compare December 17, 2025 17:40
@anukalp2804
Copy link
Copy Markdown
Contributor Author

Hi @desruisseaux , kindly requesting a review when time permits.
This PR is documentation-only and clarifies deprecation rationale for XmlNode APIs.
Please also approve the workflow run if appropriate. Thank you!

@anukalp2804
Copy link
Copy Markdown
Contributor Author

Friendly reminder — this PR has been idle for a few weeks.
If someone could review or approve workflows when time allows, I would appreciate it.
Thank you!

String CHILDREN_COMBINATION_MODE_ATTRIBUTE = XmlService.CHILDREN_COMBINATION_MODE_ATTRIBUTE;

/**
* @deprecated since 4.0.0.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we need to say "since 4.0.0." Will the annotation add this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out. I’ve removed the redundant “since 4.0.0.” text from the comment and kept the version in the annotation only.

Object inputLocation();

// Deprecated methods that delegate to new ones
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider these deprecation mistaken and unnecessary, and would prefer to revert them all before release. The original method names were just fine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated change that should not be in this PR

@anukalp2804
Copy link
Copy Markdown
Contributor Author

@elharo Thanks for the review.
I’ve reverted the unintended deprecations on delegated methods, removed redundant Javadoc, and cleaned up the unrelated change.
Please let me know if anything else needs adjustment.



/**
* @deprecated since 4.0.0.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The since 4.0.0 part in the comment is redundant with the since = "4.0.0" part in the annotation. The latter will be visible in the generated Javadoc.

Copy link
Copy Markdown
Contributor Author

@anukalp2804 anukalp2804 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out. I’ve removed the redundant “since 4.0.0.” text from the comment and kept the version in the annotation only.

* @deprecated Use {@link #RESOURCES} instead.
*/
@Deprecated
@Deprecated(since = "4.0.0-alpha", forRemoval = false)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 4.0.0, no alpha

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scratch that; this file should not be in this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right — this file was accidentally included from another PR. I’ve removed the Language.java changes so this PR now only contains the XmlNode updates.

* @deprecated Use {@link #RESOURCES} instead.
*/
@Deprecated
@Deprecated(since = "4.0.0-alpha", forRemoval = false)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scratch that; this file should not be in this PR

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code on behalf of Guillaume Nodet

The deprecation Javadoc additions on XmlNode, Artifact, and Language look good overall. However, there is a compilation-breaking duplicate field, a typo, a stale Javadoc @param, and some whitespace nits. Also, this PR bundles a significant behavioral change in DefaultProjectManager (multi-module artifact-id relaxation) that goes well beyond "docs deprecation followup" -- that should be in a separate PR.

The DefaultProjectManager and DefaultSourceRoot changes are out of scope for a documentation PR and should be split out.

Comment thread api/maven-api-xml/src/main/java/org/apache/maven/api/xml/XmlNode.java Outdated
@anukalp2804 anukalp2804 force-pushed the docs-xmlnode-deprecations-followup branch from a2bb16b to 2e63c99 Compare May 22, 2026 03:46
@anukalp2804
Copy link
Copy Markdown
Contributor Author

Hi @gnodet
Thanks for the review. Cleaned up the PR scope to keep only the XmlNode deprecation documentation updates and fixed the duplicate field declaration issue.

@anukalp2804
Copy link
Copy Markdown
Contributor Author

Hi @gnodet , @elharo
I would like to request you that could you please review this pr and let me know if any changes needed from my side.

Thank you.

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully automatic review from Claude Code

Review of PR #11576 — Docs xmlnode deprecations followup

The PR is much improved from earlier iterations — the unrelated files (Language.java, DefaultSourceRoot, DefaultProjectManagerTest) are removed, the redundant since 4.0.0. text in Javadoc is cleaned up per reviewer feedback, and the @deprecated tags are consistently capitalized with trailing periods. Good work.

Two remaining issues:

1. Missing @deprecated Javadoc on getName() (consistency gap)

Every other deprecated getter method in this PR gets a @deprecated Javadoc added (getNamespaceUri, getPrefix, getValue, getAttributes, getAttribute, getChildren, getChild, getInputLocation), but getName() is the only one left without it. The comment // Deprecated methods that delegate to new ones was removed, but no replacement Javadoc was added. It should get the same treatment:

/**
 * @deprecated Use {@link #name()} instead.
 */
@Deprecated(since = "4.0.0", forRemoval = true)
@Nonnull
default String getName() {
    return name();
}

2. Minor: removed blank line before getValue() (formatting inconsistency)

The blank line between getPrefix() and getValue() was removed, while blank lines between all other methods are preserved. This looks unintentional.


Everything else looks correct — the {@link} targets all resolve to real constants/methods in XmlService, and the scope of the PR is now properly focused on XmlNode only.

@anukalp2804
Copy link
Copy Markdown
Contributor Author

Fully automatic review from Claude Code

Review of PR #11576 — Docs xmlnode deprecations followup

The PR is much improved from earlier iterations — the unrelated files (Language.java, DefaultSourceRoot, DefaultProjectManagerTest) are removed, the redundant since 4.0.0. text in Javadoc is cleaned up per reviewer feedback, and the @deprecated tags are consistently capitalized with trailing periods. Good work.

Two remaining issues:

1. Missing @deprecated Javadoc on getName() (consistency gap)

Every other deprecated getter method in this PR gets a @deprecated Javadoc added (getNamespaceUri, getPrefix, getValue, getAttributes, getAttribute, getChildren, getChild, getInputLocation), but getName() is the only one left without it. The comment // Deprecated methods that delegate to new ones was removed, but no replacement Javadoc was added. It should get the same treatment:

/**
 * @deprecated Use {@link #name()} instead.
 */
@Deprecated(since = "4.0.0", forRemoval = true)
@Nonnull
default String getName() {
    return name();
}

2. Minor: removed blank line before getValue() (formatting inconsistency)

The blank line between getPrefix() and getValue() was removed, while blank lines between all other methods are preserved. This looks unintentional.

Everything else looks correct — the {@link} targets all resolve to real constants/methods in XmlService, and the scope of the PR is now properly focused on XmlNode only.

Thank you for review and guidance. I’ve updated the Javadocs and made the formatting consistent. Please review it and let me know if any changes need from my side

@anukalp2804 anukalp2804 requested a review from elharo May 30, 2026 10:05
@anukalp2804
Copy link
Copy Markdown
Contributor Author

anukalp2804 commented May 30, 2026

Hi @gnodet , @elharo ,
I have updated the code please review it and let me know if any changes needed from my side before it get merged.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants