Commit Graph

3680 Commits

Author SHA1 Message Date
aa6a652dc9 Create ASTRecordDeclaration#isSyntacticallyFinal 2022-01-05 11:15:09 +01:00
ee763ee3d7 Check records are not declare with final modifier 2022-01-04 17:24:24 +01:00
b792c14f4d [java] New rule: StaticNestedRecord
Add the rule to check that nested record are not declared with static modifier
2022-01-04 10:41:11 +01:00
1597ef3900 Bump log4j to 2.17.0 2021-12-20 10:07:03 +01:00
9c6591381d [java] UnusedPrivateMethod: Add test case for #3209 2021-12-17 09:52:58 +01:00
a72c9f66f5 Merge branch 'master' into pr-3683 2021-12-16 20:33:02 +01:00
2f95d99b35 [java] Improve symboltable for inner classes 2021-12-16 20:30:44 +01:00
76ccefa0f2 Bump log4j to 2.16.0
Update log4 to harden defaults.
 Based on CVE-2021-45046 the fix to address CVE-2021-44228 in Apache Log4j 2.15.0 was incomplete in certain non-default configurations.
for more details CVE-2021-45046 (https://nvd.nist.gov/vuln/detail/CVE-2021-45046)
2021-12-15 12:08:51 +01:00
ae04e0a4b5 Bump log4j2 from 2.13.3 to 2.15.0 2021-12-13 19:02:07 +01:00
8df5768bc9 Fixed 3468 unused private method call on inner class 2021-12-10 15:20:50 -06:00
8f68e3e1cb [java] MissingOverride - backport test case (#3675) 2021-12-03 20:31:02 +01:00
e801bb6525 [java] MethodNameDeclaration.isPrimitiveReturnType() - check for void 2021-12-03 15:59:21 +01:00
5fdceb514d Merge branch 'master' into 3492-usvo-fp-no-initial-string 2021-12-02 16:03:08 -06:00
6fb8fb57e7 Checked for method primitive return type 2021-12-02 15:52:30 -06:00
033e817ed6 [java] LooseCoupling - backport test case (#3672) 2021-12-02 16:56:24 +01:00
2d3e9d2f37 [java] Backport test cases (#3668, #3671) 2021-12-02 16:29:14 +01:00
e1387951bd [java] ClassWithOnlyPrivateConstructorsShouldBeFinal - add test case
from #3668
2021-12-01 12:33:55 +01:00
898331165f Merge pull request #3666 from adangel:close-resource-local-record
[java] Local records are a find boundary #3666

* pr-3666:
  [java] Local records are a find boundary
2021-12-01 09:36:14 +01:00
c9c7d05ac7 [java] UnusedLocalVariable - add test case from #3656 2021-12-01 09:05:41 +01:00
74aa2772bf [java] Local records are a find boundary
This fixes a ClassCastException in CloseResource
2021-11-30 16:29:13 +01:00
3a97618d5d [maven-release-plugin] prepare for next development iteration 2021-11-27 11:21:17 +01:00
ac68de1f51 [maven-release-plugin] prepare release pmd_releases/6.41.0 2021-11-27 11:21:12 +01:00
3f9805882f Merge pull request #3638 from
adangel:issue-3595-primitivewrapperinstantiation

[java] Fix PrimitiveWrapperInstantion false negative with new Boolean
#3638

* pr-3638:
  [java] Fix PrimitiveWrapperInstantion false negative with new Boolean
2021-11-26 09:11:27 +01:00
c6635b4942 Merge pull request #3621 from adangel:java-rule-improvements-3
[java] Rule improvements part 3 #3621

* pr-3621:
  [doc] Update release notes (#3620)
  [java] CheckSkipResult - use rulechain
  [java] AvoidUsingOctalValues - use rulechain
  [java] AvoidMultipleUnaryOperators - remove unnecessary super
  [java] SwitchDensity - use super.visit
  [java] SingularField - fix false negative with anonymous classes
2021-11-26 08:47:58 +01:00
af3c3fb9cb Merge pull request #3619 from adangel:java-rule-improvements-2
[java] Rule improvements part 2 #3619

* pr-3619:
  [java] MethodReturnsInternalArray - add test case (#3630)
  [doc] Update release notes (#3618)
  [java] ExceptionAsFlowControl - use rulechain
  [java] CouplingBetweenObjects - consider nested classes in interfaces
  [java] UnnecessaryReturn - use rulechain
  [java] UnnecessaryFullyQualifiedName - remove unnecessary super
  [java] UseCollectionIsEmpty - use rulechain
  [java] UnusedFormalParameter - fix false negative with anonymous
classes
  [java] MethodReturnsInternalArray - use rulechain
2021-11-26 08:46:28 +01:00
2d76292ae8 Merge pull requets #3615 from adangel:java-rule-improvements-1
[java] Rule improvements part 1 #3615

* pr-3615:
  [java] JUnitAssertionsShouldIncludeMessage false positive
  [java] Rewrite JUnitAssertionsShouldIncludeMessage to fix false
negatives
  [java] TestClassWithoutTestCases - add test for #3624
  [java] Rewrite TestClassWithoutTestCases to fix false positives
  [doc] Update release notes (#3613, #3614)
  [java] LooseCoupling - use rule chain
  [java] Refactor AbstractJUnitRule
  [java] JUnitTestsShouldIncludeAssert - support nested test classes
  [java] ArrayIsStoredDirectly - fix false negative with nested classes
  [java] AccessorMethodGeneration - use rulechain
2021-11-26 08:44:36 +01:00
d5df3bf573 Merge branch 'master' into pr-3600 2021-11-25 11:03:38 +01:00
1393e7d830 [java] UselessStringValueOf - skip String.valueOf with more than one arg 2021-11-18 17:48:44 +01:00
3374983be9 [java] Fix PrimitiveWrapperInstantion false negative with new Boolean
Fixes #3595
2021-11-18 12:10:35 +01:00
ce15c11b19 [java] JUnitAssertionsShouldIncludeMessage false positive 2021-11-15 19:45:02 +01:00
48714f8161 [java] MethodReturnsInternalArray - add test case (#3630) 2021-11-15 19:20:41 +01:00
d9b6eb45b9 [java] Rewrite JUnitAssertionsShouldIncludeMessage to fix false
negatives

Not extending AbstractJUnitRule anymore
2021-11-15 19:04:07 +01:00
956077f4d4 [java] TestClassWithoutTestCases - add test for #3624 2021-11-14 19:58:05 +01:00
b1a294f170 [java] Rewrite TestClassWithoutTestCases to fix false positives
Reusing visitors is a bad idea...
Providing new utility methods in AbstractJUnitRule.
2021-11-13 12:24:18 +01:00
9747f76f5c [java] CheckSkipResult - use rulechain
While there is no fixed false negative, this is more correct
and in PMD 7, rule chain is already used.
2021-11-13 11:29:21 +01:00
62dd4c89fd [java] AvoidUsingOctalValues - use rulechain
While there is no fixed false negative, this is more correct
and in PMD 7, rule chain is already used.
2021-11-13 11:26:40 +01:00
3957a8f46c [java] AvoidMultipleUnaryOperators - remove unnecessary super 2021-11-13 11:24:56 +01:00
008141cd92 [java] SwitchDensity - use super.visit
There are no fixed false negatives, but it looks more correct.
2021-11-13 11:21:33 +01:00
85f67d7e24 [java] SingularField - fix false negative with anonymous classes 2021-11-13 11:14:20 +01:00
7b4f26cd4d [java] ExceptionAsFlowControl - use rulechain
While there is no fixed false negative, this is more correct.
2021-11-13 10:04:51 +01:00
2128ce824a [java] CouplingBetweenObjects - consider nested classes in interfaces 2021-11-13 10:00:38 +01:00
a44491cbb8 [java] UnnecessaryReturn - use rulechain
While there is no fixed false negative, this is more correct
and in PMD 7, rule chain is already used.
2021-11-13 09:46:35 +01:00
ee580fc47a [java] UnnecessaryFullyQualifiedName - remove unnecessary super 2021-11-13 09:31:02 +01:00
e2bb172588 [java] UseCollectionIsEmpty - use rulechain
While there is no fixed false negative, this is more correct
and in PMD 7, rule chain is already used.
2021-11-13 09:26:09 +01:00
2d57e6755a Fixed issue 2021-11-12 16:46:36 -06:00
485c8d97b6 [java] UnusedFormalParameter - fix false negative with anonymous classes 2021-11-12 12:22:15 +01:00
5c4ff57874 [java] MethodReturnsInternalArray - use rulechain
Fixes a false negative when defining a class inside
a interface.
2021-11-12 12:04:06 +01:00
c344b8b389 [java] LooseCoupling - use rule chain
While there is no fixed false negative, this is more correct
and in PMD 7, rule chain is already used.
2021-11-12 11:39:24 +01:00
732a97048b [java] Refactor AbstractJUnitRule 2021-11-12 11:28:33 +01:00
d164f7d884 [java] JUnitTestsShouldIncludeAssert - support nested test classes 2021-11-12 10:35:01 +01:00