-
Notifications
You must be signed in to change notification settings - Fork 692
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
SONARJAVA-5232 S1192 Relax duplicate string check for Throwable arguments #5036
base: master
Are you sure you want to change the base?
SONARJAVA-5232 S1192 Relax duplicate string check for Throwable arguments #5036
Conversation
|
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 |
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 looks good overall but before merging, it would make sense to:
- Document the last suggested case with exceptions constructed and then thrown
- Squash the PR into a single commit
- Rewrite the commit message to be very explicit in the fact that this change is a relaxation of the existing rule
java-checks-test-sources/default/src/main/java/checks/StringLiteralDuplicatedCheckSample.java
Show resolved
Hide resolved
This change addresses false positives reported on SonarCloud. Throwable arguments are intended for human readability, making constant extraction unnecessary. Therefore, we no longer report duplication in these cases. This change also accounts for corner cases where a string used in a Throwable has an existing constant or is also used in another context.
c74a3fe
to
a60893c
Compare
|
Done. |
SONARJAVA-5232
Previously #4984 and #5006