-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARJAVA-4520 Rule S3655: False Positive with JUnit assertions (#4769)
- Loading branch information
1 parent
92f27d6
commit 12b7ef1
Showing
8 changed files
with
442 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
4 changes: 2 additions & 2 deletions
4
its/autoscan/src/test/resources/autoscan/diffs/diff_S3655.json
This file contains 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": "S3655", | ||
"hasTruePositives": true, | ||
"falseNegatives": 0, | ||
"falseNegatives": 8, | ||
"falsePositives": 0 | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
its/autoscan/src/test/resources/autoscan/diffs/diff_S5960.json
This file contains 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 | ||
} | ||
} |
This file contains 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
This file contains 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
112 changes: 112 additions & 0 deletions
112
java-symbolic-execution/src/main/resources/org/sonar/java/se/xproc/org.junit.json
This file contains 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,112 @@ | ||
[ | ||
{ | ||
"signature": "org.junit.Assert#assertTrue(Z)V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
["TRUE"] | ||
], | ||
"resultIndex": -1, | ||
"resultConstraint": null | ||
}, | ||
{ | ||
"parametersConstraints": [ | ||
["FALSE"] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
}, | ||
{ | ||
"signature": "org.junit.Assert#assertTrue(Ljava/lang/String;Z)V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
[], | ||
["TRUE"] | ||
], | ||
"resultIndex": -1, | ||
"resultConstraint": null | ||
}, | ||
{ | ||
"parametersConstraints": [ | ||
[], | ||
["FALSE"] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
}, | ||
{ | ||
"signature": "org.junit.Assert#assertFalse(Z)V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
["FALSE"] | ||
], | ||
"resultIndex": -1, | ||
"resultConstraint": null | ||
}, | ||
{ | ||
"parametersConstraints": [ | ||
["TRUE"] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
}, | ||
{ | ||
"signature": "org.junit.Assert#assertFalse(Ljava/lang/String;Z)V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
[], | ||
["FALSE"] | ||
], | ||
"resultIndex": -1, | ||
"resultConstraint": null | ||
}, | ||
{ | ||
"parametersConstraints": [ | ||
[], | ||
["TRUE"] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
}, | ||
{ | ||
"signature": "org.junit.Assert#fail()V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
[] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
}, | ||
{ | ||
"signature": "org.junit.Assert#fail(Ljava/lang/String;)V", | ||
"varArgs": false, | ||
"declaredExceptions": [], | ||
"yields": [ | ||
{ | ||
"parametersConstraints": [ | ||
[] | ||
], | ||
"exception": ["java.lang.AssertionError"] | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.