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 #12443: Fix null pointer exception on config value with trailin… #12444

Merged
merged 1 commit into from Nov 26, 2022

Conversation

nrmancuso
Copy link
Member

closes #12443

@nrmancuso nrmancuso self-assigned this Nov 23, 2022
@nrmancuso nrmancuso force-pushed the issue-12443 branch 2 times, most recently from 345dbfb to bc9e972 Compare November 23, 2022 05:18
@nrmancuso nrmancuso assigned Vyom-Yadav and unassigned nrmancuso Nov 23, 2022
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
Copy link
Member

romani commented Nov 23, 2022

Should be merged before Sunday, to release this fix sooner

Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

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

#12443 (comment)
I am seeing 3 trims removed, but only 2 fixes here.

@nrmancuso
Copy link
Member Author

Third trim does not need to be replaced, trim is called on argument in method.

public static AccessModifierOption getInstance(String modifierName) {
return valueOf(AccessModifierOption.class, modifierName.trim().toUpperCase(Locale.ENGLISH));
}

@rnveach
Copy link
Member

rnveach commented Nov 23, 2022

Third trim does not need to be replaced, trim is called on argument in method.

Do we have a similar test to show it is not needed?

@nrmancuso
Copy link
Member Author

nrmancuso commented Nov 23, 2022

This is where the other trim was located: 3080013#r90853229

Which calls

public static AccessModifierOption getInstance(String modifierName) {
return valueOf(AccessModifierOption.class, modifierName.trim().toUpperCase(Locale.ENGLISH));
}

I can add another tab in config like this: public\t,\t, this will cause an unnecessary suppression since this is the test case at #12340

@nrmancuso nrmancuso force-pushed the issue-12443 branch 2 times, most recently from 96b89f6 to 849d41b Compare November 23, 2022 22:05
@nrmancuso nrmancuso assigned rnveach and unassigned Vyom-Yadav Nov 24, 2022
@nrmancuso
Copy link
Member Author

@rnveach test case is added

Copy link
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

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

One minor, rest LGTM :)

@rnveach
Copy link
Member

rnveach commented Nov 24, 2022

I can add another tab in config like this: public\t,\t, this will cause an unnecessary suppression since this is the test case at #12340

There is no test case like this in the other PR.

@nrmancuso
Copy link
Member Author

nrmancuso commented Nov 24, 2022

Linking discussion here: #12340 (comment)

Exaplanation from link above:

In other PR, we had public, \t, case taken from this PR is with tab character "on" the access modifier. The first trim in both methods took care of the single \t, the second trim takes care of the \t "on" the access modifier.

@romani romani merged commit 7855254 into checkstyle:master Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

checkstyle 10.3.3 and newer throws NullPointerException on annotated generic types from IllegalType rule
4 participants