test/tools/javap/output/RepeatingTypeAnnotations.java

changeset 1755
ddb4a2bfcd82
parent 1721
abd153854f16
child 2525
2eb010b6cb22
equal deleted inserted replaced
1754:0384683c64be 1755:ddb4a2bfcd82
119 * - two annotation types with different retention 119 * - two annotation types with different retention
120 * - three annotation types, two of same retention, one different. 120 * - three annotation types, two of same retention, one different.
121 */ 121 */
122 122
123 @TestCase 123 @TestCase
124 @ignore // 8008082: missing type annotation for cast
125 public static class TC1 extends RepeatingTypeAnnotations { 124 public static class TC1 extends RepeatingTypeAnnotations {
126 public TC1() { 125 public TC1() {
127 setSrc(" static String so = \"hello world\";", 126 setSrc(" /* TC1 */ ",
127 " static String so = \"hello world\";",
128 " public @A @A @A Object o = (@A @A @A String) Test.so;"); 128 " public @A @A @A Object o = (@A @A @A String) Test.so;");
129 verify("RuntimeInvisibleTypeAnnotations", 129 verify("RuntimeInvisibleTypeAnnotations",
130 "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD", 130 "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD",
131 "1: #25(#26=[@#27(),@#27(),@#27()]): CAST, offset=5"); 131 "0: #25(#26=[@#27(),@#27(),@#27()]): CAST, offset=5, type_index=0");
132 } 132 }
133 } 133 }
134 134
135 @TestCase 135 @TestCase
136 public static class TC2 extends RepeatingTypeAnnotations { 136 public static class TC2 extends RepeatingTypeAnnotations {
137 public TC2() { 137 public TC2() {
138 setSrc(" static String so = \"hello world\";", 138 setSrc(" /* TC2 */ ",
139 " static String so = \"hello world\";",
139 " public @A @B @A Object o = (@B @A @B String) Test.so;"); 140 " public @A @B @A Object o = (@B @A @B String) Test.so;");
140 verify("RuntimeInvisibleTypeAnnotations", 141 verify("RuntimeInvisibleTypeAnnotations",
141 "0: #25(#26=[@#27(),@#27()]): FIELD", 142 "0: #25(#26=[@#27(),@#27()]): FIELD",
142 "1: #28(): FIELD", 143 "1: #28(): FIELD",
143 "2: #29(#26=[@#28(),@#28()]): CAST, offset=5", 144 "0: #36(#26=[@#28(),@#28()]): CAST, offset=5, type_index=0",
144 "3: #27(): CAST, offset=5"); 145 "1: #27(): CAST, offset=5, type_index=0");
145 } 146 }
146 } 147 }
147 148
148 @TestCase 149 @TestCase
149 public static class TC3 extends RepeatingTypeAnnotations { 150 public static class TC3 extends RepeatingTypeAnnotations {
150 public TC3() { 151 public TC3() {
151 setSrc(" static String so = \"hello world\";", 152 setSrc(" /* TC3 */ ",
153 " static String so = \"hello world\";",
152 " public @A @A @C Object o = (@B @C @B String) Test.so;"); 154 " public @A @A @C Object o = (@B @C @B String) Test.so;");
153 verify("RuntimeInvisibleTypeAnnotations", 155 verify("RuntimeVisibleTypeAnnotations",
156 "RuntimeInvisibleTypeAnnotations",
154 "0: #25(): FIELD", 157 "0: #25(): FIELD",
155 "1: #25(): CAST, offset=5",
156 "RuntimeVisibleTypeAnnotations",
157 "0: #27(#28=[@#29(),@#29()]): FIELD", 158 "0: #27(#28=[@#29(),@#29()]): FIELD",
158 "1: #30(#28=[@#31(),@#31()]): CAST, offset=5"); 159 "0: #25(): CAST, offset=5, type_index=0",
160 "0: #37(#28=[@#38(),@#38()]): CAST, offset=5, type_index=0");
159 } 161 }
160 } 162 }
161 163
162 @TestCase 164 @TestCase
163 public static class TC4 extends RepeatingTypeAnnotations { 165 public static class TC4 extends RepeatingTypeAnnotations {
164 public TC4() { 166 public TC4() {
165 setSrc(" static String so = \"hello world\";", 167 setSrc(" /* TC4 */ ",
168 " static String so = \"hello world\";",
166 " public @A @B @C Object o = (@C @B @A String) Test.so;"); 169 " public @A @B @C Object o = (@C @B @A String) Test.so;");
167 verify("RuntimeInvisibleTypeAnnotations", 170 verify("RuntimeInvisibleTypeAnnotations",
168 "RuntimeVisibleTypeAnnotations", 171 "RuntimeVisibleTypeAnnotations",
169 "0: #25(): FIELD", 172 "0: #25(): FIELD",
170 "1: #25(): CAST, offset=5",
171 "0: #27(): FIELD", 173 "0: #27(): FIELD",
172 "1: #28(): FIELD", 174 "1: #28(): FIELD",
173 "2: #28(): CAST, offset=5", 175 "0: #25(): CAST, offset=5, type_index=0",
174 "3: #27(): CAST, offset=5"); 176 "0: #28(): CAST, offset=5, type_index=0",
175 } 177 "1: #27(): CAST, offset=5, type_index=0");
176 } 178 }
177 179 }
178 @TestCase 180
179 @ignore // 8008082: missing type annotation for cast 181 @TestCase
180 public static class TC5 extends RepeatingTypeAnnotations { 182 public static class TC5 extends RepeatingTypeAnnotations {
181 public TC5() { 183 public TC5() {
182 setSrc(" static String so = \"hello world\";", 184 setSrc(" /* TC5 */ ",
185 " static String so = \"hello world\";",
183 " public static @A @A @A Object o = (@B @B @B String) Test.so;"); 186 " public static @A @A @A Object o = (@B @B @B String) Test.so;");
184 verify("RuntimeInvisibleTypeAnnotations", 187 verify("RuntimeInvisibleTypeAnnotations",
185 "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD", 188 "0: #25(#26=[@#27(),@#27(),@#27()]): FIELD",
186 "1: #28(#26=[@#29(),@#29(),@#29()]): CAST, offset=5, type_index=0"); 189 "0: #36(#26=[@#37(),@#37(),@#37()]): CAST, offset=5, type_index=0");
187 } 190 }
188 } 191 }
189 192
190 @TestCase 193 @TestCase
191 public static class TC6 extends RepeatingTypeAnnotations { 194 public static class TC6 extends RepeatingTypeAnnotations {
192 public TC6() { 195 public TC6() {
193 setSrc(" static String so = \"hello world\";", 196 setSrc(" /* TC6 */ ",
197 " static String so = \"hello world\";",
194 " public static @A @B @A Object o = (@B @A @B String) Test.so;"); 198 " public static @A @B @A Object o = (@B @A @B String) Test.so;");
195 verify("RuntimeInvisibleTypeAnnotations", 199 verify("RuntimeInvisibleTypeAnnotations",
196 "0: #25(#26=[@#27(),@#27()]): FIELD", 200 "0: #25(#26=[@#27(),@#27()]): FIELD",
197 "1: #28(): FIELD", 201 "1: #28(): FIELD",
198 "2: #29(#26=[@#28(),@#28()]): CAST, offset=5", 202 "0: #37(#26=[@#28(),@#28()]): CAST, offset=5, type_index=0",
199 "3: #27(): CAST, offset=5"); 203 "1: #27(): CAST, offset=5, type_index=0");
200 } 204 }
201 } 205 }
202 206
203 @TestCase 207 @TestCase
204 public static class TC7 extends RepeatingTypeAnnotations { 208 public static class TC7 extends RepeatingTypeAnnotations {
205 public TC7() { 209 public TC7() {
206 setSrc(" static String so = \"hello world\";", 210 setSrc(" /* TC7 */ ",
211 " static String so = \"hello world\";",
207 " public static @A @A @C Object o = (@B @C @B String) Test.so;"); 212 " public static @A @A @C Object o = (@B @C @B String) Test.so;");
208 verify("RuntimeInvisibleTypeAnnotations", 213 verify("RuntimeVisibleTypeAnnotations",
209 "RuntimeVisibleTypeAnnotations", 214 "RuntimeInvisibleTypeAnnotations",
210 "0: #25(): FIELD", 215 "0: #25(): FIELD",
211 "1: #25(): CAST, offset=5",
212 "0: #27(#28=[@#29(),@#29()]): FIELD", 216 "0: #27(#28=[@#29(),@#29()]): FIELD",
213 "1: #30(#28=[@#31(),@#31()]): CAST, offset=5"); 217 "0: #25(): CAST, offset=5, type_index=0",
218 "0: #38(#28=[@#39(),@#39()]): CAST, offset=5, type_index=0");
214 } 219 }
215 } 220 }
216 221
217 @TestCase 222 @TestCase
218 public static class TC8 extends RepeatingTypeAnnotations { 223 public static class TC8 extends RepeatingTypeAnnotations {
219 public TC8() { 224 public TC8() {
220 setSrc(" static String so = \"hello world\";", 225 setSrc(" /* TC8 */ ",
226 " static String so = \"hello world\";",
221 " public static @A @B @C Object o = (@C @B @A String) Test.so;"); 227 " public static @A @B @C Object o = (@C @B @A String) Test.so;");
222 verify("RuntimeInvisibleTypeAnnotations", 228
223 "RuntimeVisibleTypeAnnotations", 229 verify("RuntimeVisibleTypeAnnotations",
230 "RuntimeInvisibleTypeAnnotations",
224 "0: #25(): FIELD", 231 "0: #25(): FIELD",
225 "1: #25(): CAST, offset=5",
226 "0: #27(): FIELD", 232 "0: #27(): FIELD",
227 "1: #28(): FIELD", 233 "1: #28(): FIELD",
228 "2: #28(): CAST, offset=5", 234 "0: #25(): CAST, offset=5, type_index=0",
229 "3: #27(): CAST, offset=5"); 235 "0: #28(): CAST, offset=5, type_index=0",
230 } 236 "1: #27(): CAST, offset=5, type_index=0");
231 } 237 }
232 238 }
233 @TestCase 239
234 @ignore // 8008082: missing type annotation for cast 240 @TestCase
235 public static class TC9 extends RepeatingTypeAnnotations { 241 public static class TC9 extends RepeatingTypeAnnotations {
236 public TC9() { 242 public TC9() {
237 setSrc(" public Test(@A @A @A Object o, @A int i, long l) {", 243 setSrc(" /* TC9 */ ",
244 " public Test(@A @A @A Object o, @A int i, long l) {",
238 " @A @A @A String ls = (@B @B @B String) o;", 245 " @A @A @A String ls = (@B @B @B String) o;",
239 " }"); 246 " }");
240 verify("RuntimeInvisibleTypeAnnotations", 247 verify("RuntimeInvisibleTypeAnnotations",
241 "0: #34(#35=[@#36(),@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", 248 "0: #34(#35=[@#36(),@#36(),@#36()]): CAST, offset=4, type_index=0",
242 "1: #36(): METHOD_FORMAL_PARAMETER, param_index=1", 249 "1: #37(#35=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
243 "2: #37(#35=[@#38(),@#38(),@#38()]): CAST, offset=4, type_index=0", 250 "RuntimeInvisibleTypeAnnotations",
244 "3: #34(#35=[@#36(),@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}"); 251 "0: #37(#35=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
252 "1: #38(): METHOD_FORMAL_PARAMETER, param_index=1");
245 } 253 }
246 } 254 }
247 255
248 @TestCase 256 @TestCase
249 public static class TC10 extends RepeatingTypeAnnotations { 257 public static class TC10 extends RepeatingTypeAnnotations {
250 public TC10() { 258 public TC10() {
251 setSrc(" public Test(@A @A @B Object o, @A @B int i, long l) {", 259 setSrc(" /* TC10 */ ",
260 " public Test(@A @A @B Object o, @A @B int i, long l) {",
252 " @A @A @B String ls = (@B @A @B String) o;", 261 " @A @A @B String ls = (@B @A @B String) o;",
253 " }"); 262 " }");
254 verify("RuntimeInvisibleTypeAnnotations:", 263 verify("RuntimeInvisibleTypeAnnotations",
255 "0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", 264 "0: #34(#35=[@#36(),@#36()]): CAST, offset=4, type_index=0",
256 "1: #37(): METHOD_FORMAL_PARAMETER, param_index=0", 265 "1: #37(): CAST, offset=4, type_index=0",
257 "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1", 266 "2: #38(#35=[@#37(),@#37()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
258 "3: #37(): METHOD_FORMAL_PARAMETER, param_index=1", 267 "3: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
259 "4: #38(#35=[@#37(),@#37()]): CAST, offset=4, type_index=0", 268 "RuntimeInvisibleTypeAnnotations",
260 "5: #36(): CAST, offset=4, type_index=0", 269 "0: #38(#35=[@#37(),@#37()]): METHOD_FORMAL_PARAMETER, param_index=0",
261 "6: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", 270 "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
262 "7: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}"); 271 "2: #37(): METHOD_FORMAL_PARAMETER, param_index=1",
272 "3: #36(): METHOD_FORMAL_PARAMETER, param_index=1");
263 } 273 }
264 } 274 }
265 275
266 @TestCase 276 @TestCase
267 public static class TC11 extends RepeatingTypeAnnotations { 277 public static class TC11 extends RepeatingTypeAnnotations {
268 public TC11() { 278 public TC11() {
269 setSrc(" public Test(@C @C @A Object o, @A @B int i, long l) {", 279 setSrc(" /* TC11 */ ",
280 " public Test(@C @C @A Object o, @A @B int i, long l) {",
270 " @C @C @A String ls = (@A @A @C String) o;", 281 " @C @C @A String ls = (@A @A @C String) o;",
271 " }"); 282 " }");
272 verify("RuntimeInvisibleTypeAnnotations", 283 verify("RuntimeVisibleTypeAnnotations",
273 "RuntimeVisibleTypeAnnotations", 284 "RuntimeInvisibleTypeAnnotations",
274 "0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", 285 "0: #34(): CAST, offset=4, type_index=0",
275 "1: #36(): CAST, offset=4", 286 "1: #35(#36=[@#34(),@#34()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
276 "2: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", 287 "0: #38(#36=[@#39(),@#39()]): CAST, offset=4, type_index=0",
277 "0: #38(): METHOD_FORMAL_PARAMETER, param_index=0", 288 "1: #39(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
278 "1: #38(): METHOD_FORMAL_PARAMETER, param_index=1", 289 "0: #35(#36=[@#34(),@#34()]): METHOD_FORMAL_PARAMETER, param_index=0",
279 "2: #39(): METHOD_FORMAL_PARAMETER, param_index=1", 290 "0: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
280 "3: #40(#35=[@#38(),@#38()]): CAST, offset=4", 291 "1: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
281 "4: #38(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}"); 292 "2: #40(): METHOD_FORMAL_PARAMETER, param_index=1");
282 } 293 }
283 } 294 }
284 295
285 @TestCase 296 @TestCase
286 public static class TC12 extends RepeatingTypeAnnotations { 297 public static class TC12 extends RepeatingTypeAnnotations {
287 public TC12() { 298 public TC12() {
288 setSrc(" public Test(@A @B @C Object o, @A @C int i, long l) {", 299 setSrc(" /* TC12 */ ",
300 " public Test(@A @B @C Object o, @A @C int i, long l) {",
289 " @A @B @C String ls = (@C @A @B String) o;", 301 " @A @B @C String ls = (@C @A @B String) o;",
290 " }"); 302 " }");
291 verify("RuntimeInvisibleTypeAnnotations", 303 verify("RuntimeVisibleTypeAnnotations",
292 "RuntimeVisibleTypeAnnotations", 304 "0: #34(): CAST, offset=4, type_index=0",
305 "1: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
306 "RuntimeInvisibleTypeAnnotations",
307 "0: #36(): CAST, offset=4, type_index=0",
308 "1: #37(): CAST, offset=4, type_index=0",
309 "2: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
310 "3: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
293 "0: #34(): METHOD_FORMAL_PARAMETER, param_index=0", 311 "0: #34(): METHOD_FORMAL_PARAMETER, param_index=0",
294 "1: #34(): METHOD_FORMAL_PARAMETER, param_index=1", 312 "1: #34(): METHOD_FORMAL_PARAMETER, param_index=1",
295 "2: #34(): CAST, offset=4",
296 "3: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
297 "0: #36(): METHOD_FORMAL_PARAMETER, param_index=0", 313 "0: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
298 "1: #37(): METHOD_FORMAL_PARAMETER, param_index=0", 314 "1: #37(): METHOD_FORMAL_PARAMETER, param_index=0",
299 "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1", 315 "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1");
300 "3: #36(): CAST, offset=4", 316 }
301 "4: #37(): CAST, offset=4", 317 }
302 "5: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", 318
303 "6: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}"); 319 @TestCase
304 }
305 }
306
307 @TestCase
308 @ignore // 8008082: missing type annotation for cast
309 public static class TC13 extends RepeatingTypeAnnotations { 320 public static class TC13 extends RepeatingTypeAnnotations {
310 public TC13() { 321 public TC13() {
311 setSrc(" public @A @A @A String foo(@A @A @A Object o, @A int i, long l) {", 322 setSrc(" /* TC13 */ ",
323 " public @A @A @A String foo(@A @A @A Object o, @A int i, long l) {",
312 " @A @A @A String ls = (@B @B @B String) o;", 324 " @A @A @A String ls = (@B @B @B String) o;",
313 " return (@A @A @A String) o;", 325 " return (@A @A @A String) o;",
314 " }"); 326 " }");
315 verify("RuntimeInvisibleTypeAnnotations", 327 verify("RuntimeInvisibleTypeAnnotations",
316 "0: #36(#37=[@#38(),@#38(),@#38()]): METHOD_RETURN", 328 "0: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=0, type_index=0",
317 "1: #36(#37=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0", 329 "1: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=6, type_index=0",
318 "2: #38(): METHOD_FORMAL_PARAMETER, param_index=1", 330 "2: #39(#37=[@#40(),@#40(),@#40()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
319 "3: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=0, type_index=0", 331 "RuntimeInvisibleTypeAnnotations",
320 "4: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=6, type_index=0", 332 "0: #39(#37=[@#40(),@#40(),@#40()]): METHOD_RETURN",
321 "5: #36(#37=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}"); 333 "1: #39(#37=[@#40(),@#40(),@#40()]): METHOD_FORMAL_PARAMETER, param_index=0",
334 "2: #40(): METHOD_FORMAL_PARAMETER, param_index=1");
322 } 335 }
323 } 336 }
324 337
325 @TestCase 338 @TestCase
326 public static class TC14 extends RepeatingTypeAnnotations { 339 public static class TC14 extends RepeatingTypeAnnotations {
327 public TC14() { 340 public TC14() {
328 setSrc(" public @A @B @B String foo(@A @A @B Object o, @A @B int i, long l) {", 341 setSrc(" /* TC14 */ ",
342 " public @A @B @B String foo(@A @A @B Object o, @A @B int i, long l) {",
329 " @A @A @B String ls = (@B @A @B String) o;", 343 " @A @A @B String ls = (@B @A @B String) o;",
330 " return (@A @B @B String) o;", 344 " return (@A @B @B String) o;",
331 " }"); 345 " }");
332 verify("RuntimeInvisibleTypeAnnotations", 346 verify(
333 "0: #36(): METHOD_RETURN", 347 "RuntimeInvisibleTypeAnnotations:",
334 "1: #37(#38=[@#39(),@#39()]): METHOD_RETURN", 348 "0: #36(#37=[@#38(),@#38()]): CAST, offset=0, type_index=0",
335 "2: #40(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", 349 "1: #39(): CAST, offset=0, type_index=0",
336 "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0", 350 "2: #39(): CAST, offset=6, type_index=0",
337 "4: #36(): METHOD_FORMAL_PARAMETER, param_index=1", 351 "3: #36(#37=[@#38(),@#38()]): CAST, offset=6, type_index=0",
338 "5: #39(): METHOD_FORMAL_PARAMETER, param_index=1", 352 "4: #40(#37=[@#39(),@#39()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
339 "6: #37(#38=[@#39(),@#39()]): CAST, offset=0", 353 "5: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
340 "7: #36(): CAST, offset=0", 354 "RuntimeInvisibleTypeAnnotations:",
341 "8: #36(): CAST, offset=6", 355 "0: #39(): METHOD_RETURN",
342 "9: #37(#38=[@#39(),@#39()]): CAST, offset=6", 356 "1: #36(#37=[@#38(),@#38()]): METHOD_RETURN",
343 "10: #40(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", 357 "2: #40(#37=[@#39(),@#39()]): METHOD_FORMAL_PARAMETER, param_index=0",
344 "11: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}"); 358 "3: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
359 "4: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
360 "5: #38(): METHOD_FORMAL_PARAMETER, param_index=1"
361 );
345 } 362 }
346 } 363 }
347 364
348 @TestCase 365 @TestCase
349 public static class TC15 extends RepeatingTypeAnnotations { 366 public static class TC15 extends RepeatingTypeAnnotations {
350 public TC15() { 367 public TC15() {
351 setSrc(" public @A @A @C String foo(@C @C @A Object o, @A @B int i, long l) {", 368 setSrc(" /* TC15 */ ",
369 " public @A @A @C String foo(@C @C @A Object o, @A @B int i, long l) {",
352 " @C @C @A String ls = (@A @A @C String) o;", 370 " @C @C @A String ls = (@A @A @C String) o;",
353 " return (@C @B @B String) o;", 371 " return (@C @B @B String) o;",
354 " }"); 372 " }");
355 verify("RuntimeInvisibleTypeAnnotations", 373 verify(
356 "RuntimeVisibleTypeAnnotations", 374 "RuntimeVisibleTypeAnnotations:",
357 "0: #36(): METHOD_RETURN", 375 "0: #36(): CAST, offset=0, type_index=0",
358 "1: #37(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", 376 "1: #36(): CAST, offset=6, type_index=0",
359 "2: #36(): CAST, offset=0", 377 "2: #37(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
360 "3: #36(): CAST, offset=6", 378 "RuntimeInvisibleTypeAnnotations:",
361 "4: #37(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", 379 "0: #40(#38=[@#41(),@#41()]): CAST, offset=0, type_index=0",
362 "0: #40(#38=[@#41(),@#41()]): METHOD_RETURN", 380 "1: #42(#38=[@#43(),@#43()]): CAST, offset=6, type_index=0",
363 "1: #41(): METHOD_FORMAL_PARAMETER, param_index=0", 381 "2: #41(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
364 "2: #41(): METHOD_FORMAL_PARAMETER, param_index=1", 382 "RuntimeVisibleTypeAnnotations:",
365 "3: #42(): METHOD_FORMAL_PARAMETER, param_index=1", 383 "0: #36(): METHOD_RETURN",
366 "4: #40(#38=[@#41(),@#41()]): CAST, offset=0", 384 "1: #37(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
367 "5: #43(#38=[@#42(),@#42()]): CAST, offset=6", 385 "RuntimeInvisibleTypeAnnotations:",
368 "6: #41(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}"); 386 "0: #40(#38=[@#41(),@#41()]): METHOD_RETURN",
387 "1: #41(): METHOD_FORMAL_PARAMETER, param_index=0",
388 "2: #41(): METHOD_FORMAL_PARAMETER, param_index=1",
389 "3: #43(): METHOD_FORMAL_PARAMETER, param_index=1"
390 );
369 } 391 }
370 } 392 }
371 393
372 @TestCase 394 @TestCase
373 public static class TC16 extends RepeatingTypeAnnotations { 395 public static class TC16 extends RepeatingTypeAnnotations {
374 public TC16() { 396 public TC16() {
375 setSrc(" public @A @B @C String foo(@A @B @C Object o, @A @C int i, long l) {", 397 setSrc(" /* TC16 */ ",
398 " public @A @B @C String foo(@A @B @C Object o, @A @C int i, long l) {",
376 " @A @B @C String ls = (@C @A @B String) o;", 399 " @A @B @C String ls = (@C @A @B String) o;",
377 " return (@B @A @C String) o;", 400 " return (@B @A @C String) o;",
378 " }"); 401 " }");
379 verify("RuntimeInvisibleTypeAnnotations", 402 verify(
380 "RuntimeVisibleTypeAnnotations", 403 "RuntimeVisibleTypeAnnotations:",
404 "0: #36(): CAST, offset=0, type_index=0",
405 "1: #36(): CAST, offset=6, type_index=0",
406 "2: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
407 "RuntimeInvisibleTypeAnnotations:",
408 "0: #38(): CAST, offset=0, type_index=0",
409 "1: #39(): CAST, offset=0, type_index=0",
410 "2: #39(): CAST, offset=6, type_index=0",
411 "3: #38(): CAST, offset=6, type_index=0",
412 "4: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
413 "5: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
414 "RuntimeVisibleTypeAnnotations:",
381 "0: #36(): METHOD_RETURN", 415 "0: #36(): METHOD_RETURN",
382 "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0", 416 "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
383 "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1", 417 "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
384 "3: #36(): CAST, offset=0", 418 "RuntimeInvisibleTypeAnnotations:",
385 "4: #36(): CAST, offset=6",
386 "5: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
387 "0: #38(): METHOD_RETURN", 419 "0: #38(): METHOD_RETURN",
388 "1: #39(): METHOD_RETURN", 420 "1: #39(): METHOD_RETURN",
389 "2: #38(): METHOD_FORMAL_PARAMETER, param_index=0", 421 "2: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
390 "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0", 422 "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
391 "4: #38(): METHOD_FORMAL_PARAMETER, param_index=1", 423 "4: #38(): METHOD_FORMAL_PARAMETER, param_index=1"
392 "5: #38(): CAST, offset=0", 424 );
393 "6: #39(): CAST, offset=0",
394 "7: #39(): CAST, offset=6",
395 "8: #38(): CAST, offset=6",
396 "9: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
397 "10: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}");
398 } 425 }
399 } 426 }
400 } 427 }

mercurial