Issue #2904: fixed bad code in InputInnerAssignmentLambdaExpressions
This commit is contained in:
parent
ec20c822a1
commit
b16231d7b1
|
|
@ -1,10 +1,11 @@
|
|||
//Compilable with Java8
|
||||
package com.puppycrawl.tools.checkstyle.checks.coding;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class InputInnerAssignmentLambdaExpressions {
|
||||
interface MyLambda {
|
||||
boolean e(Object e);
|
||||
void e(Object e);
|
||||
}
|
||||
private static class MyButton {
|
||||
public void setOnAction(MyLambda my) {
|
||||
|
|
@ -12,8 +13,6 @@ public class InputInnerAssignmentLambdaExpressions {
|
|||
}
|
||||
private void setAction() {
|
||||
MyButton button = new MyButton();
|
||||
boolean pressed = false;
|
||||
button.setOnAction(e -> pressed = true); //No violation here
|
||||
button.setOnAction(e -> { pressed = true; }); //No violation here
|
||||
button.setOnAction(e -> { boolean pressed = true; }); //No violation here
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue