Skip to content

Commit

Permalink
Issue checkstyle#16005: html-element to be ended with dot in javadoc's
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitsatr committed Feb 23, 2025
1 parent 2edcf45 commit 083aec7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,10 @@ javadocTag: AUTHOR_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?
| RETURN_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| SEE_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+
(reference | STRING | htmlElement) (WS | NEWLINE)* ((WS | NEWLINE) description)?
(
htmlElement (WS | NEWLINE)* description?
| (reference | STRING) (WS | NEWLINE)* ((WS | NEWLINE) description)?
)

| SERIAL_LITERAL (WS | NEWLINE)*
((WS | NEWLINE) description | LITERAL_INCLUDE | LITERAL_EXCLUDE)? (WS | NEWLINE)*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,11 @@ public void testDecoderOnMalformedInput() throws Exception {
verify(checkerConfig,
getPath("InputNonEmptyAtclauseDescriptionDifferentCharset.java"), expected);
}

@Test
public void testExample3() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputNonEmptyAtclauseDescriptionThree.java"), expected);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*xml
<module name="Checker">
<module name="TreeWalker">
<module name="NonEmptyAtclauseDescription">
<property name="javadocTokens" value="PARAM_LITERAL,THROWS_LITERAL"/>
</module>
</module>
</module>
*/
package com.puppycrawl.tools.checkstyle.checks.javadoc.nonemptyatclausedescription;

// xdoc section -- start
class InputNonEmptyAtclauseDescriptionThree {

/**
* Some summary.
*
* @param j some param
* @see <a href="www.checkstyle.org/">website</a>some description
*/
public int endwithDot(int j){
return j+1;
}

/**
* Some summary.
*
* @param j some param
* @see <a href="https://docs.oracle.com/">
* keyPairGenerator Algorithms</a>there is some description.
*/
public int testMethod(int j){
return j-1;
}

/**
* Some summary.
*
* @param j some param
* @see description
*/
public int testMethod2(int j){
return j-1;
}
}
// xdoc section -- end

0 comments on commit 083aec7

Please sign in to comment.