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