Continuation of #14631
We need to update the Javadoc of each token in JavadocCommentsTokenTypes.java to include an example of the new AST print format generated by the latest Checkstyle snapshot.
Each update should document how the token appears in the Javadoc AST, providing both an example input and its corresponding tree structure.
Example Task: PARAM_BLOCK_TAG
Steps to fix
-
Build the snapshot version of Checkstyle
Generate the latest snapshot JAR by following the steps in
How to generate all binaries and -all.jar too.
-
Generate the AST for the example
Example input (src/Test.java):
* @param value The parameter of method.
Command to generate the Javadoc AST:
Windows (PowerShell):
java -jar checkstyle-12.0.0-SNAPSHOT-all.jar -j src/Test.java | ForEach-Object { $_ -replace '\[[0-9]+:[0-9]+\]', '' }
Linux/macOS:
java -jar checkstyle-12.0.0-SNAPSHOT-all.jar -j src/Test.java | sed "s/\[[0-9]\+:[0-9]\+\]//g"
Output:
JAVADOC_CONTENT -> JAVADOC_CONTENT
|--LEADING_ASTERISK -> *
|--TEXT ->
`--JAVADOC_BLOCK_TAG -> JAVADOC_BLOCK_TAG
`--PARAM_BLOCK_TAG -> PARAM_BLOCK_TAG
|--AT_SIGN -> @
|--TAG_NAME -> param
|--TEXT ->
|--PARAMETER_NAME -> value
`--DESCRIPTION -> DESCRIPTION
`--TEXT -> The parameter of method
-
Update Javadoc for PARAM_BLOCK_TAG
Example update:
/**
* {@code @param} Javadoc block tag.
*
* <p>Such Javadoc tag can have two children:</p>
* <ol>
* <li>{@link #PARAMETER_NAME}</li>
* <li>{@link #DESCRIPTION}</li>
* </ol>
*
* <p><b>Example:</b></p>
* <pre>{@code * @param value The parameter of method.}</pre>
*
* <b>Tree:</b>
* <pre>{@code
* JAVADOC_CONTENT -> JAVADOC_CONTENT
* |--LEADING_ASTERISK -> *
* |--TEXT ->
* `--JAVADOC_BLOCK_TAG -> JAVADOC_BLOCK_TAG
* `--PARAM_BLOCK_TAG -> PARAM_BLOCK_TAG
* |--AT_SIGN -> @
* |--TAG_NAME -> param
* |--TEXT ->
* |--PARAMETER_NAME -> value
* `--DESCRIPTION -> DESCRIPTION
* `--TEXT -> The parameter of method
* }</pre>
*
* @see #JAVADOC_BLOCK_TAG
*/
public static final int PARAM_BLOCK_TAG = JavadocCommentsLexer.PARAM_BLOCK_TAG;
Notes
- Each token’s update should be submitted in its own pull request.
- Include the full CLI output (AST print) for the example in the PR description.
- Refer to the Starting Development Guide and the linked YouTube videos to understand how to create and submit a new PR.
- Good examples of update:
Continuation of #14631
We need to update the Javadoc of each token in
JavadocCommentsTokenTypes.javato include an example of the new AST print format generated by the latest Checkstyle snapshot.Each update should document how the token appears in the Javadoc AST, providing both an example input and its corresponding tree structure.
Example Task:
PARAM_BLOCK_TAGSteps to fix
Build the snapshot version of Checkstyle
Generate the latest snapshot JAR by following the steps in
How to generate all binaries and
-all.jartoo.Generate the AST for the example
Example input (
src/Test.java):Command to generate the Javadoc AST:
Windows (PowerShell):
Linux/macOS:
Output:
Update Javadoc for
PARAM_BLOCK_TAGExample update:
Notes