langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java
changeset 24896 986d876a9121
parent 17578 46ac954e4a84
child 30730 d3ce7619db2c
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java	Fri Jun 06 16:00:59 2014 -0400
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java	Fri Jun 06 16:08:46 2014 -0400
@@ -25,53 +25,46 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method exception clauses
  * @compile -g Driver.java ReferenceInfoUtil.java MethodThrows.java
  * @run main Driver MethodThrows
  */
 public class MethodThrows {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String regularMethod() {
-        return "class Test { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception { } }";
+        return "class %TEST_CLASS_NAME% { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String abstractMethod() {
-        return "abstract class Test { abstract void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
+        return "abstract class %TEST_CLASS_NAME% { abstract void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String interfaceMethod() {
-        return "interface Test { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
+        return "interface %TEST_CLASS_NAME% { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0,
-                       genericLocation = {}),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 0,
-                       genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = THROWS, typeIndex = 0,
-                       genericLocation = {1, 0, 1, 0}),
-        @TADescription(annotation = "TD", type = THROWS, typeIndex = 1,
-                       genericLocation = {}),
-        @TADescription(annotation = "TE", type = THROWS, typeIndex = 1,
-                       genericLocation = {1, 0}),
-        @TADescription(annotation = "TF", type = THROWS, typeIndex = 1,
-                       genericLocation = {1, 0, 1, 0})
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0,
+                   genericLocation = {})
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 0,
+                   genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = THROWS, typeIndex = 0,
+                   genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "TD", type = THROWS, typeIndex = 1,
+                   genericLocation = {})
+    @TADescription(annotation = "TE", type = THROWS, typeIndex = 1,
+                   genericLocation = {1, 0})
+    @TADescription(annotation = "TF", type = THROWS, typeIndex = 1,
+                   genericLocation = {1, 0, 1, 0})
     public String NestedTypes() {
         return "class Outer { class Middle { class Inner1 extends Exception {}" +
                 "  class Inner2 extends Exception{} } }" +
-                "class Test { void test() throws @TA Outer.@TB Middle.@TC Inner1, @TD Outer.@TE Middle.@TF Inner2 { } }";
+                "class %TEST_CLASS_NAME% { void test() throws @TA Outer.@TB Middle.@TC Inner1, @TD Outer.@TE Middle.@TF Inner2 { } }";
     }
 }