test/tools/javac/multicatch/Neg05.java

Thu, 24 Feb 2011 08:40:49 -0800

author
jjh
date
Thu, 24 Feb 2011 08:40:49 -0800
changeset 892
3e30c95da3c6
parent 735
f2048d9c666e
permissions
-rw-r--r--

7018753: tools/javac/varargs/warning/Warn5.java times out on slow machines
Summary: Use a single file manager for all JavacTasks
Reviewed-by: jjg, mcimadamore

mcimadamore@735 1 /*
mcimadamore@735 2 * @test /nodynamiccopyright/
mcimadamore@735 3 * @bug 6943289
mcimadamore@735 4 *
mcimadamore@735 5 * @summary Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore@735 6 * @author mcimadamore
mcimadamore@735 7 * @compile/fail/ref=Neg05.out -XDrawDiagnostics Neg05.java
mcimadamore@735 8 *
mcimadamore@735 9 */
mcimadamore@735 10
mcimadamore@735 11 class Neg02 {
mcimadamore@735 12
mcimadamore@735 13 static class Foo<X> {
mcimadamore@735 14 Foo(X x) {}
mcimadamore@735 15 }
mcimadamore@735 16
mcimadamore@735 17 static interface Base<X> {}
mcimadamore@735 18 static class A extends Exception implements Base<String> {}
mcimadamore@735 19 static class B extends Exception implements Base<Integer> {}
mcimadamore@735 20
mcimadamore@735 21 void m() {
mcimadamore@735 22 try {
mcimadamore@735 23 if (true) {
mcimadamore@735 24 throw new A();
mcimadamore@735 25 }
mcimadamore@735 26 else {
mcimadamore@735 27 throw new B();
mcimadamore@735 28 }
mcimadamore@735 29 } catch (A | B ex) {
mcimadamore@735 30 Foo<?> f = new Foo<>(ex);
mcimadamore@735 31 }
mcimadamore@735 32 }
mcimadamore@735 33 }

mercurial