Skip to content

Commit

Permalink
Issue #13061: Update grammar for exception, throws, and param tags
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbakry committed Apr 18, 2024
1 parent b1498c3 commit 582f327
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Expand Up @@ -1141,12 +1141,13 @@ javadocTag: AUTHOR_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| DEPRECATED_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| EXCEPTION_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ CLASS_NAME
| EXCEPTION_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ (CLASS_NAME)?
(WS | NEWLINE)* ((WS | NEWLINE) description)?

| PARAM_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ PARAMETER_NAME
| PARAM_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ (PARAMETER_NAME)?
(WS | NEWLINE)* ((WS | NEWLINE) description)?


| RETURN_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| SEE_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+
Expand All @@ -1162,7 +1163,7 @@ javadocTag: AUTHOR_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| SINCE_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?

| THROWS_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ CLASS_NAME
| THROWS_LITERAL (WS | NEWLINE | {!isNextJavadocTag()}? LEADING_ASTERISK)+ (CLASS_NAME)?
(WS | NEWLINE)* ((WS | NEWLINE) description)?

| VERSION_LITERAL (WS | NEWLINE)* ((WS | NEWLINE) description)?
Expand Down
Expand Up @@ -98,6 +98,8 @@ public void testCheckTwo() throws Exception {
"60: " + getCheckMessage(MSG_KEY),
"75: " + getCheckMessage(MSG_KEY),
"77: " + getCheckMessage(MSG_KEY),
"88: " + getCheckMessage(MSG_KEY),
"98: " + getCheckMessage(MSG_KEY),
};
verifyWithInlineConfigParser(getPath("InputNonEmptyAtclauseDescriptionTwo.java"), expected);
}
Expand Down
Expand Up @@ -83,4 +83,24 @@ public int foo7() throws Exception
return 1;
}

/**
*
* @param
*
*/ // violation 2 lines above, both parameter name
// and its description must be provided
public int foo8(int a)
{
return 1;
}

/**
* @throws
*/ // violation above, both class name and its
// description must be provided
public int foo9(String a) throws Exception
{
return 1;
}

}

0 comments on commit 582f327

Please sign in to comment.