Clément Fournier
71bbbfdffb
Ignore exceptions that are named "ignored"
2021-05-11 21:43:37 +02:00
Clément Fournier
0f00865c59
Allow PrivilegedActionException#getCause
2021-05-11 20:37:21 +02:00
Clément Fournier
88b0cda3b3
Rule doc and messages
2021-05-11 17:58:09 +02:00
Clément Fournier
b04730684d
Support conditional expr
2021-05-11 17:40:44 +02:00
Clément Fournier
6e4fda8f5b
Fix stackoverflow in some cases
2021-05-11 17:22:26 +02:00
Clément Fournier
13319f4471
More tests
2021-05-11 16:23:13 +02:00
Clément Fournier
513841e374
Constraint dataflow to be single-assignment
...
This will avoid some FPs at the cost of some FNs.
The rule doesn't handle branches in control flow or loops.
2021-05-11 15:19:06 +02:00
Clément Fournier
7b693aae1a
Ignore new Exception(new Problem(originalException))
...
These are cases where the exception is consumed by the constructor
transitively.
Since we're processing everything recursively now we're effectively
exploring the dataflow graph... only in an indirect way, without respect
for ordering of statements... This can be improved later, and ideally
generalized to help other rules.
2021-05-11 15:14:29 +02:00
Clément Fournier
8bba9b070b
Ignore InvocationTargetException#getTargetException
2021-05-11 15:04:28 +02:00
Clément Fournier
51b491ca7a
add some test cases for future
2021-05-11 14:57:29 +02:00
Clément Fournier
2bcf279dab
Check that #2134 is fixed
2021-05-09 19:28:09 +02:00
Clément Fournier
e932177730
Fix FNs with PreserveStackTrace rule
2021-05-09 19:25:48 +02:00
Clément Fournier
1fc3e9868d
Fix unresolved references in tests
2021-05-09 18:17:07 +02:00
Clément Fournier
f9448ffcb7
Merge branch '7.0.x' into update-PreserveStackTrace
2021-05-09 17:54:31 +02:00
Andreas Dangel
baf929f178
Merge branch 'master' into pmd/7.0.x
2021-05-08 20:34:49 +02:00
Andreas Dangel
8208dc9cd6
Merge pull request #3259 from
...
oowekyala:issue2737-doc-SwitchStmtsShouldHaveDefault
[java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault
with non-exhaustive enum switch
2021-05-08 19:51:44 +02:00
Andreas Dangel
c757369268
Merge pull request #3257 from
...
oowekyala:issue3248-doc-SingletonClassReturningNewInstance
[java] Fix #3248 - doc of SingletonClassReturningNewInstance
2021-05-08 19:33:06 +02:00
Andreas Dangel
96e9b46b81
Merge pull request #3256 from oowekyala:issue3236-literalsFirstInComparison-and-constants
...
[java] Fix LiteralsFirstInComparison ignoring constants
2021-05-08 19:28:00 +02:00
Andreas Dangel
3f11c5b4de
Merge branch 'master' into pr-3237
2021-05-08 18:54:31 +02:00
Clément Fournier
00a087774a
Fix tests of LocalVariableCouldBeFinal
...
The rule ignores unused variables since 7.0.0
Refs #3266
2021-05-07 13:00:41 +02:00
Clément Fournier
63e06eb005
Remove unresolved reference
2021-05-07 12:57:37 +02:00
Clément Fournier
a8716a13f9
Merge branch 'master' into 7.0.x
2021-05-07 12:39:00 +02:00
Clément Fournier
abc86702a2
Merge branch 'master' into pr/3262
2021-05-07 12:31:35 +02:00
Clément Fournier
a99dfdb41b
Merge branch 'pr/3265'
2021-05-07 12:12:22 +02:00
Andreas Dangel
db244b0e3b
[doc] Update release notes, refs #3266
2021-05-06 15:49:29 +02:00
Andreas Dangel
68c2b9954e
[java] LocalVariableCouldBeFinal - fix FN with interfaces, anon classes
2021-05-06 15:44:33 +02:00
Andreas Dangel
d3c1dbeb47
[doc] Update release notes, refs #3265
2021-05-06 15:40:47 +02:00
Andreas Dangel
150fec0f6f
[java] AvoidReassigningLoopVariables - add more test cases
2021-05-06 15:32:09 +02:00
Andreas Dangel
d48cee2258
[java] MethodArgumentCouldBeFinal - fix FN with interfaces
2021-05-06 15:31:43 +02:00
Andreas Dangel
ea35221739
[java] FieldDeclarationsShouldBeAtStartOfClass - FN with anon classes
2021-05-06 14:51:31 +02:00
Clément Fournier
6c9ae9b837
Typo
2021-05-06 14:08:39 +02:00
Clément Fournier
223b4e6efe
Improve doc of SwitchStmtsShouldHaveDefault, fix #2737
2021-05-06 14:06:28 +02:00
Clément Fournier
6beefe5580
Fix #3248 - doc of SingletonClassReturningNewInstance
2021-05-06 13:45:55 +02:00
Clément Fournier
7d150523c3
Remove catch NPE
2021-05-06 13:37:54 +02:00
Clément Fournier
4c81293163
Fix #3236
2021-05-06 13:29:33 +02:00
Clément Fournier
9274af1e8e
Merge branch 'master' into 7.0.x
2021-05-06 12:52:34 +02:00
Clément Fournier
d8ce0227ee
Doc
2021-05-05 14:55:46 +02:00
Clément Fournier
2ec8ced391
Test method erasure
2021-05-05 14:39:34 +02:00
Clément Fournier
9edc586bd3
Doc
2021-05-05 14:29:29 +02:00
Clément Fournier
987629160f
Improve TypePrettyPrint tests
2021-05-05 14:24:12 +02:00
Clément Fournier
f5534e47d9
Add unit test for TypeSystem
2021-05-05 14:10:30 +02:00
Clément Fournier
670ec9a7ef
Fix bug with method refs erasure of getClass return
2021-05-02 11:47:41 +02:00
Clément Fournier
7e1428e748
Use shouldHaveType more consistently
2021-05-02 11:08:38 +02:00
Clément Fournier
4df0290fc4
Test string contexts
2021-04-29 12:49:02 +02:00
Clément Fournier
3723e5b05f
More tests for arithmetic casts
2021-04-29 12:19:44 +02:00
Andreas Dangel
6e750bf927
[java] UnnecessaryImport false positive for on-demand imports
...
Fixes #2655
2021-04-29 11:35:15 +02:00
Clément Fournier
be65070281
Casts in arithmetic smaller than int
2021-04-29 00:27:09 +02:00
Clément Fournier
9bbe60f269
Casts in ternary condition
2021-04-29 00:13:24 +02:00
Clément Fournier
46f7c77507
Fix nopmd comment
2021-04-28 15:24:48 +02:00
Clément Fournier
eb89176ff8
[java] Enhance CompareObjectsWithEquals with list of exceptions #3110
2021-04-27 23:08:40 +02:00