[JDK11] JDiff Support JDK11. - #10
Open
zhtttylz wants to merge 1 commit into
Open
Conversation
zhtttylz
force-pushed
the
HADOOP-19402
branch
from
December 11, 2025 12:04
8f9c11f to
81bf9d4
Compare
zhtttylz
force-pushed
the
HADOOP-19402
branch
from
December 12, 2025 11:10
81bf9d4 to
0bc74ea
Compare
zhtttylz
force-pushed
the
HADOOP-19402
branch
3 times, most recently
from
December 23, 2025 17:49
ef471d0 to
5b2cba6
Compare
zhtttylz
force-pushed
the
HADOOP-19402
branch
from
December 24, 2025 05:26
5b2cba6 to
ecd6a35
Compare
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
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
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.javadocdoclet 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/java17underhadoop-common-project/hadoop-annotations.jdk17(activated on JDK ≥ 17) that:java17sources viabuild-helper-maven-plugin.maven-compiler-pluginat-release 17and-add-modules jdk.javadoc.java17)ExcludePrivateAnnotationsJDiffDocletIncludePublicAnnotationsJDiffDocletExcludePrivateAnnotationsStandardDocletIncludePublicAnnotationsStandardDocletDoclet#run(DocletEnvironment).jdk.javadoc.doclet.StandardDocletto keep the same inclusion/exclusion semantics when producing regular Javadoc.RootDocProcessorandStabilityOptionsvariants 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.docletAPI) 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.