-
Notifications
You must be signed in to change notification settings - Fork 714
SONARJAVA-4960 False positive for S1854 #5378
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
base: master
Are you sure you want to change the base?
Conversation
19d09dc to
947f918
Compare
|
This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically |
|
| } | ||
|
|
||
| @Test | ||
| void test_fp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test name should be more precise.
|
|
||
| @Override | ||
| public Type[] getIntersectionTypes() { | ||
| return new Type[] { this }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid reformatting unrelated code.
| } | ||
|
|
||
| static class EnhancedSwitch { | ||
| // private enum DocumentStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is commented out, so that the parser does not generate semantics, right? Could you please add a comment about it?
| // } | ||
|
|
||
| public String doSomething(AClass.BClass<String> instance) { | ||
| String c = "Hi"; // Rule S1854 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the place where we had FP, right? We typically use // Compliant comment in such case. Could you please add this in all places where FPs where happening before the change.
| assertThat(unknownSymbol.isPackageSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isTypeSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isVariableSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isMethodSymbol()).isFalse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't read this carefully, but I'm wondering why this is removed instead of reverting the condition.




Uh oh!
There was an error while loading. Please reload this page.