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
1 /*
2 * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 /*
25 * @test
26 * @bug 4232882
27 * @summary Javadoc strips all of the leading spaces when the comment
28 * does not begin with a star. This RFE allows users to
29 * begin their comment without a leading star without leading
30 * spaces striped
31 * @author jamieh
32 * @library ../lib/
33 * @build JavadocTester
34 * @build LeadingSpaces
35 * @run main LeadingSpaces
36 */
38 public class LeadingSpaces extends JavadocTester {
40 private static final String BUG_ID = "4232882";
41 private static final String[][] TEST = {
42 {BUG_ID + FS + "LeadingSpaces.html",
43 " 1\n" +
44 " 2\n" +
45 " 3\n" +
46 " 4\n" +
47 " 5\n" +
48 " 6\n" +
49 " 7"}
50 };
51 private static final String[][] NEGATED_TEST = NO_TEST;
52 private static final String[] ARGS =
53 new String[] {
54 "-d", BUG_ID, "-sourcepath", SRC_DIR,
55 SRC_DIR + FS + "LeadingSpaces.java"};
57 /**
58 * The entry point of the test.
59 * @param args the array of command line arguments.
60 */
61 public static void main(String[] args) {
62 LeadingSpaces tester = new LeadingSpaces();
63 run(tester, ARGS, TEST, NEGATED_TEST);
64 tester.printSummary();
65 }
67 /**
68 * {@inheritDoc}
69 */
70 public String getBugId() {
71 return BUG_ID;
72 }
74 /**
75 * {@inheritDoc}
76 */
77 public String getBugName() {
78 return getClass().getName();
79 }
81 /**
82 This leading spaces in the <pre> block below should be
83 preserved.
84 <pre>
85 1
86 2
87 3
88 4
89 5
90 6
91 7
92 </pre>
93 */
94 public void method(){}
96 }