Migrate JDiff doclet to JDK 17 Doclet API #4
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.
Overview
This change ports JDiff’s doclet to the modern
jdk.javadoc.doclet.DocletAPI so it compiles and runs on JDK 17 while preserving the legacy command‑line surface and the XML output contract. (The new Doclet API has been the supported path since JDK 9/JEP 221.)Implementation details
JDiffnow implementsDocletand providesinit,getSupportedOptions,getSupportedSourceVersion, and run. TheDocletEnvironmentcollected byjavadocis forwarded into the existing generation pipeline.Doclet.Optionso existing invocations continue to work. Arguments are captured during option parsing and applied after initialization, preserving prior validation/state flow.DocletEnvironment, DocTrees, and thejavax.lang.modelAPIs. Package/type discovery, visibility filtering, and metadata emission produce the same XML schema/shape as before.-addsrcinfo): Source reporting is implemented via DocTrees path and LineMap lookups to match the legacy feature on newer compiler APIsCompatibility & output parity
-firstsentenceonly the first sentence is written. Package‑level fallbacks are still supported.After generating the API XML for hadoop-hdfs with the new JDiff doclet, the output is as follows:
Apache_Hadoop_HDFS_3.5.0-SNAPSHOT.xml