test/langtools/tools/doclint/ValidTest.java
author dlong
Thu, 31 Oct 2019 16:54:16 -0700
changeset 58877 aec7bf35d6f5
parent 47216 71c04702a3d5
permissions -rw-r--r--
8233273: Update Graal Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14952
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25452
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
14952
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     4
 *
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     8
 *
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    13
 * accompanied this code).
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    14
 *
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    18
 *
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    21
 * questions.
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    22
 */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    23
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    24
/*
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    25
 * @test
25452
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    26
 * @bug 8004832 8048806
14962
19ffdfafbcd2 8005307: fix missing @bug tags
jjg
parents: 14952
diff changeset
    27
 * @summary Add new doclint package
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 25452
diff changeset
    28
 * @modules jdk.compiler/com.sun.tools.doclint
14952
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    29
 * @build DocLintTester
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    30
 * @run main DocLintTester ValidTest.java
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    31
 */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    32
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    33
class ValidTest {
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    34
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    35
     * < > & (
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    36
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    37
    void entities() { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    38
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    39
    /**
25452
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    40
     * <abbr>abbreviation<abbr>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    41
     * <acronym>ABC</acronym>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    42
     * <cite>citation</cite>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    43
     * <code>code</code>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    44
     * <dfn>defining instance</dfn>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    45
     * <em>emphasis</em>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    46
     * <kbd>keyboard<kbd>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    47
     * <samp>sample</samp>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    48
     * <var>variable</var>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    49
     * <strong>strong</strong>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    50
     */
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    51
    void phraseElements() { }
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    52
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    53
    /**
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    54
     * <address>1 Main St., USA</address>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    55
     */
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    56
    void address() { }
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    57
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    58
    /**
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    59
     * <del>deleted</del>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    60
     * <ins>inserted</del>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    61
     */
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    62
    void docChanges() {}
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    63
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    64
    /**
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    65
     * <blockquote>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    66
     * A fine thing.
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    67
     * </blockquote>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    68
     * <q>A fine thing.</q>
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    69
     */
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    70
581d57f5c7d8 8048806: Javadoc errors out on some valid HTML tags
jjg
parents: 14962
diff changeset
    71
    /**
14952
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    72
     * <h1> ... </h1>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    73
     * <h2> ... </h2>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    74
     * <h3> ... </h3>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    75
     * <h4> ... </h4>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    76
     * <h5> ... </h5>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    77
     * <h6> ... </h6>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    78
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    79
    void all_headers() { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    80
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    81
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    82
     * <h1> ... </h1>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    83
     * <h2> ... </h2>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    84
     * <h3> ... </h3>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    85
     * <h1> ... </h1>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    86
     * <h2> ... </h2>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    87
     * <h3> ... </h3>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    88
     * <h2> ... </h2>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    89
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    90
    void header_series() { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    91
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    92
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    93
     * <div> <p>   </div>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    94
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    95
    void autoclose_tags() { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    96
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    97
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    98
     * @param x
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
    99
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   100
    void method_param(int x) { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   101
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   102
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   103
     * @param <T>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   104
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   105
    <T> T method_typaram(T t) { return t; }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   106
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   107
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   108
     * @param <T>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   109
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   110
    class ClassTyparam<T> { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   111
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   112
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   113
     * @param <T>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   114
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   115
    interface InterfaceTyparam<T> { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   116
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   117
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   118
     * @return x
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   119
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   120
    int return_int() { return 0; }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   121
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   122
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   123
     * @exception Exception
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   124
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   125
    void throws_Exception1() throws Exception { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   126
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   127
    /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   128
     * @throws Exception
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   129
     */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   130
    void throws_Exception2() throws Exception { }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   131
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   132
    class X {
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   133
        /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   134
         * @param x
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   135
         */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   136
        X(int x) { } // constructor parameter
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   137
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   138
        /**
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   139
         * @param <T>
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   140
         */
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   141
        <T> X(T t) { } // constructor type parameter
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   142
    }
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   143
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   144
}
d0022ae20516 8004832: Add new doclint package
jjg
parents:
diff changeset
   145