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

Correct NoEnumTrailingCheck and UnnessaryEnumSemicolonCheck to handle empty enums #9230

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

strkkk
Copy link
Member

@strkkk strkkk commented Feb 2, 2021

Fixes for #8653

NoEnumTrailingCheck is rewritten to handle empty enums with only comma as well (there was no violation before since it inspected ENUM_CONSTANT_DEF token instead of ENUM_DEF).
UnnessaryEnumSemicolonCheck test inputs were extended with enum with only comma.

@strkkk
Copy link
Member Author

strkkk commented Feb 2, 2021

@romani
Copy link
Member

romani commented Feb 13, 2021

@strkkk , please rebase and update PR title and description to define target of fix

strkkk added a commit to strkkk/checkstyle that referenced this pull request Feb 13, 2021
@strkkk strkkk changed the title Fix enum checks Correct NoEnumTrailingCheck and UnnessaryEnumSemicolonCheck to handle empty enums Feb 13, 2021
@strkkk
Copy link
Member Author

strkkk commented Feb 13, 2021

@romani done

@strkkk strkkk removed their assignment Feb 13, 2021
@strkkk strkkk requested a review from pbludov February 13, 2021 20:37
@@ -123,17 +124,16 @@

@Override
public int[] getRequiredTokens() {
return new int[] {TokenTypes.ENUM_CONSTANT_DEF};
return new int[] {TokenTypes.ENUM_DEF};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not breaking compatibility, such token is not adjustable by user so users are not affected

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items:

@strkkk strkkk assigned romani and unassigned pbludov Feb 14, 2021
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

@romani romani merged commit 7db94b0 into checkstyle:master Feb 14, 2021
@romani romani added the bug label Feb 14, 2021
@romani romani added this to the 8.41 milestone Feb 14, 2021
@strkkk strkkk deleted the fix_enum_checks branch February 15, 2021 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants