langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java
changeset 24896 986d876a9121
parent 22443 0922d94d0576
child 30730 d3ce7619db2c
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java	Fri Jun 06 16:00:59 2014 -0400
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java	Fri Jun 06 16:08:46 2014 -0400
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @bug 8028576
+ * @bug 8028576 8042451
  * @summary Test population of reference info for exception parameters
  * @author Werner Dietl
  * @compile -g Driver.java ReferenceInfoUtil.java ExceptionParameters.java
@@ -43,11 +43,9 @@
         return "void finalException() { try { new Object(); } catch(final @TA Exception e) { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions1() {
         return "void multipleExceptions() { " +
             "try { new Object(); } catch(@TA Exception e) { }" +
@@ -56,11 +54,9 @@
             " }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions2() {
         return "void multipleExceptions() { " +
             "  try { new Object(); " +
@@ -71,11 +67,9 @@
             "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions3() {
         return "void multipleExceptions() { " +
             "  try { new Object(); " +
@@ -87,4 +81,48 @@
             "  }" +
             "}";
     }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    public String exceptionRepeatableAnnoation() {
+        return "void exception() { try { new Object(); } catch(@RTA @RTA Exception e) { } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation1() {
+        return "void multipleExceptions() { " +
+                "try { new Object(); } catch(@RTA @RTA Exception e) { }" +
+                "try { new Object(); } catch(@RTB @RTB Exception e) { }" +
+                "try { new Object(); } catch(@RTC @RTC Exception e) { }" +
+                " }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation2() {
+        return "void multipleExceptions() { " +
+                "  try { new Object(); " +
+                "    try { new Object(); " +
+                "      try { new Object(); } catch(@RTA @RTA Exception e) { }" +
+                "    } catch(@RTB @RTB Exception e) { }" +
+                "  } catch(@RTC @RTC Exception e) { }" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation3() {
+        return "void multipleExceptions() { " +
+                "  try { new Object(); " +
+                "  } catch(@RTA @RTA Exception e1) { "+
+                "    try { new Object(); " +
+                "    } catch(@RTB @RTB Exception e2) {" +
+                "      try { new Object(); } catch(@RTC @RTC Exception e3) { }" +
+                "    }" +
+                "  }" +
+                "}";
+    }
 }