Mon, 16 Sep 2013 14:13:44 +0200
8021112: Spurious unchecked warning reported by javac
6480588: No way to suppress deprecation warnings when implementing deprecated interface
Summary: Fixing DeferredLintHandler configuration, so lint warnings are reported with correct @SuppressWarnings settings
Reviewed-by: jjg, vromero
1 /*
2 * Copyright (c) 2009, 2010, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 /*
27 * @test
28 * @bug 6786682
29 * @summary This test verifies the use of lang attribute by <HTML>.
30 * @author Bhavesh Patel
31 * @library ../lib/
32 * @build JavadocTester
33 * @build TestHtmlTag
34 * @run main TestHtmlTag
35 */
37 import java.util.Locale;
39 public class TestHtmlTag extends JavadocTester {
41 private static final String BUG_ID = "6786682";
42 private static final String[][] TEST1 = {
43 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"},
44 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
45 private static final String[][] NEGATED_TEST1 = {
46 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
47 private static final String[][] TEST2 = {
48 {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html lang=\"ja\">"},
49 {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<html lang=\"ja\">"}};
50 private static final String[][] NEGATED_TEST2 = {
51 {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html>"}};
52 private static final String[][] TEST3 = {
53 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"en\">"},
54 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"en\">"}};
55 private static final String[][] NEGATED_TEST3 = {
56 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
58 private static final String[] ARGS1 =
59 new String[] {
60 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
61 private static final String[] ARGS2 =
62 new String[] {
63 "-locale", "ja", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"};
64 private static final String[] ARGS3 =
65 new String[] {
66 "-locale", "en_US", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
68 /**
69 * The entry point of the test.
70 * @param args the array of command line arguments.
71 */
72 public static void main(String[] args) {
73 TestHtmlTag tester = new TestHtmlTag();
74 run(tester, ARGS1, TEST1, NEGATED_TEST1);
75 run(tester, ARGS2, TEST2, NEGATED_TEST2);
76 run(tester, ARGS3, TEST3, NEGATED_TEST3);
77 tester.printSummary();
78 }
80 /**
81 * {@inheritDoc}
82 */
83 public String getBugId() {
84 return BUG_ID;
85 }
87 /**
88 * {@inheritDoc}
89 */
90 public String getBugName() {
91 return getClass().getName();
92 }
93 }