--- old/test/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest2.java Mon Feb 11 14:03:43 2013 +++ new/test/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest2.java Mon Feb 11 14:03:43 2013 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,6 @@ /* * @test * @bug 8005085 8005877 8004829 8005681 8006734 8006775 - * @ignore * @summary Combinations of Target ElementTypes on (repeated)type annotations. */ @@ -100,11 +99,11 @@ et2 + ", src=" + source; // Uncomment this block to run the tests but skip failing scenarios. -// // 8005681 - skip cases with repeated annotations on new, array, cast. -// if((source==3 || source==8 || source==9) && (ABmix || (Arepeats && BDrepeats))) { -// System.out.println(testDef+"\n8005681-skip repeated annotations on new,array,cast"); -// return; -// } + // 8005681 - skip cases with repeated annotations on new, array, cast. + if((source==3 || source==8 || source==9) && (ABmix || (Arepeats && BDrepeats))) { + System.out.println(testDef+"\n8005681-skip repeated annotations on new,array,cast"); + return; + } println(testDef); // Create test source and File. @@ -194,11 +193,11 @@ "@Retention("+retentn+")\n" + "@Target({TYPE_USE,TYPE_PARAMETER,_OTHER_})\n" + - "@interface DC { D[] value(); }\n\n"); + "@interface DC { D[] value(); }\n"); // Test case sources with sample generated source switch(src) { - case 3: // (repeating) type annotations on field in method body + case 3: // (repeating) type annotations new,array level and cast /* * class Test1 { * Test1(){} @@ -209,7 +208,8 @@ * return (@A @B String) null; * }} */ - source = new String( + source = new String( source + + "//case3: (repeating) type annotations new,array level and cast\n" + "class " + testname + " {\n" + "" + testname +"(){} \n" + "// type usage in method body \n" + @@ -218,8 +218,8 @@ " _As_ _Bs_\n Object o = new _As_ _Bs_ String _As_ _Bs_ [3]; \n" + " return (_As_ _Bs_ String) null; \n" + "} \n" + - "} \n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + - "\n\n"; + "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + + "\n"; break; case 8: // (repeating) annotations on type parameters, bounds and type arguments in new statement. /* @@ -232,7 +232,7 @@ * } */ source = new String( source + - "// (repeating) annotations on type parameters, bounds and type arguments. \n" + + "//case8: (repeating) annotations on type parameters, bounds and type arguments. \n" + "class " + testname + " {\n" + " Map, Integer> map =\n" + " new HashMap<_As_ _Bs_ List<_As_ _Bs_ String>, _As_ _Bs_ Integer>();\n" + @@ -239,8 +239,8 @@ " Map, Integer> map2 = new _As_ _Bs_ HashMap<>();\n" + " String test(" + testname + " this) { return null;}\n" + " String genericMethod(T t) { return null; }\n" + - "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + - "\n\n"; + "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + + "\n"; break; case 9: // (repeating)annotations on type parameters of class, method return value in method. /* @@ -258,7 +258,7 @@ * } */ source = new String( source + - "// (repeating)annotations on type parameters of class, method return value in method. \n" + + "//case9: (repeating)annotations on type parameters of class, method return value in method. \n" + "class "+ testname + "{\n" + " Map, E > foo(E e) {\n" + " class maptest {\n" + // inner class $1maptest @@ -270,12 +270,11 @@ " return new maptest().getMap();\n" + " }\n" + " Map,String> shm = foo(new String(\"hello\"));\n" + - "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + - "\n\n"; + "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + + "\n"; hasInnerClass=true; innerClassname="$1maptest"; break; - } return imports + source; }