1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
import java.util.function.Consumer;
public class Bug578145LambdaInFieldDeclaration {
Runnable runnable = new Runnable() {
@Override
public void run() {
int numberInRunnable = 1;
Consumer<Integer> myConsumer = (lambdaArg) -> {
int numberInLambda = 10;
System.out.println("id = " + lambdaArg); // Add breakpoint here
};
myConsumer.accept(numberInRunnable);
}
};
public static void main(String[] args) {
Bug578145LambdaInFieldDeclaration instance = new Bug578145LambdaInFieldDeclaration();
instance.runnable.run();
}
}
|