author | jlahoda |
Wed, 27 Nov 2019 09:00:01 +0100 | |
changeset 59285 | 7799a51dbe30 |
permissions | -rw-r--r-- |
59285
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
1 |
/* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
4 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
8 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
13 |
* accompanied this code). |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
14 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
18 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
21 |
* questions. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
22 |
*/ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
23 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
24 |
/* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
25 |
* @test |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
26 |
* @bug 8231827 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
27 |
* @summary Basic tests for bindings from instanceof |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
28 |
* @compile --enable-preview -source ${jdk.version} BindingsTest1.java |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
29 |
* @run main/othervm --enable-preview BindingsTest1 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
30 |
*/ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
31 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
32 |
public class BindingsTest1 { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
33 |
public static boolean Ktrue() { return true; } |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
34 |
public static void main(String[] args) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
35 |
Object o1 = "hello"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
36 |
Integer i = 42; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
37 |
Object o2 = i; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
38 |
Object o3 = "there"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
39 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
40 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
41 |
// Test for (e matches P).T = { binding variables in P } |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
42 |
if (o1 instanceof String s) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
43 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
44 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
45 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
46 |
// Test for e1 && e2.T = union(e1.T, e2.T) |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
47 |
if (o1 instanceof String s && o2 instanceof Integer in) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
48 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
49 |
in.intValue(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
50 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
51 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
52 |
// test for e1&&e2 - include e1.T in e2 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
53 |
if (o1 instanceof String s && s.length()>0) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
54 |
System.out.print("done"); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
55 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
56 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
57 |
// Test for (e1 || e2).F = union(e1.F, e2.F) |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
58 |
if (!(o1 instanceof String s) || !(o3 instanceof Integer in)){ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
59 |
} else { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
60 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
61 |
i.intValue(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
62 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
63 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
64 |
// Test for e1||e2 - include e1.F in e2 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
65 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
66 |
if (!(o1 instanceof String s) || s.length()>0) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
67 |
System.out.println("done"); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
68 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
69 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
70 |
// Test for e1 ? e2: e3 - include e1.T in e2 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
71 |
if (o1 instanceof String s ? s.length()>0 : false) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
72 |
System.out.println("done"); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
73 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
74 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
75 |
// Test for e1 ? e2 : e3 - include e1.F in e3 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
76 |
if (!(o1 instanceof String s) ? false : s.length()>0){ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
77 |
System.out.println("done"); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
78 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
79 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
80 |
// Test for (!e).T = e.F |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
81 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
82 |
if (!(!(o1 instanceof String s) || !(o3 instanceof Integer in))){ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
83 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
84 |
i.intValue(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
85 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
86 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
87 |
// Test for (!e).F = e.T |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
88 |
if (!(o1 instanceof String s)) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
89 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
90 |
} else { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
91 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
92 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
93 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
94 |
L1: { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
95 |
if (o1 instanceof String s) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
96 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
97 |
} else { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
98 |
break L1; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
99 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
100 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
101 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
102 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
103 |
L2: { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
104 |
if (!(o1 instanceof String s)) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
105 |
break L2; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
106 |
} else { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
107 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
108 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
109 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
110 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
111 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
112 |
L4: { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
113 |
if (!(o1 instanceof String s)) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
114 |
break L4; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
115 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
116 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
117 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
118 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
119 |
{ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
120 |
while (!(o1 instanceof String s)) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
121 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
122 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
123 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
124 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
125 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
126 |
L5: { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
127 |
while (!(o1 instanceof String s)) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
128 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
129 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
130 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
131 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
132 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
133 |
{ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
134 |
L6: for ( ;!(o1 instanceof String s); ) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
135 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
136 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
137 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
138 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
139 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
140 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
141 |
{ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
142 |
L7: do { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
143 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
144 |
} while (!(o1 instanceof String s)); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
145 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
146 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
147 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
148 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
149 |
if (o1 instanceof String s) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
150 |
Runnable r1 = new Runnable() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
151 |
@Override |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
152 |
public void run() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
153 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
154 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
155 |
}; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
156 |
r1.run(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
157 |
Runnable r2 = () -> { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
158 |
s.length(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
159 |
}; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
160 |
r2.run(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
161 |
String s2 = s; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
162 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
163 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
164 |
System.out.println("BindingsTest1 complete"); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
165 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
166 |
} |