Package com.qulice.checkstyle
Class JavadocStrayAsteriskCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.qulice.checkstyle.JavadocStrayAsteriskCheck
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable,com.puppycrawl.tools.checkstyle.api.Contextualizable
public final class JavadocStrayAsteriskCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
Check for a stray asterisk at the end of a Javadoc line.
A paragraph opened with <p> is sometimes "closed" with a bare
* appended to the last line of its text, instead of </p>
or nothing at all. Javadoc renders that asterisk as literal text, right
after the sentence. See
#1783.
The following Javadoc will be reported as a violation, since the last line of the paragraph ends with an asterisk that belongs to no comment delimiter:
/**
* <p>The sentinel is not a real expression kind, it is
* the parent for entries pushed at indent zero. *
*/
And this is how it should be written instead:
/** * <p>The sentinel is not a real expression kind, it is * the parent for entries pushed at indent zero. */
The asterisks that open the comment, prefix its lines, and close it are
not touched. Lines inside a <pre>...</pre> block or a
{@snippet ...} block are skipped, since an asterisk may legally
end a line of example code there.
- Since:
- 0.73.4
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]int[]int[]voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearViolations, destroy, finishTree, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityMethods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Constructor Details
-
JavadocStrayAsteriskCheck
public JavadocStrayAsteriskCheck()Default constructor.
-
-
Method Details
-
getDefaultTokens
public int[] getDefaultTokens()- Specified by:
getDefaultTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()- Specified by:
getAcceptableTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()- Specified by:
getRequiredTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) - Overrides:
visitTokenin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-