-
Notifications
You must be signed in to change notification settings - Fork 719
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 |
java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java
Outdated
Show resolved
Hide resolved
...-checks-test-sources/default/src/main/files/non-compiling/checks/UnusedVariablesFPCheck.java
Show resolved
Hide resolved
...-checks-test-sources/default/src/main/files/non-compiling/checks/UnusedVariablesFPCheck.java
Outdated
Show resolved
Hide resolved
|
|
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 |
java-checks/src/test/java/org/sonar/java/checks/DeadStoreCheckTest.java
Outdated
Show resolved
Hide resolved
eb0e8ef to
b23c2de
Compare
|
Addressed both issues in d78ed6b |
|
|
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 |
|
Is this ready for re-review? |
Yes it is |
tomasz-tylenda-sonarsource
left a comment
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 use dogfooding on peachee to test this PR. If you haven't used it before, it's a good thing to learn. We can talk about it offline.
| assertThat(unknownSymbol.isTypeSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isVariableSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isMethodSymbol()).isFalse(); | ||
| assertThat(unknownSymbol.isMethodSymbol()).isEqualTo(unknownSymbol instanceof Symbols.UnknownMethodSymbol); |
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.
We should not have logic in tests. Each test that calls assertCommonProperties should have an assertion with a constant, either true or false. After all, if this property changes, it is not a common property.
Reference: https://testing.googleblog.com/2014/07/testing-on-toilet-dont-put-logic-in.html




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