Thu, 15 Jul 2010 16:31:02 +0100
6967002: JDK7 b99 javac compilation error (java.lang.AssertionError)
Summary: bug in JavacParser related to parsing of type annotations in varargs position
Reviewed-by: jjg
Contributed-by: mahmood@notnoop.com
jjg@338 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. 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 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * 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 |