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