test/tools/javac/multicatch/Neg05.java

Wed, 01 Dec 2010 11:02:38 -0800

author
bpatel
date
Wed, 01 Dec 2010 11:02:38 -0800
changeset 766
90af8d87741f
parent 735
f2048d9c666e
permissions
-rw-r--r--

6851834: Javadoc doclet needs a structured approach to generate the output HTML.
Reviewed-by: jjg

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