4226 Commits

Author SHA1 Message Date
Andreas Dangel
0edc22b877 Fix compilation errors 2020-07-24 11:42:18 +02:00
Andreas Dangel
024d411aee Merge branch 'pmd/7.0.x' into java-grammar 2020-07-24 11:25:44 +02:00
Andreas Dangel
cf6915bdcd Merge branch 'master' into pmd/7.0.x 2020-07-24 10:53:18 +02:00
Andreas Dangel
0738797738 Merge branch 'pr-2658'
[core][java] Deprecate pmd-core::lang.rule.ImportWrapper 
2020-07-24 09:47:32 +02:00
Andreas Dangel
e4b2c4ccbd Merge branch 'pr-2632'
[java] ArrayIsStoredDirectly false positive with private constructor/… 
2020-07-24 09:45:29 +02:00
Andreas Dangel
4444ef279d Merge branch 'pr-2631'
[java] NPathComplexity can't handle switch expressions 
2020-07-24 09:42:58 +02:00
Clément Fournier
3c68fab165 Fix compil 2020-07-23 17:41:13 +02:00
Clément Fournier
d1971c8c13 Merge branch '7.0.x' into java-grammar 2020-07-23 15:57:48 +02:00
Clément Fournier
49d0d2aebc Merge branch 'master' into 7.0.x 2020-07-23 15:55:13 +02:00
Clément Fournier
2fad9acfbd Merge branch 'master' into issue-2546 2020-07-23 15:52:30 +02:00
Clément Fournier
fce20e0b7c Merge branch 'master' into issue-2181 2020-07-23 15:49:54 +02:00
Clément Fournier
6a9a834c67 Same for NPath 2020-07-23 14:51:26 +02:00
Clément Fournier
9a47d658e6 Handle switch exprs properly 2020-07-23 14:42:29 +02:00
Clément Fournier
fbeaa5bc74 Merge branch 'master' into issue-2625 2020-07-23 14:26:33 +02:00
Clément Fournier
d239987d26 Merge branch 'master' into issue-2615 2020-07-23 14:15:47 +02:00
Andreas Dangel
62666213ba Deprecate pmd-core::lang.rule.ImportWrapper 2020-07-23 11:15:03 +02:00
Andreas Dangel
5c1a11c0b4 Merge branch 'pr-2652'
[java] UseCollectionIsEmpty can not detect the case this.foo.size() 
2020-07-23 10:47:02 +02:00
Andreas Dangel
6b44e326ce [java] UseCollectionIsEmpty: improve test cases 2020-07-23 10:44:22 +02:00
Andreas Dangel
ed77b3dc46 Merge branch 'pr-2651'
[java] False negative: LiteralsFirstInComparisons for methods... (2569) 
2020-07-23 10:15:09 +02:00
Andreas Dangel
66d243efa1 [java] LiteralsFirstInComparison: additional test case 2020-07-23 10:10:26 +02:00
Andreas Dangel
7941d8d610 Merge branch 'master' into issue-2625 2020-07-23 09:57:57 +02:00
Andreas Dangel
677bfd4ae4 [java] Added additional test case for CycloMetric
And fixed comments in test cases

Refs 
2020-07-23 09:46:50 +02:00
Mykhailo Palahuta
c351314f30 LiteralsFirstInComparisonsRule: ignore two string literals comparison 2020-07-22 13:46:08 +03:00
Andreas Dangel
d03640b25e Merge branch 'pr-2641'
[java] AvoidThrowingNullPointerException marks all NullPointerException… 
2020-07-21 19:57:29 +02:00
Mykhailo Palahuta
892b16c805 AvoidThrowingNullPointerException: isNullPointerException usage fix 2020-07-21 15:56:44 +03:00
Mykhailo Palahuta
68f90687af AvoidThrowingNullPointerException: NPE instances tracking fix 2020-07-21 14:54:23 +03:00
Clément Fournier
2e9f5ad897 Merge branch 'master' into issue-2615 2020-07-20 16:36:16 +02:00
Clément Fournier
74a1cf520e Touchups 2020-07-19 20:53:00 +02:00
Clément Fournier
993e933cc4 Merge branch '7.0.x' into java-grammar 2020-07-19 20:38:56 +02:00
Andreas Dangel
df44de6366 Fix unit tests (wrong merge) 2020-07-19 20:16:30 +02:00
Andreas Dangel
15925bcc9e Fix compile errors, update to new visitor 2020-07-19 20:06:44 +02:00
Clément Fournier
545aa3388d Merge branch 'master' into 7.0.x 2020-07-19 20:00:29 +02:00
Andreas Dangel
9bb5f375e3 Merge branch 'pmd/7.0.x' into java-grammar 2020-07-19 19:39:45 +02:00
Andreas Dangel
6c3f8c4bfb Merge branch 'pr-2601' into java-grammar
[java] Rewrite symbol table 
2020-07-19 18:46:02 +02:00
Andreas Dangel
a9996ab45c Merge branch 'pr-2589' into pmd/7.0.x
[core] Add generic visitor interface in pmd-core 
2020-07-19 18:07:55 +02:00
Clément Fournier
a3d0ebc766 Checkstyle 2020-07-18 16:39:40 +02:00
Clément Fournier
5857ff2b5f Fix eclipse compile errors (refs )
- Bug with captured tvar inference in IteratorBasedNStream
  -> replaced by lambda

- Bug with improperly resolved nested type, around the antlr classes
  -> fixed by qualifying the types. This is a scoping bug of the eclipse
  compiler.

- Bug with `Node::children` not being resolved to the overridden variant
for `GenericNode<DummyNode>`, in tests using DummyRoot
  -> a bug in the eclipse compiler. Problem looks like, this declaration
of DummyRoot is not handled correctly:

```java
class DummyRoot extends DummyNode implements RootNode {}
```

  -> DummyNode implements GenericNode<DummyNode> transitively,
so inherits the refined version `NodeStream<? extends DummyNode> GenericNode<DummyNode>::children()`.
  -> But RootNode extends Node directly, and eclipse sees that
its type for the inherited `children` method is `NodeStream<? extends Node> Node::children();`
  -> A java compiler should prove that the method inherited from Node
through DummyRoot is overridden by the one inherited from GenericNode
through DummyNode
  -> A workaround is to respecify that DummyRoot implements
`GenericNode<DummyNode>` explicitly:

```java
class DummyRoot extends DummyNode implements GenericNode<DummyNode>, RootNode {}
```

- Same thing with JavaNode, still because of RootNode (and AccessNode,
which incorrectly extended Node instead of JavaNode)
2020-07-18 16:33:31 +02:00
Andreas Dangel
25405eb870 Merge branch 'pr-2643'
[java] AvoidCallingFinalize detects some false positives (2578) 
2020-07-17 20:30:01 +02:00
Andreas Dangel
db21d589d4 [java] AvoidCallingFinalizeRule - use rulechain
And improve tests
2020-07-17 20:28:55 +02:00
Andreas Dangel
585b9099ca Merge branch 'pr-2640'
[java] NullPointerException in rule ProperCloneImplementation 
2020-07-17 19:47:30 +02:00
Andreas Dangel
a01729db7a Fix compilation 2020-07-17 17:28:14 +02:00
Andreas Dangel
c7d884c629 Merge branch 'pmd/7.0.x' into java-grammar 2020-07-17 16:38:12 +02:00
Andreas Dangel
dcaa8a1167 Merge branch 'master' into pmd/7.0.x 2020-07-17 16:13:02 +02:00
Mykhailo Palahuta
74fb7ba1fb [java] UseCollectionIsEmpty can not detect the case this.foo.size() (2543) 2020-07-17 16:30:37 +03:00
Andreas Dangel
7b3d31246e Merge branch 'master' into pr-2624 2020-07-17 15:16:24 +02:00
Andreas Dangel
7ae424a35b Add deprecation javadocs 2020-07-17 14:43:43 +02:00
Andreas Dangel
e24a26e211 Merge branch 'pr-2629'
[all] Dependencies cleanup 
2020-07-17 12:07:03 +02:00
Andreas Dangel
94afdb117d Add test engines as surefire plugin dependencies
This removes junit-vintage-engine as a test dependency
as well as kotlintest-runner-junit5.
The engines are only needed during test execution, but should
not be available for test compilation.

For this to work, the latest surefire plugin is required.
2020-07-17 12:03:45 +02:00
Mykhailo Palahuta
01e48c882b AvoidCallingFinalize: expected lines added to test 2020-07-17 11:05:55 +03:00
Andreas Dangel
9887d5a387 Merge branch 'pr-2618'
[java] New rule: UnusedAssignment 
2020-07-16 19:56:22 +02:00