Branch: refs/heads/pmd/7.0.x
  Home:   https://github.com/pmd/pmd
  Commit: 5857ff2b5f7a8ee16c115f6ab8f6544059b0e203
      https://github.com/pmd/pmd/commit/5857ff2b5f7a8ee16c115f6ab8f6544059b0e203
  Author: Clément Fournier <[email protected]>
  Date:   2020-07-18 (Sat, 18 Jul 2020)

  Changed paths:
    M 
pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/BaseAntlrInnerNode.java
    M 
pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/BaseAntlrTerminalNode.java
    M 
pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/internal/IteratorBasedNStream.java
    M pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyNode.java
    M pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyRoot.java
    M 
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java
    M pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AccessNode.java
    M pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaNode.java

  Log Message:
  -----------
  Fix eclipse compile errors (refs #2611)

- 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)




_______________________________________________
Pmd-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmd-commits

Reply via email to