author | akulyakh |
Thu, 21 May 2015 11:41:04 -0700 | |
changeset 30730 | d3ce7619db2c |
parent 26532 | aa84b6606229 |
child 30846 | 2b3f379840f0 |
permissions | -rw-r--r-- |
15718 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26532
diff
changeset
|
2 |
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
15718 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
/* |
|
25 |
* @test |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
26 |
* @bug 8008077 8029721 8042451 8043974 |
15718 | 27 |
* @summary Test population of reference info for lambda expressions |
26532
aa84b6606229
8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents:
24896
diff
changeset
|
28 |
* javac crash for annotated parameter type of lambda in a field |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26532
diff
changeset
|
29 |
* @modules jdk.compiler/com.sun.tools.classfile |
26532
aa84b6606229
8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents:
24896
diff
changeset
|
30 |
* @ignore 8057687 emit correct byte code an attributes for type annotations |
15718 | 31 |
* @compile -g Driver.java ReferenceInfoUtil.java Lambda.java |
32 |
* @run main Driver Lambda |
|
33 |
* @author Werner Dietl |
|
34 |
*/ |
|
35 |
||
36 |
import static com.sun.tools.classfile.TypeAnnotation.TargetType.*; |
|
37 |
||
38 |
public class Lambda { |
|
39 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
40 |
@TADescription(annotation = "TA", type = METHOD_REFERENCE, |
15718 | 41 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
42 |
@TADescription(annotation = "TB", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
43 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
15718 | 44 |
public String returnMethodRef1() { |
45 |
return |
|
46 |
"class Lambda {" + |
|
47 |
" public String getName() { return \"Lambda!\"; }" + |
|
48 |
"}" + |
|
49 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
50 |
"class %TEST_CLASS_NAME% {" + |
15718 | 51 |
" java.util.function.Function<Lambda, String> lambda() {" + |
52 |
" return @TA @TB Lambda::getName;" + |
|
53 |
" }" + |
|
54 |
"}"; |
|
55 |
} |
|
56 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
57 |
@TADescription(annotation = "TA", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
58 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
59 |
@TADescription(annotation = "TB", type = METHOD_REFERENCE, |
15718 | 60 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
61 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
62 |
@TADescription(annotation = "TC", type = METHOD_REFERENCE, |
15718 | 63 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
64 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
65 |
@TADescription(annotation = "TD", type = METHOD_REFERENCE, |
15718 | 66 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
67 |
genericLocation = { 3, 1 }) |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
68 |
@TADescription(annotation = "TE", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
69 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
70 |
genericLocation = { 3, 1}) |
15718 | 71 |
public String returnMethodRef2() { |
72 |
return |
|
73 |
"class Lambda<S, T> {" + |
|
74 |
" public String getName() { return \"Lambda!\"; }" + |
|
75 |
"}" + |
|
76 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
77 |
"class %TEST_CLASS_NAME% {" + |
15718 | 78 |
" java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" + |
79 |
" return @TA Lambda<@TB @TC Integer, @TD @TE Float>::getName;" + |
|
80 |
" }" + |
|
81 |
"}"; |
|
82 |
} |
|
83 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
84 |
@TADescription(annotation = "CTA", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
85 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
86 |
@TADescription(annotation = "CTB", type = METHOD_REFERENCE, |
15718 | 87 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
88 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
89 |
@TADescription(annotation = "CTC", type = METHOD_REFERENCE, |
15718 | 90 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
91 |
genericLocation = { 3, 1 }) |
15718 | 92 |
public String returnMethodRef3() { |
93 |
return |
|
94 |
"class Lambda<S, T> {" + |
|
95 |
" public String getName() { return \"Lambda!\"; }" + |
|
96 |
"}" + |
|
97 |
||
98 |
"@Target(ElementType.TYPE_USE)" + |
|
99 |
"@interface CTA {" + |
|
100 |
" String value();" + |
|
101 |
"}" + |
|
102 |
||
103 |
"@Target(ElementType.TYPE_USE)" + |
|
104 |
"@interface CTB {" + |
|
105 |
" int age();" + |
|
106 |
"}" + |
|
107 |
||
108 |
"@Target(ElementType.TYPE_USE)" + |
|
109 |
"@interface CTC {" + |
|
110 |
" String name();" + |
|
111 |
"}" + |
|
112 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
113 |
"class %TEST_CLASS_NAME% {" + |
15718 | 114 |
" java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" + |
115 |
" return @CTA(\"x\") Lambda<@CTB(age = 5) Integer, @CTC(name = \"y\") Float>::getName;" + |
|
116 |
" }" + |
|
117 |
"}"; |
|
118 |
} |
|
119 |
||
120 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
121 |
@TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE, |
15718 | 122 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
123 |
@TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
124 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
15718 | 125 |
public String returnConstructorRef1() { |
126 |
return |
|
127 |
"class Lambda {" + |
|
128 |
" Lambda() { }" + |
|
129 |
"}" + |
|
130 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
131 |
"class %TEST_CLASS_NAME% {" + |
15718 | 132 |
" Runnable lambda() {" + |
133 |
" return @TA @TB Lambda::new;" + |
|
134 |
" }" + |
|
135 |
"}"; |
|
136 |
} |
|
137 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
138 |
@TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
139 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
140 |
@TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE, |
15718 | 141 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
142 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
143 |
@TADescription(annotation = "TC", type = CONSTRUCTOR_REFERENCE, |
15718 | 144 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
145 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
146 |
@TADescription(annotation = "TD", type = CONSTRUCTOR_REFERENCE, |
15718 | 147 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
148 |
genericLocation = { 3, 1 }) |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
149 |
@TADescription(annotation = "TE", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
150 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
151 |
genericLocation = { 3, 1 }) |
15718 | 152 |
public String returnConstructorRef2() { |
153 |
return |
|
154 |
"class Lambda<S, T> {" + |
|
155 |
" Lambda() { }" + |
|
156 |
"}" + |
|
157 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
158 |
"class %TEST_CLASS_NAME% {" + |
15718 | 159 |
" Runnable lambda() {" + |
160 |
" return @TA Lambda<@TB @TC Integer, @TD @TE Float>::new;" + |
|
161 |
" }" + |
|
162 |
"}"; |
|
163 |
} |
|
164 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
165 |
@TADescription(annotation = "CTA", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
166 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
167 |
@TADescription(annotation = "CTB", type = CONSTRUCTOR_REFERENCE, |
15718 | 168 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
169 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
170 |
@TADescription(annotation = "CTC", type = CONSTRUCTOR_REFERENCE, |
15718 | 171 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
172 |
genericLocation = { 3, 1 }) |
15718 | 173 |
public String returnConstructorRef3() { |
174 |
return |
|
175 |
"class Lambda<S, T> {" + |
|
176 |
" Lambda() { }" + |
|
177 |
"}" + |
|
178 |
||
179 |
"@Target(ElementType.TYPE_USE)" + |
|
180 |
"@interface CTA {" + |
|
181 |
" String value();" + |
|
182 |
"}" + |
|
183 |
||
184 |
"@Target(ElementType.TYPE_USE)" + |
|
185 |
"@interface CTB {" + |
|
186 |
" int age();" + |
|
187 |
"}" + |
|
188 |
||
189 |
"@Target(ElementType.TYPE_USE)" + |
|
190 |
"@interface CTC {" + |
|
191 |
" String name();" + |
|
192 |
"}" + |
|
193 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
194 |
"class %TEST_CLASS_NAME% {" + |
15718 | 195 |
" Runnable lambda() {" + |
196 |
" return @CTA(\"x\") Lambda<@CTB(age = 5) Integer, @CTC(name = \"y\") Float>::new;" + |
|
197 |
" }" + |
|
198 |
"}"; |
|
199 |
} |
|
200 |
||
201 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
202 |
@TADescription(annotation = "TA", type = METHOD_REFERENCE_TYPE_ARGUMENT, |
15718 | 203 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
204 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
205 |
@TADescription(annotation = "TB", type = METHOD_REFERENCE_TYPE_ARGUMENT, |
15718 | 206 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
207 |
typeIndex = 1) |
|
208 |
public String returnMethodRefTA1() { |
|
209 |
return |
|
210 |
"interface Lambda {" + |
|
211 |
" <S, T> void generic(S p1, T p2);" + |
|
212 |
"}" + |
|
213 |
||
214 |
"class LambdaImpl implements Lambda {" + |
|
215 |
" public <S, T> void generic(S p1, T p2) {}" + |
|
216 |
"}" + |
|
217 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
218 |
"class %TEST_CLASS_NAME% {" + |
15718 | 219 |
" Lambda lambda(LambdaImpl r) {" + |
220 |
" return r::<@TA Object, @TB Object>generic;" + |
|
221 |
" }" + |
|
222 |
"}"; |
|
223 |
} |
|
224 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
225 |
@TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, |
15718 | 226 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
227 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
228 |
@TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, |
15718 | 229 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
230 |
typeIndex = 1) |
|
231 |
public String returnConstructorRefTA2() { |
|
232 |
return |
|
233 |
"interface Lambda {" + |
|
234 |
" <S, T> void generic(S p1, T p2);" + |
|
235 |
"}" + |
|
236 |
||
237 |
"class LambdaImpl implements Lambda {" + |
|
238 |
" <S, T> LambdaImpl(S p1, T p2) {}" + |
|
239 |
" public <S, T> void generic(S p1, T p2) {}" + |
|
240 |
"}" + |
|
241 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
242 |
"class %TEST_CLASS_NAME% {" + |
15718 | 243 |
" Lambda lambda() {" + |
244 |
" return LambdaImpl::<@TA Object, @TB Object>new;" + |
|
245 |
" }" + |
|
246 |
"}"; |
|
247 |
} |
|
248 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
249 |
@TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
250 |
paramIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
251 |
@TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
252 |
paramIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
253 |
@TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
254 |
paramIndex = 1, genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
255 |
@TADescription(annotation = "TD", type = LOCAL_VARIABLE, |
17578 | 256 |
lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, |
257 |
lvarLength = ReferenceInfoUtil.IGNORE_VALUE, |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
258 |
lvarIndex = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
259 |
@TADescription(annotation = "TE", type = CAST, |
17578 | 260 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
261 |
typeIndex = 0) |
|
262 |
public String returnLambdaExpr1() { |
|
263 |
return |
|
264 |
"interface LambdaInt {" + |
|
265 |
" void lambda(Object p1, List<Object> p2);" + |
|
266 |
"}" + |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
267 |
"class %TEST_CLASS_NAME% {" + |
17578 | 268 |
" LambdaInt getLambda() {" + |
269 |
" return (@TA Object x, @TB List<@TC Object> y) -> { @TD Object l = null; System.out.println((@TE Object) l); };" + |
|
270 |
" }" + |
|
271 |
"}"; |
|
272 |
} |
|
22162
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
273 |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
274 |
@TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
275 |
paramIndex = 0) |
22162
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
276 |
public String lambdaField1() { |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
277 |
return |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
278 |
"class %TEST_CLASS_NAME% {" + |
22162
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
279 |
" java.util.function.IntUnaryOperator field = (@TA int y) -> 1;" + |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
280 |
"}"; |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
281 |
} |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
282 |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
283 |
@TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
284 |
paramIndex = 0) |
22162
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
285 |
public String lambdaField2() { |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
286 |
return |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
287 |
"class %TEST_CLASS_NAME% {" + |
22162
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
288 |
" static java.util.function.IntUnaryOperator field = (@TA int y) -> 1;" + |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
289 |
"}"; |
3b3e23e67329
8029721: javac crash for annotated parameter type of lambda in a field
vromero
parents:
17578
diff
changeset
|
290 |
} |
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
291 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
292 |
@TADescription(annotation = "RTAs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
293 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
294 |
public String returnMethodRefRepeatableAnnotation1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
295 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
296 |
"class Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
297 |
" public String getName() { return \"Lambda!\"; }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
298 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
299 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
300 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
301 |
" java.util.function.Function<Lambda, String> lambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
302 |
" return @RTA @RTA Lambda::getName;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
303 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
304 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
305 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
306 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
307 |
@TADescription(annotation = "RTAs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
308 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
309 |
@TADescription(annotation = "RTBs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
310 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
311 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
312 |
@TADescription(annotation = "RTCs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
313 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
314 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
315 |
@TADescription(annotation = "RTDs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
316 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
317 |
genericLocation = { 3, 1 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
318 |
@TADescription(annotation = "RTEs", type = METHOD_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
319 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
320 |
genericLocation = { 3, 1}) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
321 |
public String returnMethodRefRepeatableAnnotation2() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
322 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
323 |
"class Lambda<S, T> {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
324 |
" public String getName() { return \"Lambda!\"; }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
325 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
326 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
327 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
328 |
" java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
329 |
" return @RTA @RTA Lambda<@RTB @RTB @RTC @RTC Integer, @RTD @RTD @RTE @RTE Float>::getName;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
330 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
331 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
332 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
333 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
334 |
@TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
335 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
336 |
public String returnConstructorRefRepeatable1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
337 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
338 |
"class Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
339 |
" Lambda() { }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
340 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
341 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
342 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
343 |
" Runnable lambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
344 |
" return @RTA @RTA Lambda::new;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
345 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
346 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
347 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
348 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
349 |
@TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
350 |
offset = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
351 |
@TADescription(annotation = "RTBs", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
352 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
353 |
genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
354 |
@TADescription(annotation = "RTCs", type = CONSTRUCTOR_REFERENCE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
355 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
356 |
genericLocation = { 3, 1 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
357 |
public String returnConstructorRefRepeatable2() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
358 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
359 |
"class Lambda<S, T> {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
360 |
" Lambda() { }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
361 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
362 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
363 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
364 |
" Runnable lambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
365 |
" return @RTA @RTA Lambda<@RTB @RTB Integer, @RTC @RTC Float>::new;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
366 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
367 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
368 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
369 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
370 |
@TADescription(annotation = "RTAs", type = METHOD_REFERENCE_TYPE_ARGUMENT, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
371 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
372 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
373 |
@TADescription(annotation = "RTBs", type = METHOD_REFERENCE_TYPE_ARGUMENT, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
374 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
375 |
typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
376 |
public String returnMethodRefTARepeatableAnnotation1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
377 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
378 |
"interface Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
379 |
" <S, T> void generic(S p1, T p2);" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
380 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
381 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
382 |
"class LambdaImpl implements Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
383 |
" public <S, T> void generic(S p1, T p2) {}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
384 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
385 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
386 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
387 |
" Lambda lambda(LambdaImpl r) {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
388 |
" return r::<@RTA @RTA Object, @RTB @RTB Object>generic;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
389 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
390 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
391 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
392 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
393 |
@TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
394 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
395 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
396 |
@TADescription(annotation = "RTBs", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
397 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
398 |
typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
399 |
public String returnConstructorRefTARepeatableAnnotation2() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
400 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
401 |
"interface Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
402 |
" <S, T> void generic(S p1, T p2);" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
403 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
404 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
405 |
"class LambdaImpl implements Lambda {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
406 |
" <S, T> LambdaImpl(S p1, T p2) {}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
407 |
" public <S, T> void generic(S p1, T p2) {}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
408 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
409 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
410 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
411 |
" Lambda lambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
412 |
" return LambdaImpl::<@RTA @RTA Object, @RTB @RTB Object>new;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
413 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
414 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
415 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
416 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
417 |
@TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
418 |
paramIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
419 |
@TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
420 |
paramIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
421 |
@TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
422 |
paramIndex = 1, genericLocation = { 3, 0 }) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
423 |
@TADescription(annotation = "RTDs", type = LOCAL_VARIABLE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
424 |
lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
425 |
lvarLength = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
426 |
lvarIndex = ReferenceInfoUtil.IGNORE_VALUE) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
427 |
@TADescription(annotation = "RTEs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
428 |
offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
429 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
430 |
public String returnLambdaExprRepeatableAnnotation1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
431 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
432 |
"interface LambdaInt {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
433 |
" void lambda(Object p1, List<Object> p2);" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
434 |
"}" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
435 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
436 |
" LambdaInt getLambda() {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
437 |
" return (@RTA @RTA Object x, @RTB @RTB List<@RTC @RTC Object> y) ->" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
438 |
" { @RTD @RTD Object l = null; System.out.println((@RTE @RTE Object) l); };" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
439 |
" }" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
440 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
441 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
442 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
443 |
@TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
444 |
paramIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
445 |
public String lambdaFieldRepeatableAnnotation1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
446 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
447 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
448 |
" java.util.function.IntUnaryOperator field = (@RTA @RTA int y) -> 1;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
449 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
450 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
451 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
452 |
@TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
453 |
paramIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
454 |
public String lambdaFieldRepeatableAnnotation2() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
455 |
return |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
456 |
"class %TEST_CLASS_NAME% {" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
457 |
" static java.util.function.IntUnaryOperator field = (@RTA @RTA int y) -> 1;" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
458 |
"}"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22162
diff
changeset
|
459 |
} |
15718 | 460 |
} |