diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
index c8d89e4a1c6..4ca9e119655 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
@@ -39,6 +39,7 @@ import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVariable;
import javax.lang.model.util.SimpleTypeVisitor9;
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.toolkit.Content;
@@ -199,55 +200,61 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/
protected void addParameters(ExecutableElement member,
boolean includeAnnotations, Content htmltree, int indentSize) {
- htmltree.addContent(Contents.ZERO_WIDTH_SPACE);
- htmltree.addContent("(");
+ Content paramTree = new ContentBuilder();
String sep = "";
List extends VariableElement> parameters = member.getParameters();
CharSequence indent = makeSpace(indentSize + 1);
TypeMirror rcvrType = member.getReceiverType();
if (includeAnnotations && rcvrType != null && utils.isAnnotated(rcvrType)) {
List extends AnnotationMirror> annotationMirrors = rcvrType.getAnnotationMirrors();
- addReceiverAnnotations(member, rcvrType, annotationMirrors, htmltree);
+ addReceiverAnnotations(member, rcvrType, annotationMirrors, paramTree);
sep = "," + DocletConstants.NL + indent;
}
int paramstart;
for (paramstart = 0; paramstart < parameters.size(); paramstart++) {
- htmltree.addContent(sep);
+ paramTree.addContent(sep);
VariableElement param = parameters.get(paramstart);
if (param.getKind() != ElementKind.INSTANCE_INIT) {
if (includeAnnotations) {
boolean foundAnnotations =
writer.addAnnotationInfo(indent.length(),
- member, param, htmltree);
+ member, param, paramTree);
if (foundAnnotations) {
- htmltree.addContent(DocletConstants.NL);
- htmltree.addContent(indent);
+ paramTree.addContent(DocletConstants.NL);
+ paramTree.addContent(indent);
}
}
addParam(member, param,
- (paramstart == parameters.size() - 1) && member.isVarArgs(), htmltree);
+ (paramstart == parameters.size() - 1) && member.isVarArgs(), paramTree);
break;
}
}
for (int i = paramstart + 1; i < parameters.size(); i++) {
- htmltree.addContent(",");
- htmltree.addContent(DocletConstants.NL);
- htmltree.addContent(indent);
+ paramTree.addContent(",");
+ paramTree.addContent(DocletConstants.NL);
+ paramTree.addContent(indent);
if (includeAnnotations) {
boolean foundAnnotations =
writer.addAnnotationInfo(indent.length(), member, parameters.get(i),
- htmltree);
+ paramTree);
if (foundAnnotations) {
- htmltree.addContent(DocletConstants.NL);
- htmltree.addContent(indent);
+ paramTree.addContent(DocletConstants.NL);
+ paramTree.addContent(indent);
}
}
addParam(member, parameters.get(i), (i == parameters.size() - 1) && member.isVarArgs(),
- htmltree);
+ paramTree);
+ }
+ if (paramTree.isEmpty()) {
+ htmltree.addContent("()");
+ } else {
+ htmltree.addContent(Contents.ZERO_WIDTH_SPACE);
+ htmltree.addContent("(");
+ htmltree.addContent(paramTree);
+ paramTree.addContent(")");
}
- htmltree.addContent(")");
}
/**
diff --git a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
index 68d3a69a9f1..c0804be6fe7 100644
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8163800 8175200
+ * @bug 8163800 8175200 8186332
* @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -51,11 +51,11 @@ public class TestClassLinks extends JavadocTester {
checkOutput("p/C1.html", true,
"C2
",
- "C1()
");
+ "C1()
");
checkOutput("p/C2.html", true,
"C3
",
- "C2()
");
+ "C2()
");
checkOutput("p/C3.html", true,
"I1
, "
@@ -63,7 +63,7 @@ public class TestClassLinks extends JavadocTester {
+ "I2
, "
+ "IT1<T>
, "
+ "IT2<java.lang.String>
",
- "C3()
");
+ "C3()
");
checkOutput("p/I1.html", true,
"C3
",
diff --git a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java
index 23853904cf3..04747e2dd02 100644
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8025524 8031625 8081854 8175200
+ * @bug 8025524 8031625 8081854 8175200 8186332
* @summary Test for constructor name which should be a non-qualified name.
* @author Bhavesh Patel
* @library ../lib
@@ -58,19 +58,19 @@ public class TestConstructors extends JavadocTester {
+ "Outer(int)
, "
+ ""
+ "NestedInner(int)
",
- "Outer()",
+ "Outer()",
"",
"Outer(int i)",
"");
checkOutput("pkg1/Outer.Inner.html", true,
- "Inner()",
+ "Inner()",
"",
"Inner(int i)",
"");
checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
- "NestedInner()",
+ "NestedInner()",
"",
"NestedInner(int i)",
"");
diff --git a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
index 8dd3bccc296..7ca901c65af 100644
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4927552 8026567 8071982 8162674 8175200 8175218 8183511
+ * @bug 4927552 8026567 8071982 8162674 8175200 8175218 8183511 8186332
* @summary @Deprecated(forRemoval=true)\n"
- + "public DeprecatedClassByAnnotation()
\n"
+ + "public DeprecatedClassByAnnotation()\n"
+ "@Deprecated\n"
- + "public void method()
\n"
+ + "public void method()\n"
+ "@Deprecated(forRemoval=true)\n"
- + "public TestClass()
\n"
+ + "public TestClass()\n"
+ "public void readObject()\n" +
+ "
public void readObject()\n" +
" throws java.io.IOException
\n" +
"");
checkOutput("pkg1/C2.html", expectFound,
- "public C2()
\n" +
+ "public C2()
\n" +
"");
checkOutput("pkg1/C1.ModalExclusionType.html", expectFound,
diff --git a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
index fe24c9c53d6..0e6345a0170 100644
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200
+ * @bug 4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200 8186332
* @summary Verify that the public modifier does not show up in the
* documentation for public methods, as recommended by the JLS.
* If A implements I and B extends A, B should be in the list of
@@ -64,7 +64,7 @@ public class TestInterface extends JavadocTester {
checkExit(Exit.OK);
checkOutput("pkg/Interface.html", true,
- "int method()
",
+ "int method()
",
"static final int field
",
// Make sure known implementing class list is correct and omits type parameters.
"\n"
@@ -119,7 +119,7 @@ public class TestInterface extends JavadocTester {
+ "
");
checkOutput("pkg/Interface.html", false,
- "public int method()",
+ "public int method()",
"public static final int field");
checkOutput("pkg/ClassWithStaticMethod.html", false,
diff --git a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
index 2a752877037..b4ee5b87115 100644
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
@@ -24,7 +24,7 @@
/*
* @test
* @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363
- * 8167967 8172528 8175200 8178830 8182257
+ * 8167967 8172528 8175200 8178830 8182257 8186332
* @summary Test of the JavaFX doclet features.
* @author jvalenta
* @library ../lib
@@ -58,7 +58,7 @@ public class TestJavaFX extends JavadocTester {
+ "\n"
+ "
public final double getRate()
\n"
+ "public final double getRate()
\n"
+ "\n"
+ "
",
+ + "setTestMethodProperty"
+ ""
- + "setTestMethodProperty()
"
+ "paused
public final double isPaused()\n" + + "
public final double isPaused()\n" + "
public final void setPaused(boolean value)\n" @@ -99,7 +99,7 @@ public class TestJavaFX extends JavadocTester { + "
public final double isPaused()\n" + + "
public final double isPaused()\n" + "
public final double getRate()\n" + + "
public final double getRate()\n" + "
java.lang.Object
"
- + "betaProperty()
java.util.List<java.util.Set<? super java.lang.Object>>"
+ "
"
- + "deltaProperty()
java.util.List<java.lang.String>
"
- + "gammaProperty()
default void
default void defaultMethod()", + "
default void defaultMethod()", "
default default void
default default void defaultMethod()"); + "
default default void defaultMethod()"); checkOutput("pkg/B.html", false, "
default void
def
ghi def
ghi abc def
ghi
abc def
ghi
pqrabc
def
ghipqrmno
abc def
ghi
\n"
+ " line 0 @Override\n"
@@ -68,7 +68,7 @@ public class TestLiteralCodeInPre extends JavadocTester {
+ " line 3 }\n"
+ "
\n"
+ " and so it goes.\n" + " line 0 @Override\n" @@ -77,7 +77,7 @@ public class TestLiteralCodeInPre extends JavadocTester { + " line 3 }\n" + "\n" + " and so it goes.
\n" + " line 0 @Override\n" @@ -89,7 +89,7 @@ public class TestLiteralCodeInPre extends JavadocTester { + "\n" + " id \n" + "
public void htmlAttrInPre1()\n" + "
public void htmlAttrInPre1()\n" + "
\n" + " @Override\n" diff --git a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java index 1b443469f09..26b56ad38f4 100644 --- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java +++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 + * @bug 4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332 * @summary Test the case where the overriden method returns a different * type than the method in the child class. Make sure the * documentation is inherited but the return type isn't. @@ -52,12 +52,12 @@ public class TestMemberSummary extends JavadocTester { // Check return type in member summary. "", + + "public AnnotationTypeUsage()", // METHOD "PublicChild
\n" + "" - + "returnTypeTest()
", + + "returnTypeTest()", // Check return type in member detail. "public " - + "PublicChild returnTypeTest()", + + "PublicChild returnTypeTest()", ""); + + "PublicChild()"); checkOutput("pkg/PrivateParent.html", true, " " - + "PublicChild()
\n" diff --git a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java index e1003ca04f6..8ce9b073f8d 100644 --- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java +++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java @@ -24,7 +24,7 @@ /* * @test * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567 8162363 - * 8175200 + * 8175200 8186332 * @summary Run Javadoc on a set of source files that demonstrate new * language features. Check the output to ensure that the new * language features are properly documented. @@ -549,7 +549,7 @@ public class TestNewLanguageFeatures extends JavadocTester { + "=\"Constructor Annotation\",\n" + " " + "required=1994)\n" - + "public AnnotationTypeUsage() private
@AnnotationType(" @@ -557,7 +557,7 @@ public class TestNewLanguageFeatures extends JavadocTester { + "=\"Method Annotation\",\n" + " " + "required=1994)\n" - + "public void method()", + + "public void method()", // METHOD PARAMS "
public void methodWithParams(" + "" @@ -630,11 +630,11 @@ public class TestNewLanguageFeatures extends JavadocTester { // CONSTRUCTOR "@AnnotationTypeUndocumented(optional=\"Constructor Annotation\",\n" + " required=1994)\n" - + "public AnnotationTypeUsage()", + + "public AnnotationTypeUsage()", // METHOD "@AnnotationTypeUndocumented(optional=\"Method Annotation\",\n" + " required=1994)\n" - + "public void method()"); + + "public void method()"); //================================= // Make sure annotation types do not diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java index 9d90916ecf8..384c465cd19 100644 --- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java +++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4749567 8071982 8175200 + * @bug 4749567 8071982 8175200 8186332 * @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree, -stylesheetfile options. * @author Bhavesh Patel * @library ../lib @@ -148,7 +148,7 @@ public class TestOptions extends JavadocTester { ""); checkOutput("src-html/linksource/Properties.html", true, "public java.lang.Object someProperty", "public java.lang.Object someProperty()"); + + "\"../src-html/linksource/Properties.html#line.31\">someProperty()
public int " + "field", "
public " - + "SomeClass()", + + "SomeClass()", "
public int " - + "method()"); + + "method()"); checkOutput("src-html/linksource/SomeClass.html", true, "
public void toString()\n" + + "
public void toString()\n" + "
public void m3()\n" + + "
public void m3()\n" + "
public <T> @MRtnA java.lang.String" - + " method()", + + " method()", // When JDK-8068737 is fixed, we should change the order "
" + "@MRtnA java.lang.String " + "@MRtnB [] " + "@MRtnA []" - + " array2Deep()", + + " array2Deep()", "
@MRtnA java.lang.String[][] array2()"); + + "typeannos\">@MRtnA java.lang.String[][] array2()"); checkOutput("typeannos/MtdModifiedScoped.html", true, "
public final @MRtnB java.lang.String>,@MRtnB java." - + "lang.String> nestedMtdParameterized()"); + + "lang.String> nestedMtdParameterized()"); // Test for type annotations on method type parameters (MethodTypeParameters.java). checkOutput("typeannos/UnscopedUnmodified.html", true, "
<K extends @MTyParamA java.lang.String>" - + " void methodExtends()", + + " void methodExtends()", "
<K extends @MTyParamA " + "MtdTyParameterized<@MTyParamB java.lang.String" - + ">> void nestedExtends()"); + + ">> void nestedExtends()"); checkOutput("typeannos/PublicModifiedMethods.html", true, "
public final <K extends @MTyParamA " - + "java.lang.String> void methodExtends()", + + "java.lang.String> void methodExtends()", "
public final <K extends @MTyParamA " @@ -204,7 +204,7 @@ public class TestTypeAnnotations extends JavadocTester { + "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">" + "MtdTyParameterized<@MTyParamB java.lang.String" - + ">> void dual()"); + + ">> void dual()"); // Test for type annotations on parameters (Parameters.java). checkOutput("typeannos/Parameters.html", true, @@ -236,11 +236,11 @@ public class TestTypeAnnotations extends JavadocTester { // Test for type annotations on throws (Throws.java). checkOutput("typeannos/ThrDefaultUnmodified.html", true, - "
void oneException()\n" + "", "void oneException()\n" + " throws @ThrA java.lang.Exception", - "void twoExceptions()\n" + "", + + "RepeatingOnConstructor()void twoExceptions()\n" + " throws @ThrA java.lang.RuntimeException,\n" + " @ThrA java.lang.Exception"); checkOutput("typeannos/ThrWithValue.html", true, - "void oneException()\n" + ""); // Test for receiver annotations (Receivers.java). checkOutput("typeannos/DefaultUnmodified.html", true, @@ -396,7 +396,7 @@ public class TestTypeAnnotations extends JavadocTester { + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos" + "\">@RepConstructorB @RepConstructorB\n" - + "RepeatingOnConstructor()void oneException()\n" + " throws @ThrB(" + "\"m\") java.lang.Exception", - "void twoExceptions()\n" + ""); checkOutput("typeannos/BoundWithValue.html", true, "void twoExceptions()\n" + " throws @ThrB(" + "\"m\") java.lang.RuntimeException,\n" @@ -275,7 +275,7 @@ public class TestTypeAnnotations extends JavadocTester { "" ); // Test for type annotations on wildcard type (Wildcards.java). @@ -288,7 +288,7 @@ public class TestTypeAnnotations extends JavadocTester { "<K," + "@TyParaA V extends @TyParaA " - + "java.lang.String> void secondAnnotated()" + + "java.lang.String> void secondAnnotated()MyList<? super @WldA java.lang.String>" - + " returnWcSuper()"); + + " returnWcSuper()void wcSuper(MyList<? extends @WldB(" + "\"m\") java.lang.String" - + "> returnWcExtends()"); + + "> returnWcExtends()
@RepConstructorA (package private) java.lang.String\n" + " test1()
", + + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1()", "(package private) @RepTypeUseA @RepTypeUseB java.lang.String
" + "\n" + "test2" - + "()
", + + "()", "(package private) @RepTypeUseA @RepTypeUseB java.lang.String
" + "\n" + "test3" - + "()
", + + "()", "(package private) @RepAllContextsA " + "@RepAllContextsB java.lang.String
\n" + " test4()
", + + "#test4--\">test4()", "test5" @@ -621,13 +621,13 @@ public class TestTypeAnnotations extends JavadocTester { + "\"annotation in typeannos\">@RepMethodA\n@RepMethodB " - + "@RepMethodB\njava.lang.String test1()", + + "@RepMethodB\njava.lang.String test1()", "" + "@RepTypeUseA @RepTypeUseA @RepTypeUseB @RepTypeUseB java.lang.String test2()", + + "title=\"annotation in typeannos\">@RepTypeUseB java.lang.String test2()", "" + "@RepMethodA @RepTypeUseA " + "@RepTypeUseB @RepTypeUseB java.lang.String test3()", + + "\"annotation in typeannos\">@RepTypeUseB java.lang.String test3()", "" + "@RepAllContextsA @RepAllContextsA " + "@RepAllContextsB @RepAllContextsB java.lang.String test4()", + + "title=\"annotation in typeannos\">@RepAllContextsB java.lang.String test4()", "java.lang.String test5(@RepTypeUseA (package private) java.lang.String
\n" + "test()
", + + "test--\">test()", "java.lang.String test(@RepTypeUseA @RepMethodA\n@RepMethodB " - + "@RepMethodB\nvoid test()"); + + "@RepMethodB\nvoid test()"); } } diff --git a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java index cc1e634c746..1a7b397d747 100644 --- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java +++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982 8162363 8175200 + * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982 8162363 8175200 8186332 * @summary A simple test to ensure class-use files are correct. * @author jamieh * @library ../lib @@ -134,7 +134,7 @@ public class TestUseOption extends JavadocTester { "\n void
C1. " + + "()" ); }" + "methodInC1ThrowsThrowable" - + "()