< prev index next >

test/langtools/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest2.java

Print this page

        

*** 43,53 **** src3("(repeating) type annotations on type parameters of class, method return value in method", true), src4("(repeating) type annotations on field in anonymous class", false), src5("(repeating) type annotations on field in anonymous class", false), src6("(repeating) type annotations on void method declaration", false), src7("(repeating) type annotations in use of instanceof", true), ! src8("(repeating) type annotations in use of instanceof in method", true); String description; Boolean local; srce(String desc, Boolean b) { --- 43,55 ---- src3("(repeating) type annotations on type parameters of class, method return value in method", true), src4("(repeating) type annotations on field in anonymous class", false), src5("(repeating) type annotations on field in anonymous class", false), src6("(repeating) type annotations on void method declaration", false), src7("(repeating) type annotations in use of instanceof", true), ! src7p("(repeating) type annotations in use of instanceof with type test pattern", true), ! src8("(repeating) type annotations in use of instanceof in method", true), ! src8p("(repeating) type annotations in use of instanceof with type test pattern in method", true); String description; Boolean local; srce(String desc, Boolean b) {
*** 90,101 **** --- 92,107 ---- test( 0, 2, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src5); test( 0, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src6); test( 0, 0, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src6); test( 2, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src7); test( 0, 2, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src7); + test( 2, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src7p); + test( 0, 2, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src7p); test( 4, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src8); test( 0, 4, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src8); + test( 4, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src8p); + test( 0, 4, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src8p); break; case "FIELD": test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src2); test( 6, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src3);
*** 383,392 **** --- 389,414 ---- " boolean dataIsString = ( data instanceof _As_ _Bs_ String);\n" + "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + "\n\n"; hasInnerClass=false; break; + case src7p: // (repeating) type annotations in use of instanceof with type test pattern + /* + * class Test10{ + * String data = "test"; + * boolean dataIsString = ( data instanceof @A @B @A @B String str); + * } + */ + source = new String( source + + "// " + src.description + "\n" + + "class "+ testname + "{\n" + + " String data = \"test\";\n" + + " boolean dataIsString = ( data instanceof _As_ _Bs_ String str && str.isEmpty());\n" + + "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + + "\n\n"; + hasInnerClass=false; + break; case src8: // (repeating) type annotations in use of instanceof /* * class Test20{ * String data = "test"; * Boolean isString() {
*** 409,418 **** --- 431,466 ---- " }\n" + "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + "\n\n"; hasInnerClass=false; break; + case src8p: // (repeating) type annotations in use of instanceof with type test pattern + /* + * class Test20{ + * String data = "test"; + * Boolean isString() { + * if( data instanceof @A @B @A @B String ) + * return true; + * else + * return( data instanceof @A @B @A @B String ); + * } + * } + */ + source = new String( source + + "// " + src.description + "\n" + + "class "+ testname + "{\n" + + " String data = \"test\";\n" + + " Boolean isString() { \n" + + " if( data instanceof _As_ _Bs_ String str)\n" + + " return true;\n" + + " else\n" + + " return( data instanceof _As_ _Bs_ String str && str.isEmpty());\n" + + " }\n" + + "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + + "\n\n"; + hasInnerClass=false; + break; } return imports + source; } }
< prev index next >