Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #13061: Update grammar for @exception, @throws, and @param tags #14803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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),
"97: " + getCheckMessage(MSG_KEY),
};
verifyWithInlineConfigParser(getPath("InputNonEmptyAtclauseDescriptionTwo.java"), expected);
}
Expand Down
Expand Up @@ -18,11 +18,11 @@ public class InputNonEmptyAtclauseDescriptionTwo
* @param c
* @deprecated
* @throws Exception
*/ // violation 5 lines above
// violation 5 lines above
// violation 5 lines above
// violation 5 lines above
// violation 5 lines above
*/ // violation 5 lines above 'At-clause should have a non-empty description'
// violation 5 lines above 'At-clause should have a non-empty description'
// violation 5 lines above 'At-clause should have a non-empty description'
// violation 5 lines above 'At-clause should have a non-empty description'
// violation 5 lines above 'At-clause should have a non-empty description'
public int foo4(String a, int b, double c) throws Exception
{
return 1;
Expand All @@ -49,7 +49,7 @@ public int foo5(String a, int b, double c) throws Exception
* @param c Some javadoc
* @return Some javadoc
* @exception Exception
*/ // violation above
*/ // violation above 'At-clause should have a non-empty description'
public int foo6(String a, int b, double c) throws Exception
{
return 1;
Expand All @@ -58,7 +58,7 @@ public int foo6(String a, int b, double c) throws Exception
/**
* @param a xxx
* @return
*/ // violation above
*/ // violation above 'At-clause should have a non-empty description'
int foo(int a) {
return a;
}
Expand All @@ -76,11 +76,28 @@ int bar() {
*
* @throws Exception
*
*/ // violation 4 lines above
// violation 3 lines above
*/ // violation 4 lines above 'At-clause should have a non-empty description'
// violation 3 lines above 'At-clause should have a non-empty description'
public int foo7() throws Exception
{
return 1;
}

/**
*
* @param
*
*/ // violation 2 lines above 'At-clause should have a non-empty description'
public int foo8(int a)
{
return 1;
}

/**
* @throws
*/ // violation above 'At-clause should have a non-empty description'
public int foo9(String a) throws Exception
{
return 1;
}
}