-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-19402. [JDK11] JDiff Support JDK11. #8038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zhtttylz
wants to merge
1
commit into
apache:trunk
Choose a base branch
from
zhtttylz:HADOOP-19402
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,036
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@steveloughran @pan3793 This PR has been in preparation for quite some time by Hualong, and it consists of two main parts:
I’d appreciate your help reviewing this PR. |
💔 -1 overall
This message was automatically generated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
JIRA:HADOOP-19402. [JDK11] JDiff Support JDK11.
This PR restores the ability to generate JDiff API XML on JDK 17 by porting Hadoop’s in‑tree doclets to the modern JDK 9+ Doclet API (
jdk.javadoc.doclet
), while preserving the legacy command‑line surface and XML output contract used in our release process.Background. The original JDiff tool and its legacy doclet APIs predate JPMS and JDK 9; the upstream artifact (
jdiff:1.0.9
) is from 2005 and does not support JDK 9+ doclet APIs. Hadoop’s release process, however, still depends on JDiff XML to publish API diffs between releases.Why now. Since JEP 221 (JDK 9), the standard
com.sun.javadoc
doclet path was superseded byjdk.javadoc.doclet.*
, and the old doclet was eventually removed/replaced in modern JDKs. To run on JDK 17, we need doclets implemented against the new API.How was this patch tested?
Built with JDK 17 and the docs profile to ensure JDiff XML is emitted.
This produces JDiff XML for each module. For example, HDFS:
Apache_Hadoop_HDFS_3.5.0-SNAPSHOT.xml
For code changes:
All changes are scoped to the hadoop-annotations module and only affect build-time doclet code.
src/main/java17
underhadoop-common-project/hadoop-annotations
.jdk17
(activated on JDK ≥ 17) that:java17
sources viabuild-helper-maven-plugin
.maven-compiler-plugin
at-release 17
and-add-modules jdk.javadoc
.java17
)ExcludePrivateAnnotationsJDiffDoclet
IncludePublicAnnotationsJDiffDoclet
ExcludePrivateAnnotationsStandardDoclet
IncludePublicAnnotationsStandardDoclet
Doclet#run(DocletEnvironment)
.jdk.javadoc.doclet.StandardDoclet
to keep the same inclusion/exclusion semantics when producing regular Javadoc.RootDocProcessor
andStabilityOptions
variants that operate onDocletEnvironment
, preserving:@InterfaceAudience.Private
/LimitedPrivate
)IncludePublic*
doclets)unstable
,evolving
, etc.Related JDiff changes (temporary local test build; JDK 17 adaptation implemented)
I implemented the JDK 17 adaptation in JDiff (port to the
jdk.javadoc.doclet
API) and validated Hadoop’s docs build using a temporary, locally installed artifact:jdiff:1.1.1-jdk17
. This build is not published to Maven Central and is provided only so reviewers can reproduce JDiff XML generation on JDK 17. The implementation is available in zhtttylz/jdiff#4.