-
Notifications
You must be signed in to change notification settings - Fork 727
SONARJAVA-6406 Create rule S8714 - Use assertThrows/assertDoesNotThrow instead of try-catch with fail() #5642
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
Open
rombirli
wants to merge
29
commits into
master
Choose a base branch
from
rombiri/sonarjava-6406-create-rule-S8714
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+776
−32
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d70283d
Add rule S8714 metadata
rombirli 9a85344
Reproducer
rombirli 9a9472d
Initial implementation
rombirli ce2d0e0
Initial implementation
rombirli f2509b7
Initial implementation
rombirli 44eb21a
Improve sample (more reproducers)
rombirli 967e985
Fix QG: issue import explicitly
rombirli 21d25ec
Fix wrong message if fail is in try block
rombirli fc94bcf
Update metadata
rombirli 281facd
Fix ruling/plugin?
rombirli 0cb3ee1
Fix ruling/autoscan?
rombirli 5cbed86
Fix ruling/autoscan?
rombirli 3c0d660
Fix ruling/autoscan?
rombirli 450d83a
add s8714.json for ruling tests
rombirli 9cb685a
try to fix : autoscan
rombirli d853a9e
try to fix : ruling
rombirli 61f1092
try to fix : ruling
rombirli 8ec908d
try to fix : ruling
rombirli 15c3acf
try to fix : ruling
rombirli 6f6d306
Fix : Misleading comment says 'non-compliant' for compliant code
rombirli 7deeaf2
Revert useless changes
rombirli dc100b9
Change issue location (whole try catch)
rombirli f2d37f0
Change issue location again (report on fail())
rombirli 1878d4c
Remove unused import
rombirli 5014a34
Revert import java.util with wildcard
rombirli 7496d39
Fix ruling eclipse-jetty-similar-to-main S8714 json
rombirli f743366
Make S8714 junit version aware (only 5+)
rombirli 9adff21
Fix QG
rombirli 1e76072
Address Gitar's review
rombirli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
its/autoscan/src/test/resources/autoscan/diffs/diff_S1874.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "ruleKey": "S1874", | ||
| "hasTruePositives": true, | ||
| "falseNegatives": 245, | ||
| "falseNegatives": 246, | ||
| "falsePositives": 0 | ||
| } | ||
| } |
4 changes: 2 additions & 2 deletions
4
its/autoscan/src/test/resources/autoscan/diffs/diff_S5960.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "ruleKey": "S5960", | ||
| "hasTruePositives": false, | ||
| "falseNegatives": 3, | ||
| "falseNegatives": 4, | ||
| "falsePositives": 0 | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
its/autoscan/src/test/resources/autoscan/diffs/diff_S8714.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "ruleKey": "S8714", | ||
| "hasTruePositives": false, | ||
| "falseNegatives": 33, | ||
| "falsePositives": 0 | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
its/ruling/src/test/resources/eclipse-jetty-similar-to-main/java-S8714.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java": [ | ||
| 107 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java": [ | ||
| 72, | ||
| 126 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecTest.java": [ | ||
| 37 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java": [ | ||
| 90, | ||
| 206, | ||
| 297 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartFormInputStreamTest.java": [ | ||
| 945 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java": [ | ||
| 134, | ||
| 251 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java": [ | ||
| 102, | ||
| 692 | ||
| ] | ||
| } |
47 changes: 47 additions & 0 deletions
47
its/ruling/src/test/resources/eclipse-jetty/java-S8714.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/HttpURITest.java": [ | ||
| 107 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/SyntaxTest.java": [ | ||
| 72, | ||
| 126 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/ServletPathSpecTest.java": [ | ||
| 37 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java": [ | ||
| 90, | ||
| 206, | ||
| 297 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartFormInputStreamTest.java": [ | ||
| 945 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java": [ | ||
| 134, | ||
| 251 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java": [ | ||
| 102, | ||
| 692 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java": [ | ||
| 1255, | ||
| 1263 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-server/src/test/java/org/eclipse/jetty/server/StopTest.java": [ | ||
| 497 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/BlockingArrayQueueTest.java": [ | ||
| 192 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/SharedBlockingCallbackTest.java": [ | ||
| 116, | ||
| 161, | ||
| 235 | ||
| ], | ||
| "org.eclipse.jetty:jetty-project:jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java": [ | ||
| 59, | ||
| 81 | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.