Skip to content

Commit

Permalink
supplemental: fix malformed javadocs (checkstyle#10818)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbludov authored and romani committed Sep 25, 2021
1 parent 25c3842 commit afdf3de
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ private void processChildren(DetailAstImpl parent, List<? extends ParseTree> chi

/**
* Create a DetailAstImpl from a given token and token type. This method
* should be used for imaginary nodes only, i.e. 'OBJBLOCK -> OBJBLOCK',
* should be used for imaginary nodes only, i.e. 'OBJBLOCK -&gt; OBJBLOCK',
* where the text on the RHS matches the text on the LHS.
*
* @param tokenType the token type of this DetailAstImpl
Expand All @@ -2005,7 +2005,7 @@ private static DetailAstImpl createImaginary(int tokenType) {

/**
* Create a DetailAstImpl from a given token and token type. This method
* should be used for literal nodes only, i.e. 'PACKAGE_DEF -> package'.
* should be used for literal nodes only, i.e. 'PACKAGE_DEF -&gt; package'.
*
* @param tokenType the token type of this DetailAstImpl
* @param startToken the first token that appears in this DetailAstImpl.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ private static DetailAST findWarningsHolder(final DetailAST annotation) {
/**
* Strips a single double quote from the front and back of a string.
*
* <p>For example:
* <br/>
* <p>For example:</p>
* <pre>
* Input String = "unchecked"
* <br/>
* </pre>
* Output String = unchecked
*
* @param warning the warning string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,13 @@ public void visitToken(DetailAST ast) {
/**
* Determines if ast is in the body of a flow control statement without
* braces. An example of such a statement would be
* <p>
* <pre>
* if (y < 0)
* if (y &lt; 0)
* x = y;
* </pre>
* </p>
* <p>
* This leads to the following AST structure:
* </p>
* <p>
* <pre>
* LITERAL_IF
* LPAREN
Expand All @@ -258,7 +255,6 @@ public void visitToken(DetailAST ast) {
* EXPR // body
* SEMI
* </pre>
* </p>
* <p>
* We need to ensure that ast is in the body and not in the test.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,10 @@ && canReturnOnlyBooleanLiteral(elseStatement)) {
* or a compound statement that contains only such a return statement.
*
* <p>Returns {@code true} iff ast represents
* <br/>
* <pre>
* return true/false;
* </pre>
* or
* <br/>
* <pre>
* {
* return true/false;
Expand All @@ -198,7 +196,6 @@ private static boolean canReturnOnlyBooleanLiteral(DetailAST ast) {
* Returns if an AST is a return statement with a boolean literal.
*
* <p>Returns {@code true} iff ast represents
* <br/>
* <pre>
* return true/false;
* </pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,12 @@ else if (staticImportsApart) {
* We first compare the container of the static import, container being the type enclosing
* the static element being imported. When this returns 0, we compare the qualified
* import name. For e.g. this is what is considered to be container names:
* <p>
* import static HttpConstants.COLON => HttpConstants
* import static HttpHeaders.addHeader => HttpHeaders
* import static HttpHeaders.setHeader => HttpHeaders
* import static HttpHeaders.Names.DATE => HttpHeaders.Names
* </p>
* <pre>
* import static HttpConstants.COLON =&gt; HttpConstants
* import static HttpHeaders.addHeader =&gt; HttpHeaders
* import static HttpHeaders.setHeader =&gt; HttpHeaders
* import static HttpHeaders.Names.DATE =&gt; HttpHeaders.Names
* </pre>
* <p>
* According to this logic, HttpHeaders.Names would come after HttpHeaders.
*
Expand Down Expand Up @@ -1033,12 +1033,12 @@ private static int compareContainerOrder(String importName1, String importName2,
* Extracts import container name from fully qualified import name.
* An import container name is the type which encloses the static element being imported.
* For example, HttpConstants, HttpHeaders, HttpHeaders.Names are import container names:
* <p>
* import static HttpConstants.COLON => HttpConstants
* import static HttpHeaders.addHeader => HttpHeaders
* import static HttpHeaders.setHeader => HttpHeaders
* import static HttpHeaders.Names.DATE => HttpHeaders.Names
* </p>
* <pre>
* import static HttpConstants.COLON =&gt; HttpConstants
* import static HttpHeaders.addHeader =&gt; HttpHeaders
* import static HttpHeaders.setHeader =&gt; HttpHeaders
* import static HttpHeaders.Names.DATE =&gt; HttpHeaders.Names
* </pre>
*
* @param qualifiedImportName fully qualified import name.
* @return import container name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ private static DetailAST getPrevCaseToken(DetailAST parentStatement) {
* Checks if comment and next code statement
* (or previous code stmt like <b>case</b> in switch block) are indented at the same level,
* e.g.:
* <p>
* <pre>
* {@code
* // some comment - same indentation level
Expand All @@ -1090,7 +1089,6 @@ private static DetailAST getPrevCaseToken(DetailAST parentStatement) {
* boolean bool = true; - same indentation level
* }
* </pre>
* </p>
*
* @param comment {@link TokenTypes#SINGLE_LINE_COMMENT single line comment}.
* @param prevStmt previous code statement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ private static String getCommentText(String... comments) {

/**
* Finds the index of the first non-whitespace character ignoring the
* Javadoc comment start and end strings (&#47** and *&#47) as well as any
* Javadoc comment start and end strings (&#47;** and *&#47;) as well as any
* leading asterisk.
*
* @param line the Javadoc comment line of text to scan.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck {
/** Specify user-configured regular expressions to ignore classes. */
private final List<Pattern> excludeClassesRegexps = new ArrayList<>();

/** A map of (imported class name -> class name with package) pairs. */
/** A map of (imported class name -&gt; class name with package) pairs. */
private final Map<String, String> importedClassPackages = new HashMap<>();

/** Stack of class contexts. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ private static boolean isGenericBeforeMethod(DetailAST ast) {
}

/**
* Checks if current generic end ('>') is located after
* Checks if current generic end ('&gt;') is located after
* {@link TokenTypes#METHOD_REF method reference operator}.
*
* @param genericEnd {@link TokenTypes#GENERIC_END}
* @return true if '>' follows after method reference.
* @return true if '&gt;' follows after method reference.
*/
private static boolean isAfterMethodReference(DetailAST genericEnd) {
return genericEnd.getParent().getParent().getType() == TokenTypes.METHOD_REF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,16 @@ private void visitEachToken(DetailAST node) {
/**
* Checks if characters in {@code line} at and around {@code columnNo} has
* the correct number of spaces. to return {@code true} the following
* conditions must be met:<br />
* - the character at {@code columnNo} is the first in the line.<br />
* - the character at {@code columnNo} is not separated by whitespaces from
* the previous non-whitespace character. <br />
* - the character at {@code columnNo} is separated by only one whitespace
* from the previous non-whitespace character.<br />
* - {@link #validateComments} is disabled and the previous text is the
* end of a block comment.
* conditions must be met:
* <ul>
* <li> the character at {@code columnNo} is the first in the line. </li>
* <li> the character at {@code columnNo} is not separated by whitespaces from
* the previous non-whitespace character. </li>
* <li> the character at {@code columnNo} is separated by only one whitespace
* from the previous non-whitespace character. </li>
* <li> {@link #validateComments} is disabled and the previous text is the
* end of a block comment. </li>
* </ul>
*
* @param line The line in the file to examine.
* @param columnNo The column position in the {@code line} to examine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,7 @@ private boolean isEmptyBlock(DetailAST ast, int parentType) {
/**
* Tests if a given {@code DetailAST} is part of an empty block.
* An example empty block might look like the following
* <p>
* <pre> public void myMethod(int val) {}</pre>
* </p>
* In the above, the method body is an empty block ("{}").
*
* @param ast the {@code DetailAST} to test.
Expand Down Expand Up @@ -964,9 +962,7 @@ private boolean isEmptyCatch(DetailAST ast, int parentType) {
/**
* Test if the given {@code DetailAST} is part of an empty block.
* An example empty block might look like the following
* <p>
* <pre> class Foo {}</pre>
* </p>
*
* @param ast ast the {@code DetailAST} to test.
* @return {@code true} if {@code ast} makes up part of an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ else if ("suppress-xpath".equals(qName)) {
/**
* Returns the suppress element, initialized from given attributes.
*
* @param attributes the attributes of xml-tag "<suppress></suppress>", specified inside
* suppression file.
* @param attributes the attributes of xml-tag "&lt;suppress&gt;&lt;/suppress&gt;",
* specified inside suppression file.
* @return the suppress element
* @throws SAXException if an error occurs.
*/
Expand Down Expand Up @@ -182,7 +182,7 @@ private static SuppressFilterElement getSuppressElement(Attributes attributes)
/**
* Returns the xpath filter, initialized from given attributes.
*
* @param attributes the attributes of xml-tag "<suppress-xpath></suppress-xpath>",
* @param attributes the attributes of xml-tag "&lt;suppress-xpath&gt;&lt;/suppress-xpath&gt;",
* specified inside suppression file.
* @return the xpath filter
* @throws SAXException if an error occurs.
Expand Down

0 comments on commit afdf3de

Please sign in to comment.