43 src3("(repeating) type annotations on type parameters of class, method return value in method", true), |
47 src3("(repeating) type annotations on type parameters of class, method return value in method", true), |
44 src4("(repeating) type annotations on field in anonymous class", false), |
48 src4("(repeating) type annotations on field in anonymous class", false), |
45 src5("(repeating) type annotations on field in anonymous class", false), |
49 src5("(repeating) type annotations on field in anonymous class", false), |
46 src6("(repeating) type annotations on void method declaration", false), |
50 src6("(repeating) type annotations on void method declaration", false), |
47 src7("(repeating) type annotations in use of instanceof", true), |
51 src7("(repeating) type annotations in use of instanceof", true), |
48 src8("(repeating) type annotations in use of instanceof in method", true); |
52 src7p("(repeating) type annotations in use of instanceof with type test pattern", true), |
|
53 src8("(repeating) type annotations in use of instanceof in method", true), |
|
54 src8p("(repeating) type annotations in use of instanceof with type test pattern in method", true); |
49 |
55 |
50 String description; |
56 String description; |
51 Boolean local; |
57 Boolean local; |
52 |
58 |
53 srce(String desc, Boolean b) { |
59 srce(String desc, Boolean b) { |
90 test( 0, 2, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src5); |
96 test( 0, 2, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src5); |
91 test( 0, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src6); |
97 test( 0, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src6); |
92 test( 0, 0, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src6); |
98 test( 0, 0, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src6); |
93 test( 2, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src7); |
99 test( 2, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src7); |
94 test( 0, 2, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src7); |
100 test( 0, 2, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src7); |
|
101 test( 2, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src7p); |
|
102 test( 0, 2, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src7p); |
95 test( 4, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src8); |
103 test( 4, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src8); |
96 test( 0, 4, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src8); |
104 test( 0, 4, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src8); |
|
105 test( 4, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src8p); |
|
106 test( 0, 4, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src8p); |
97 break; |
107 break; |
98 case "FIELD": |
108 case "FIELD": |
99 test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); |
109 test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); |
100 test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src2); |
110 test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src2); |
101 test( 6, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src3); |
111 test( 6, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src3); |
383 " boolean dataIsString = ( data instanceof _As_ _Bs_ String);\n" + |
394 " boolean dataIsString = ( data instanceof _As_ _Bs_ String);\n" + |
384 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
395 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
385 "\n\n"; |
396 "\n\n"; |
386 hasInnerClass=false; |
397 hasInnerClass=false; |
387 break; |
398 break; |
|
399 case src7p: // (repeating) type annotations in use of instanceof with type test pattern |
|
400 /* |
|
401 * class Test10{ |
|
402 * String data = "test"; |
|
403 * boolean dataIsString = ( data instanceof @A @B @A @B String str); |
|
404 * } |
|
405 */ |
|
406 source = new String( source + |
|
407 "// " + src.description + "\n" + |
|
408 "class "+ testname + "{\n" + |
|
409 " String data = \"test\";\n" + |
|
410 " boolean dataIsString = ( data instanceof _As_ _Bs_ String str && str.isEmpty());\n" + |
|
411 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
|
412 "\n\n"; |
|
413 extraOptions = List.of("--enable-preview", |
|
414 "-source", JDK_VERSION); |
|
415 hasInnerClass=false; |
|
416 break; |
388 case src8: // (repeating) type annotations in use of instanceof |
417 case src8: // (repeating) type annotations in use of instanceof |
389 /* |
418 /* |
390 * class Test20{ |
419 * class Test20{ |
391 * String data = "test"; |
420 * String data = "test"; |
392 * Boolean isString() { |
421 * Boolean isString() { |