File: TestInlineLambda.java

package info (click to toggle)
eclipse-jdt-ui 4.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 93,280 kB
  • sloc: java: 831,977; xml: 14,578; jsp: 33; makefile: 5
file content (56 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// 5, 28 -> 5, 30  replaceAll = true, removeDeclaration = true
package p;

class TestInlineLambda {
	static { 
		FI a = x -> x++;	// [1]	
		FI b;
		b = x -> x++;		// [2]		
	}
	
	private FI fun1() {
		return x -> x++;	// [3]
	}
	
	FI[] c = new FI[] {x -> x++, x -> x++}; // [4]
	FI[][] d = new FI[][] {{x -> x++, x -> x++}, {x -> x++}}; // [5]
	FI[] e = {x -> x++, x -> x++}; // [6]
	FI[][] f = {{x -> x++}, {x -> x++}}; // [7]
	
	int g = fun2(x -> x++);	// [8]
	TestInlineLambda h = new TestInlineLambda(x -> x++);	// [9]
	private int fun2(FI fi) {return 0;}
	public TestInlineLambda(FI fi) {}

	private void fun3() {
		F f1 = (fi_p) -> x -> x++;	// [10]
		F f2 = (fi_p) -> {
			return x -> x++;		// [11]
		};
		boolean flag = true;
		FI fi4 = flag ? x -> x++ : x -> x++; // [12]
	}

	enum E {
		E_C1(x -> x++);  // [13]
		E(FI fi) {
		}
	}

}

enum E1 {
	E_C1(x -> x++); // [14]
	E1(FI fi) {
	}
}

@FunctionalInterface
interface FI {
	int foo(int x);
}

@FunctionalInterface
interface F {
	FI bar(Object o);
}