--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java Fri Jun 06 16:00:59 2014 -0400
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java Fri Jun 06 16:08:46 2014 -0400
@@ -25,7 +25,7 @@
/*
* @test
- * @bug 8006732 8006775
+ * @bug 8006732 8006775 8042451
* @summary Test population of reference info for multicatch exception parameters
* @author Werner Dietl
* @compile -g Driver.java ReferenceInfoUtil.java MultiCatch.java
@@ -33,35 +33,59 @@
*/
public class MultiCatch {
- @TADescriptions({
- @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
- @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
- })
+ @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+ @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
public String multiCatch1() {
return "void multiCatch1() { " +
"try { new Object(); } catch (@TA NullPointerException | @TB IndexOutOfBoundsException e) { e.toString(); } }";
}
- @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 multiCatch2() {
return "void multiCatch2() { " +
"try { new Object(); } catch (@TA NullPointerException | @TB IndexOutOfBoundsException | @TC IllegalArgumentException e) { e.toString(); } }";
}
- @TADescriptions({
- @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
- @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
- @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2),
- @TADescription(annotation = "TD", type = EXCEPTION_PARAMETER, exceptionIndex = 2),
- @TADescription(annotation = "TE", type = EXCEPTION_PARAMETER, exceptionIndex = 3),
- })
+ @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+ @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+ @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+ @TADescription(annotation = "TD", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+ @TADescription(annotation = "TE", type = EXCEPTION_PARAMETER, exceptionIndex = 3)
public String multiCatch3() {
return "void multiCatch3() { " +
"try { new Object(); } catch (NullPointerException e1) {}" +
"try { new Object(); } catch (@TA @TB NullPointerException | @TC @TD IndexOutOfBoundsException | @TE IllegalArgumentException e2) { e2.toString(); } }";
}
+
+ @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+ @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+ public String multiCatchRepeatableAnnotation1() {
+ return "void multiCatch1() { " +
+ "try { new Object(); } catch (@RTA @RTA NullPointerException |" +
+ " @RTB @RTB IndexOutOfBoundsException e) { e.toString(); } }";
+ }
+
+ @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 multiCatchRepeatableAnnotation2() {
+ return "void multiCatch2() { " +
+ "try { new Object(); } catch (@RTA @RTA NullPointerException |" +
+ " @RTB @RTB IndexOutOfBoundsException | @RTC @RTC IllegalArgumentException e) { e.toString(); } }";
+ }
+
+ @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+ @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+ @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+ @TADescription(annotation = "RTDs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+ @TADescription(annotation = "RTEs", type = EXCEPTION_PARAMETER, exceptionIndex = 3)
+ public String multiCatchRepeatableAnnotation3() {
+ return "void multiCatch3() { " +
+ "try { new Object(); } catch (NullPointerException e1) {}" +
+ "try { new Object(); } catch (@RTA @RTA @RTB @RTB NullPointerException |" +
+ " @RTC @RTC @RTD @RTD IndexOutOfBoundsException |" +
+ " @RTE @RTE IllegalArgumentException e2) { e2.toString(); } }";
+ }
}