2294f225c0
Reviewed-by: hannesw
155 lines
9.5 KiB
Java
155 lines
9.5 KiB
Java
/*
|
|
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
*
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
* accompanied this code).
|
|
*
|
|
* You should have received a copy of the GNU General Public License version
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
* questions.
|
|
*/
|
|
|
|
/*
|
|
* @test
|
|
* @bug 8214126 8241470 8259499
|
|
* @summary Method signatures not formatted correctly in browser
|
|
* @library ../../lib/
|
|
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
|
* @build javadoc.tester.*
|
|
* @run main TestMethodSignature
|
|
*/
|
|
|
|
import javadoc.tester.JavadocTester;
|
|
|
|
public class TestMethodSignature extends JavadocTester {
|
|
|
|
public static void main(String... args) throws Exception {
|
|
var tester = new TestMethodSignature();
|
|
tester.runTests();
|
|
}
|
|
|
|
@Test
|
|
public void test() {
|
|
javadoc("-d", "out",
|
|
"-sourcepath", testSrc,
|
|
"--no-platform-links",
|
|
"pkg");
|
|
checkExit(Exit.OK);
|
|
|
|
checkOutput("pkg/C.html", true,
|
|
"""
|
|
<div class="member-signature"><span class="annotations">@Generated("GeneratedConstructor")
|
|
</span><span class="modifiers">public</span> <span class="element-name">C</span>()</div>""",
|
|
|
|
"""
|
|
<div class="member-signature"><span class="modifiers">public static</span> \
|
|
<span class="return-type">void</span> <span class="element-name">simpleMeth\
|
|
od</span><wbr><span class="parameters">(int i,
|
|
java.lang.String s,
|
|
boolean b)</span></div>""",
|
|
|
|
"""
|
|
<div class="member-signature"><span class="annotations">@Generated(value="SomeGeneratedName",
|
|
date="a date",
|
|
comments="some comment about the method below")
|
|
</span><span class="modifiers">public static</span> <span class="return-typ\
|
|
e">void</span> <span class="element-name">annotatedMethod</span><wbr><span \
|
|
class="parameters">(int i,
|
|
java.lang.String s,
|
|
boolean b)</span></div>""",
|
|
|
|
"""
|
|
<div class="member-signature"><span class="modifiers">public static</span> \
|
|
<span class="type-parameters-long"><T1 extends java.lang.AutoCloseable,<wbr>
|
|
T2 extends java.lang.AutoCloseable,<wbr>
|
|
T3 extends java.lang.AutoCloseable,<wbr>
|
|
T4 extends java.lang.AutoCloseable,<wbr>
|
|
T5 extends java.lang.AutoCloseable,<wbr>
|
|
T6 extends java.lang.AutoCloseable,<wbr>
|
|
T7 extends java.lang.AutoCloseable,<wbr>
|
|
T8 extends java.lang.AutoCloseable></span>
|
|
<span class="return-type"><a href="C.With8Types.html" title="class in pkg">C.Wit\
|
|
h8Types</a><T1,<wbr>T2,<wbr>T3,<wbr>T4,<wbr>T5,<wbr>T6,<wbr>T7,<wbr>T8></s\
|
|
pan> <span class="element-name">bigGenericMethod</span><wbr><span class="pa\
|
|
rameters">(<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T1\
|
|
> t1,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T2> t2,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T3> t3,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T4> t4,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T5> t5,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T6> t6,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T7> t7,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T8> t8)</span>
|
|
throws <span class="exceptions">java.lang.IllegalArgumentException,
|
|
java.lang.IllegalStateException</span></div>""",
|
|
|
|
"""
|
|
<div class="member-signature"><span class="annotations">@Generated(value="SomeGeneratedName",
|
|
date="a date",
|
|
comments="some comment about the method below")
|
|
</span><span class="modifiers">public static</span> <span class="type-param\
|
|
eters-long"><T1 extends java.lang.AutoCloseable,<wbr>
|
|
T2 extends java.lang.AutoCloseable,<wbr>
|
|
T3 extends java.lang.AutoCloseable,<wbr>
|
|
T4 extends java.lang.AutoCloseable,<wbr>
|
|
T5 extends java.lang.AutoCloseable,<wbr>
|
|
T6 extends java.lang.AutoCloseable,<wbr>
|
|
T7 extends java.lang.AutoCloseable,<wbr>
|
|
T8 extends java.lang.AutoCloseable></span>
|
|
<span class="return-type"><a href="C.With8Types.html" title="class in pkg">C.Wit\
|
|
h8Types</a><T1,<wbr>T2,<wbr>T3,<wbr>T4,<wbr>T5,<wbr>T6,<wbr>T7,<wbr>T8></s\
|
|
pan> <span class="element-name">bigGenericAnnotatedMethod</span><wbr><span \
|
|
class="parameters">(<a href="C.F0.html" title="interface in pkg">C.F0</a><? e\
|
|
xtends T1> t1,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T2> t2,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T3> t3,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T4> t4,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T5> t5,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T6> t6,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T7> t7,
|
|
<a href="C.F0.html" title="interface in pkg">C.F0</a><? extends T8> t8)</span>
|
|
throws <span class="exc\
|
|
eptions">java.lang.IllegalArgumentException,
|
|
java.lang.IllegalStateException</span></div>
|
|
<div class="block">Generic method with eight type args and annotation.</div>""",
|
|
"""
|
|
<div class="member-signature"><span class="modifiers">public</span> <span c\
|
|
lass="return-type"><a href="C.Generic.html" title="class in pkg">C.Generic</a>&l\
|
|
t;java.lang.Integer>.<a href="C.Generic.Inner.html" title="class in pkg">Inne\
|
|
r</a></span> <span class="element-name">nestedGeneric1</span><wbr><span cla\
|
|
ss="parameters">(<a href="C.Generic.html" title="class in pkg">C.Generic</a><\
|
|
java.lang.Integer>.<a href="C.Generic.Inner.html" title="class in pkg">Inner<\
|
|
/a> i,
|
|
<a href="C.Generic.html" title="class in pkg">C.Generic</a><<a href="C.html"\
|
|
title="class in pkg">C</a>>.<a href="C.Generic.Inner.html" title="class in p\
|
|
kg">Inner</a> j)</span></div>""",
|
|
"""
|
|
<div class="member-signature"><span class="modifiers">public</span> <span c\
|
|
lass="return-type"><a href="C.Generic.html" title="class in pkg">C.Generic</a>&l\
|
|
t;<a href="C.F0.html" title="interface in pkg">C.F0</a><<a href="C.html" titl\
|
|
e="class in pkg">C</a>>>.<a href="C.Generic.Inner.html" title="class in pk\
|
|
g">Inner</a>.<a href="C.Generic.Inner.Foo.html" title="class in pkg">Foo</a></sp\
|
|
an> <span class="element-name">nestedGeneric2</span><wbr><span class="param\
|
|
eters">(<a href="C.Generic.html" title="class in pkg">C.Generic</a><java.lang\
|
|
.Integer>.<a href="C.Generic.Inner.html" title="class in pkg">Inner</a>.<a hr\
|
|
ef="C.Generic.Inner.Foo.html" title="class in pkg">Foo</a> f,
|
|
<a href="C.Generic.html" title="class in pkg">C.Generic</a><<a href="C.F0.ht\
|
|
ml" title="interface in pkg">C.F0</a><<a href="C.html" title="class in pkg">C\
|
|
</a>>>.<a href="C.Generic.Inner.html" title="class in pkg">Inner</a>.<a hr\
|
|
ef="C.Generic.Inner.Foo.html" title="class in pkg">Foo</a> g)</span></div>""");
|
|
|
|
}
|
|
}
|