langtools/test/tools/javadoc/T6551367.java
author lana
Thu, 21 Jan 2016 09:46:01 -0800
changeset 35340 38f7386ed942
parent 30730 d3ce7619db2c
permissions -rw-r--r--
Added tag jdk-9+102 for changeset 7e3feb2ba5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7071
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 15354
diff changeset
     2
 * Copyright (c) 2010, 2015, 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
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 15354
diff changeset
    29
 * @modules jdk.javadoc/com.sun.tools.doclets.standard
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
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    33
import com.sun.javadoc.*;
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    34
import java.io.File;
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    35
import static com.sun.tools.javadoc.Main.execute;
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    36
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    37
public class T6551367 extends com.sun.tools.doclets.standard.Standard {
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    38
    public T6551367() {}
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    39
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    40
    /** 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
    41
     *  {@link #<init> a constructor}.
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    42
     */
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    43
    public static void main(String... args) {
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    44
        File testSrc = new File(System.getProperty("test.src", "."));
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    45
        File destDir = new File(System.getProperty("user.dir", "."));
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    46
        for (String file : args) {
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    47
            File source = new File(testSrc, file);
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    48
            int rc = execute("javadoc", "T6551367",
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    49
              T6551367.class.getClassLoader(),
15354
52a04c670c05 8004834: Add doclint support into javadoc
jjg
parents: 7071
diff changeset
    50
              new String[]{"-Xdoclint:none", source.getPath(), "-d", destDir.getAbsolutePath()});
7071
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    51
            if (rc != 0)
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    52
                throw new Error("unexpected exit from javadoc: " + rc);
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    53
        }
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    54
    }
8bcda461a06a 6551367: javadoc throws ClassCastException when an @link tries to reference constructor.
sundar
parents:
diff changeset
    55
}