提交 64186e6e 编写于 作者: B bpatel

8014017: extra space in javadoc class heading

Reviewed-by: jjg
上级 a435d816
...@@ -289,7 +289,8 @@ public class ClassBuilder extends AbstractBuilder { ...@@ -289,7 +289,8 @@ public class ClassBuilder extends AbstractBuilder {
* @param classInfoTree the content tree to which the documentation will be added * @param classInfoTree the content tree to which the documentation will be added
*/ */
public void buildClassSignature(XMLNode node, Content classInfoTree) { public void buildClassSignature(XMLNode node, Content classInfoTree) {
StringBuilder modifiers = new StringBuilder(classDoc.modifiers() + " "); StringBuilder modifiers = new StringBuilder(classDoc.modifiers());
modifiers.append(modifiers.length() == 0 ? "" : " ");
if (isEnum) { if (isEnum) {
modifiers.append("enum "); modifiers.append("enum ");
int index; int index;
......
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 4780441 4874845 4978816 * @bug 4780441 4874845 4978816 8014017
* @summary Make sure that when the -private flag is not used, members * @summary Make sure that when the -private flag is not used, members
* inherited from package private class are documented in the child. * inherited from package private class are documented in the child.
* *
...@@ -33,17 +33,19 @@ ...@@ -33,17 +33,19 @@
* *
* Make sure that when a private interface method with generic parameters * Make sure that when a private interface method with generic parameters
* is implemented, the comments can be inherited properly. * is implemented, the comments can be inherited properly.
*
* Make sure when no modifier appear in the class signature, the
* signature is displayed correctly without extra space at the beginning.
* @author jamieh * @author jamieh
* @library ../lib/ * @library ../lib/
* @build JavadocTester * @build JavadocTester TestPrivateClasses
* @build TestPrivateClasses
* @run main TestPrivateClasses * @run main TestPrivateClasses
*/ */
public class TestPrivateClasses extends JavadocTester { public class TestPrivateClasses extends JavadocTester {
//Test information. //Test information.
private static final String BUG_ID = "4780441-4874845-4978816"; private static final String BUG_ID = "4780441-4874845-4978816-8014017";
//Javadoc arguments. //Javadoc arguments.
private static final String[] ARGS1 = new String[] { private static final String[] ARGS1 = new String[] {
...@@ -234,8 +236,19 @@ public class TestPrivateClasses extends JavadocTester { ...@@ -234,8 +236,19 @@ public class TestPrivateClasses extends JavadocTester {
"&nbsp;in interface&nbsp;<code>" + "&nbsp;in interface&nbsp;<code>" +
"<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" + "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
"&lt;java.lang.String&gt;</code></dd>"}, "&lt;java.lang.String&gt;</code></dd>"},
//Make sure when no modifier appear in the class signature, the
//signature is displayed correctly without extra space at the beginning.
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
"<pre>class <span class=\"strong\">PrivateParent</span>"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
"<pre>public class <span class=\"strong\">PublicChild</span>"},
};
private static final String[][] NEGATED_TEST2 = {
{BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
"<pre> class <span class=\"strong\">PrivateParent</span>"},
}; };
private static final String[][] NEGATED_TEST2 = NO_TEST;
/** /**
* The entry point of the test. * The entry point of the test.
......
...@@ -78,7 +78,7 @@ public class TestTypeAnnotations extends JavadocTester { ...@@ -78,7 +78,7 @@ public class TestTypeAnnotations extends JavadocTester {
"typeannos\">@ClassParamA</a> java.lang.String&gt;</span>" "typeannos\">@ClassParamA</a> java.lang.String&gt;</span>"
}, },
{BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html", {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
"<pre> class <span class=\"strong\">ExtendsGeneric&lt;K extends " + "<pre>class <span class=\"strong\">ExtendsGeneric&lt;K extends " +
"<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " +
"typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " + "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " +
"title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" + "title=\"class in typeannos\">Unannotated</a>&lt;<a href=\"" +
...@@ -86,7 +86,7 @@ public class TestTypeAnnotations extends JavadocTester { ...@@ -86,7 +86,7 @@ public class TestTypeAnnotations extends JavadocTester {
"@ClassParamB</a> java.lang.String&gt;&gt;</span>" "@ClassParamB</a> java.lang.String&gt;&gt;</span>"
}, },
{BUG_ID + FS + "typeannos" + FS + "TwoBounds.html", {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
"<pre> class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" + "<pre>class <span class=\"strong\">TwoBounds&lt;K extends <a href=\"" +
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" +
"@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" + "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" +
"ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" + "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册