Merge branch 'pr-406'

This commit is contained in:
Juan Martín Sotuyo Dodero
2017-05-26 14:28:10 -03:00
3 changed files with 27 additions and 0 deletions

View File

@ -14,6 +14,11 @@ public class ASTLambdaExpression extends AbstractJavaAccessNode {
public ASTLambdaExpression(JavaParser p, int id) {
super(p, id);
}
@Override
public boolean isFindBoundary() {
return true;
}
/** Accept the visitor. **/
public Object jjtAccept(JavaParserVisitor visitor, Object data) {

View File

@ -105,6 +105,23 @@ public class Foo {
</test-code>
<test-code>
<description><![CDATA[
method in lambda expression is ok
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
public Foo(String s) {
addActionListener(() -> bar());
addActionListener(() -> { bar(); });
addActionListener((a) -> { bar(); });
addActionListener(this::bar);
}
public void bar() {}
}
]]></code>
</test-code>
<test-code>
<description><![CDATA[
bug report 975407
]]></description>
<expected-problems>0</expected-problems>

View File

@ -17,7 +17,12 @@ This is a minor release.
### Fixed Issues
* java-design
* [#397](https://github.com/pmd/pmd/issues/397): \[java] ConstructorCallsOverridableMethodRule: false positive for method called from lambda expression
### API Changes
### External Contributions
* [#406](https://github.com/pmd/pmd/pull/406): \[java] False positive with lambda in java-design/ConstructorCallsOverridableMethod