File: Bug578145LambdaInFieldDeclaration.java

package info (click to toggle)
eclipse-jdt-debug 4.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,876 kB
  • sloc: java: 234,390; xml: 6,367; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (3)
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();
	}
}