author | bobv |
Tue, 07 Nov 2017 10:30:53 -0500 | |
changeset 47801 | c7b50c23ea71 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
1 |
/* |
44287
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
4 |
* |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
8 |
* |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
13 |
* accompanied this code). |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
14 |
* |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
18 |
* |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
21 |
* questions. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
22 |
*/ |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
23 |
|
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
24 |
/** |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
25 |
* @test |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
26 |
* @bug 6551367 |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
27 |
* @summary javadoc throws ClassCastException when an link tag tries to reference constructor. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
28 |
* @author A. Sundararajan |
36526 | 29 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
30 |
* @run main T6551367 T6551367.java |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
31 |
*/ |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
32 |
|
36526 | 33 |
/* |
34 |
* ***NOTE: This is not a tool test!, should be moved to doclets.*** |
|
35 |
*/ |
|
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
36 |
import java.io.File; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
37 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
38 |
import jdk.javadoc.doclet.DocletEnvironment; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
39 |
|
36526 | 40 |
public class T6551367 { |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
41 |
public T6551367() {} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
42 |
public boolean run(DocletEnvironment root) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
43 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
44 |
} |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
45 |
/** Here, in the javadoc for this method, I try to link to |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
46 |
* {@link #<init> a constructor}. |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
47 |
*/ |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
48 |
public static void main(String... args) { |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
49 |
File testSrc = new File(System.getProperty("test.src", ".")); |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
50 |
File destDir = new File(System.getProperty("user.dir", ".")); |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
51 |
for (String file : args) { |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
52 |
File source = new File(testSrc, file); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
53 |
String[] array = { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
54 |
"-Xdoclint:none", |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
55 |
source.getPath(), |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
56 |
"-d", |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
57 |
destDir.getAbsolutePath() |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
58 |
}; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
59 |
|
44287
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
36526
diff
changeset
|
60 |
int rc = jdk.javadoc.internal.tool.Main.execute(array); |
7071
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
61 |
if (rc != 0) |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
62 |
throw new Error("unexpected exit from javadoc: " + rc); |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
63 |
} |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
64 |
} |
8bcda461a06a
6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff
changeset
|
65 |
} |