Wed, 01 Dec 2010 11:02:38 -0800
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
Reviewed-by: jjg
darcy@609 | 1 | /* |
darcy@609 | 2 | * @test /nodynamiccopyright/ |
darcy@609 | 3 | * @bug 6911256 6964740 |
darcy@609 | 4 | * @author Joseph D. Darcy |
darcy@609 | 5 | * @summary Test exception analysis of ARM blocks |
darcy@609 | 6 | * @compile/fail/ref=TwrFlow.out -XDrawDiagnostics TwrFlow.java |
darcy@609 | 7 | */ |
darcy@609 | 8 | |
darcy@609 | 9 | import java.io.IOException; |
darcy@609 | 10 | public class TwrFlow implements AutoCloseable { |
darcy@609 | 11 | public static void main(String... args) { |
darcy@609 | 12 | try(TwrFlow armflow = new TwrFlow()) { |
darcy@609 | 13 | System.out.println(armflow.toString()); |
darcy@609 | 14 | } catch (IOException ioe) { // Not reachable |
darcy@609 | 15 | throw new AssertionError("Shouldn't reach here", ioe); |
darcy@609 | 16 | } |
darcy@609 | 17 | // CustomCloseException should be caught or added to throws clause |
darcy@609 | 18 | |
darcy@609 | 19 | // Also check behavior on a resource expression rather than a |
darcy@609 | 20 | // declaration. |
darcy@609 | 21 | TwrFlow armflowexpr = new TwrFlow(); |
darcy@609 | 22 | try(armflowexpr) { |
darcy@609 | 23 | System.out.println(armflowexpr.toString()); |
darcy@609 | 24 | } catch (IOException ioe) { // Not reachable |
darcy@609 | 25 | throw new AssertionError("Shouldn't reach here", ioe); |
darcy@609 | 26 | } |
darcy@609 | 27 | // CustomCloseException should be caught or added to throws clause |
darcy@609 | 28 | } |
darcy@609 | 29 | |
darcy@609 | 30 | /* |
darcy@609 | 31 | * A close method, but the class is <em>not</em> Closeable or |
darcy@609 | 32 | * AutoCloseable. |
darcy@609 | 33 | */ |
darcy@609 | 34 | public void close() throws CustomCloseException { |
darcy@609 | 35 | throw new CustomCloseException(); |
darcy@609 | 36 | } |
darcy@609 | 37 | } |
darcy@609 | 38 | |
darcy@609 | 39 | class CustomCloseException extends Exception {} |