Mon, 03 May 2010 17:12:59 -0700
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
Reviewed-by: jjg, darcy
jjg@338 | 1 | /* |
jjg@338 | 2 | * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. |
jjg@338 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@338 | 4 | * |
jjg@338 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@338 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jjg@338 | 7 | * published by the Free Software Foundation. |
jjg@338 | 8 | * |
jjg@338 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@338 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@338 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@338 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@338 | 13 | * accompanied this code). |
jjg@338 | 14 | * |
jjg@338 | 15 | * You should have received a copy of the GNU General Public License version |
jjg@338 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@338 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@338 | 18 | * |
jjg@338 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
jjg@338 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
jjg@338 | 21 | * have any questions. |
jjg@338 | 22 | */ |
jjg@338 | 23 | |
jjg@338 | 24 | import java.io.*; |
jjg@338 | 25 | |
jjg@338 | 26 | /* |
jjg@338 | 27 | * @test |
jjg@338 | 28 | * @bug 6855990 |
jjg@338 | 29 | * @summary InstructionDetailWriter should support new 308 annotations attribute |
jjg@338 | 30 | */ |
jjg@338 | 31 | |
jjg@338 | 32 | public class T6855990 { |
jjg@338 | 33 | public static void main(String[] args) throws Exception { |
jjg@338 | 34 | new T6855990().run(); |
jjg@338 | 35 | } |
jjg@338 | 36 | |
jjg@338 | 37 | public void run() throws Exception { |
jjg@338 | 38 | @Simple String[] args = { "-c", "-XDdetails:typeAnnotations", "T6855990" }; |
jjg@338 | 39 | StringWriter sw = new StringWriter(); |
jjg@338 | 40 | PrintWriter pw = new PrintWriter(sw); |
jjg@338 | 41 | int rc = com.sun.tools.javap.Main.run(args, pw); |
jjg@338 | 42 | pw.close(); |
jjg@338 | 43 | String out = sw.toString(); |
jjg@338 | 44 | System.out.println(out); |
jjg@338 | 45 | if (out.indexOf("@Simple: LOCAL_VARIABLE") == -1) |
jjg@338 | 46 | throw new Exception("expected output not found"); |
jjg@338 | 47 | } |
jjg@338 | 48 | } |
jjg@338 | 49 | |
jjg@338 | 50 | @interface Simple { } |
jjg@338 | 51 |