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
bpatel@1476 | 1 | /* |
bpatel@1476 | 2 | * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
bpatel@1476 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bpatel@1476 | 4 | * |
bpatel@1476 | 5 | * This code is free software; you can redistribute it and/or modify it |
bpatel@1476 | 6 | * under the terms of the GNU General Public License version 2 only, as |
bpatel@1476 | 7 | * published by the Free Software Foundation. |
bpatel@1476 | 8 | * |
bpatel@1476 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
bpatel@1476 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bpatel@1476 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bpatel@1476 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
bpatel@1476 | 13 | * accompanied this code). |
bpatel@1476 | 14 | * |
bpatel@1476 | 15 | * You should have received a copy of the GNU General Public License version |
bpatel@1476 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
bpatel@1476 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bpatel@1476 | 18 | * |
bpatel@1476 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
bpatel@1476 | 20 | * or visit www.oracle.com if you need additional information or have any |
bpatel@1476 | 21 | * questions. |
bpatel@1476 | 22 | */ |
bpatel@1476 | 23 | |
bpatel@1476 | 24 | /* |
bpatel@1476 | 25 | * @test |
bpatel@1476 | 26 | * @bug 8004891 |
bpatel@1476 | 27 | * @summary Make sure that the abstract method is identified correctly |
bpatel@1476 | 28 | * if the abstract modifier is present explicitly or implicitly. |
bpatel@1476 | 29 | * @author bpatel |
bpatel@1476 | 30 | * @library ../lib/ |
bpatel@1476 | 31 | * @build JavadocTester TestAbstractMethod |
bpatel@1476 | 32 | * @run main TestAbstractMethod |
bpatel@1476 | 33 | */ |
bpatel@1476 | 34 | |
bpatel@1476 | 35 | public class TestAbstractMethod extends JavadocTester { |
bpatel@1476 | 36 | |
bpatel@1476 | 37 | //Test information. |
bpatel@1476 | 38 | private static final String BUG_ID = "8004891"; |
bpatel@1476 | 39 | |
bpatel@1476 | 40 | //Javadoc arguments. |
bpatel@1476 | 41 | private static final String[] ARGS = new String[] { |
bpatel@1476 | 42 | "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" |
bpatel@1476 | 43 | }; |
bpatel@1476 | 44 | |
bpatel@1476 | 45 | //Input for string search tests. |
bpatel@1476 | 46 | private static final String[][] TEST = { |
bpatel@1476 | 47 | {BUG_ID + FS + "pkg" + FS + "A.html", |
bpatel@1476 | 48 | "<td class=\"colFirst\"><code>default void</code></td>"}, |
bpatel@1476 | 49 | {BUG_ID + FS + "pkg" + FS + "A.html", |
bpatel@1476 | 50 | "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
bpatel@1476 | 51 | "All Methods</span><span class=\"tabEnd\"> </span></span>" + |
bpatel@1476 | 52 | "<span id=\"t2\" class=\"tableTab\"><span>" + |
bpatel@1476 | 53 | "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
bpatel@1476 | 54 | "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + |
bpatel@1476 | 55 | "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + |
bpatel@1476 | 56 | "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + |
bpatel@1476 | 57 | "</span><span id=\"t5\" class=\"tableTab\"><span>" + |
bpatel@1476 | 58 | "<a href=\"javascript:show(16);\">Default Methods</a></span>" + |
bpatel@1476 | 59 | "<span class=\"tabEnd\"> </span></span></caption>"}, |
bpatel@1476 | 60 | {BUG_ID + FS + "pkg" + FS + "B.html", |
bpatel@1476 | 61 | "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
bpatel@1476 | 62 | "All Methods</span><span class=\"tabEnd\"> </span></span>" + |
bpatel@1476 | 63 | "<span id=\"t2\" class=\"tableTab\"><span>" + |
bpatel@1476 | 64 | "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
bpatel@1476 | 65 | "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + |
bpatel@1476 | 66 | "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " + |
bpatel@1476 | 67 | "Methods</a></span><span class=\"tabEnd\"> </span></span>" + |
bpatel@1476 | 68 | "<span id=\"t4\" class=\"tableTab\"><span>" + |
bpatel@1476 | 69 | "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" + |
bpatel@1476 | 70 | "<span class=\"tabEnd\"> </span></span></caption>"}, |
bpatel@1476 | 71 | {BUG_ID + FS + "pkg" + FS + "B.html", |
bpatel@1476 | 72 | "<td class=\"colFirst\"><code>abstract void</code></td>"}, |
bpatel@1476 | 73 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@1476 | 74 | "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
bpatel@1476 | 75 | "All Methods</span><span class=\"tabEnd\"> </span></span>" + |
bpatel@1476 | 76 | "<span id=\"t2\" class=\"tableTab\"><span>" + |
bpatel@1476 | 77 | "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
bpatel@1476 | 78 | "<span class=\"tabEnd\"> </span></span>" + |
bpatel@1476 | 79 | "<span id=\"t5\" class=\"tableTab\"><span>" + |
bpatel@1476 | 80 | "<a href=\"javascript:show(16);\">Default Methods</a></span>" + |
bpatel@1476 | 81 | "<span class=\"tabEnd\"> </span></span></caption>"}, |
bpatel@1476 | 82 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@1476 | 83 | "<td class=\"colFirst\"><code>default void</code></td>"} |
bpatel@1476 | 84 | }; |
bpatel@1476 | 85 | private static final String[][] NEGATED_TEST = { |
bpatel@1476 | 86 | {BUG_ID + FS + "pkg" + FS + "A.html", |
bpatel@1476 | 87 | "<td class=\"colFirst\"><code>abstract void</code></td>"}, |
bpatel@1476 | 88 | {BUG_ID + FS + "pkg" + FS + "B.html", |
bpatel@1476 | 89 | "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + |
bpatel@1476 | 90 | "<span class=\"tabEnd\"> </span>"}, |
bpatel@1476 | 91 | {BUG_ID + FS + "pkg" + FS + "B.html", |
bpatel@1476 | 92 | "<td class=\"colFirst\"><code>default void</code></td>"}, |
bpatel@1476 | 93 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@1476 | 94 | "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + |
bpatel@1476 | 95 | "<span class=\"tabEnd\"> </span>"} |
bpatel@1476 | 96 | }; |
bpatel@1476 | 97 | |
bpatel@1476 | 98 | /** |
bpatel@1476 | 99 | * The entry point of the test. |
bpatel@1476 | 100 | * @param args the array of command line arguments. |
bpatel@1476 | 101 | */ |
bpatel@1476 | 102 | public static void main(String[] args) { |
bpatel@1476 | 103 | TestAbstractMethod tester = new TestAbstractMethod(); |
bpatel@1476 | 104 | run(tester, ARGS, TEST, NEGATED_TEST); |
bpatel@1476 | 105 | tester.printSummary(); |
bpatel@1476 | 106 | } |
bpatel@1476 | 107 | |
bpatel@1476 | 108 | /** |
bpatel@1476 | 109 | * {@inheritDoc} |
bpatel@1476 | 110 | */ |
bpatel@1476 | 111 | public String getBugId() { |
bpatel@1476 | 112 | return BUG_ID; |
bpatel@1476 | 113 | } |
bpatel@1476 | 114 | |
bpatel@1476 | 115 | /** |
bpatel@1476 | 116 | * {@inheritDoc} |
bpatel@1476 | 117 | */ |
bpatel@1476 | 118 | public String getBugName() { |
bpatel@1476 | 119 | return getClass().getName(); |
bpatel@1476 | 120 | } |
bpatel@1476 | 121 | } |