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) 2003, 2005, 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 4663254
27 * @summary Verify that spaces do not appear in hrefs and anchors.
28 * @author jamieh
29 * @library ../lib/
30 * @build JavadocTester
31 * @build TestHref
32 * @run main TestHref
33 */
35 public class TestHref extends JavadocTester {
37 //Test information.
38 private static final String BUG_ID = "4663254";
40 //Javadoc arguments.
41 private static final String[] ARGS = new String[] {
42 "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "-linkoffline",
43 "http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, "pkg"
44 };
46 //Input for string search tests.
47 private static final String[][] TEST = {
48 //External link.
49 {BUG_ID + FS + "pkg" + FS + "C1.html",
50 "HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long, int)\""
51 },
52 //Member summary table link.
53 {BUG_ID + FS + "pkg" + FS + "C1.html",
54 "HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\""
55 },
56 //Anchor test.
57 {BUG_ID + FS + "pkg" + FS + "C1.html",
58 "<A NAME=\"method(int, int, java.util.ArrayList)\"><!-- --></A>"
59 },
60 //Backward compatibility anchor test.
61 {BUG_ID + FS + "pkg" + FS + "C1.html",
62 "<A NAME=\"method(int, int, java.util.ArrayList)\"><!-- --></A>"
63 },
64 //{@link} test.
65 {BUG_ID + FS + "pkg" + FS + "C2.html",
66 "Link: <A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
67 },
68 //@see test.
69 {BUG_ID + FS + "pkg" + FS + "C2.html",
70 "See Also:</STRONG></DT><DD><A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
71 },
73 //Header does not link to the page itself.
74 {BUG_ID + FS + "pkg" + FS + "C4.html",
75 "Class C4<E extends C4<E>></H2>"
76 },
78 //Signature does not link to the page itself.
79 {BUG_ID + FS + "pkg" + FS + "C4.html",
80 "public abstract class <STRONG>C4<E extends C4<E>></STRONG>"
81 },
82 };
83 private static final String[][] NEGATED_TEST =
84 {
85 {WARNING_OUTPUT, "<a> tag is malformed"}
86 };
88 /**
89 * The entry point of the test.
90 * @param args the array of command line arguments.
91 */
92 public static void main(String[] args) {
93 TestHref tester = new TestHref();
94 run(tester, ARGS, TEST, NEGATED_TEST);
95 tester.printSummary();
96 }
98 /**
99 * {@inheritDoc}
100 */
101 public String getBugId() {
102 return BUG_ID;
103 }
105 /**
106 * {@inheritDoc}
107 */
108 public String getBugName() {
109 return getClass().getName();
110 }
111 }