mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
7010342: End tag for element P is not open for few html files generated using new javadoc
Reviewed-by: jjg
This commit is contained in:
parent
881add500f
commit
987d5902c1
9 changed files with 143 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2011, 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
|
||||||
|
@ -154,8 +154,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||||
div.addStyle(HtmlStyle.header);
|
div.addStyle(HtmlStyle.header);
|
||||||
if (pkgname.length() > 0) {
|
if (pkgname.length() > 0) {
|
||||||
Content pkgNameContent = new StringContent(pkgname);
|
Content pkgNameContent = new StringContent(pkgname);
|
||||||
Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
|
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
|
||||||
div.addContent(pkgNamePara);
|
div.addContent(pkgNameDiv);
|
||||||
}
|
}
|
||||||
LinkInfoImpl linkInfo = new LinkInfoImpl(
|
LinkInfoImpl linkInfo = new LinkInfoImpl(
|
||||||
LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
|
LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, 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
|
||||||
|
@ -161,8 +161,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||||
div.addStyle(HtmlStyle.header);
|
div.addStyle(HtmlStyle.header);
|
||||||
if (pkgname.length() > 0) {
|
if (pkgname.length() > 0) {
|
||||||
Content pkgNameContent = new StringContent(pkgname);
|
Content pkgNameContent = new StringContent(pkgname);
|
||||||
Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
|
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
|
||||||
div.addContent(pkgNamePara);
|
div.addContent(pkgNameDiv);
|
||||||
}
|
}
|
||||||
LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER,
|
LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER,
|
||||||
classDoc, false);
|
classDoc, false);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2011, 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
|
||||||
|
@ -96,7 +96,7 @@ public class HelpWriter extends HtmlDocletWriter {
|
||||||
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
|
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
|
||||||
getResource("doclet.Help_line_1"));
|
getResource("doclet.Help_line_1"));
|
||||||
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
|
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
|
||||||
Content line2 = HtmlTree.P(HtmlStyle.subTitle,
|
Content line2 = HtmlTree.DIV(HtmlStyle.subTitle,
|
||||||
getResource("doclet.Help_line_2"));
|
getResource("doclet.Help_line_2"));
|
||||||
div.addContent(line2);
|
div.addContent(line2);
|
||||||
contentTree.addContent(div);
|
contentTree.addContent(div);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, 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
|
||||||
|
@ -163,10 +163,10 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
||||||
*/
|
*/
|
||||||
protected void addOverviewHeader(Content body) {
|
protected void addOverviewHeader(Content body) {
|
||||||
if (root.inlineTags().length > 0) {
|
if (root.inlineTags().length > 0) {
|
||||||
HtmlTree p = new HtmlTree(HtmlTag.P);
|
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
|
||||||
p.addStyle(HtmlStyle.subTitle);
|
subTitleDiv.addStyle(HtmlStyle.subTitle);
|
||||||
addSummaryComment(root, p);
|
addSummaryComment(root, subTitleDiv);
|
||||||
Content div = HtmlTree.DIV(HtmlStyle.header, p);
|
Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv);
|
||||||
Content see = seeLabel;
|
Content see = seeLabel;
|
||||||
see.addContent(" ");
|
see.addContent(" ");
|
||||||
Content descPara = HtmlTree.P(see);
|
Content descPara = HtmlTree.P(see);
|
||||||
|
@ -188,10 +188,10 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
||||||
protected void addOverviewComment(Content htmltree) {
|
protected void addOverviewComment(Content htmltree) {
|
||||||
if (root.inlineTags().length > 0) {
|
if (root.inlineTags().length > 0) {
|
||||||
htmltree.addContent(getMarkerAnchor("overview_description"));
|
htmltree.addContent(getMarkerAnchor("overview_description"));
|
||||||
HtmlTree p = new HtmlTree(HtmlTag.P);
|
HtmlTree div = new HtmlTree(HtmlTag.DIV);
|
||||||
p.addStyle(HtmlStyle.subTitle);
|
div.addStyle(HtmlStyle.subTitle);
|
||||||
addInlineComment(root, p);
|
addInlineComment(root, div);
|
||||||
htmltree.addContent(p);
|
htmltree.addContent(div);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, 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
|
||||||
|
@ -115,10 +115,10 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||||
tHeading.addContent(packageHead);
|
tHeading.addContent(packageHead);
|
||||||
div.addContent(tHeading);
|
div.addContent(tHeading);
|
||||||
if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
|
if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
|
||||||
HtmlTree p = new HtmlTree(HtmlTag.P);
|
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
|
||||||
p.addStyle(HtmlStyle.subTitle);
|
subTitleDiv.addStyle(HtmlStyle.subTitle);
|
||||||
addSummaryComment(packageDoc, p);
|
addSummaryComment(packageDoc, subTitleDiv);
|
||||||
div.addContent(p);
|
div.addContent(subTitleDiv);
|
||||||
Content space = getSpace();
|
Content space = getSpace();
|
||||||
Content descLink = getHyperLink("", "package_description",
|
Content descLink = getHyperLink("", "package_description",
|
||||||
descriptionLabel, "", "");
|
descriptionLabel, "", "");
|
||||||
|
|
|
@ -183,8 +183,6 @@ Page header and footer styles
|
||||||
.subTitle {
|
.subTitle {
|
||||||
margin:0;
|
margin:0;
|
||||||
padding-top:10px;
|
padding-top:10px;
|
||||||
font-size:0.75em;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Page layout container styles
|
Page layout container styles
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, 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 7010342
|
||||||
|
* @summary Test for correct sub title generation.
|
||||||
|
* @author Bhavesh Patel
|
||||||
|
* @library ../lib/
|
||||||
|
* @build JavadocTester
|
||||||
|
* @build TestSubTitle
|
||||||
|
* @run main TestSubTitle
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class TestSubTitle extends JavadocTester {
|
||||||
|
|
||||||
|
private static final String BUG_ID = "7010342";
|
||||||
|
private static final String[][] TEST = {
|
||||||
|
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
|
||||||
|
"<div class=\"subTitle\">" + NL + "<div class=\"block\">This is the " +
|
||||||
|
"description of package pkg.</div>" + NL + "</div>"
|
||||||
|
},
|
||||||
|
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||||
|
"<div class=\"subTitle\">pkg</div>"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private static final String[][] NEG_TEST = {
|
||||||
|
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
|
||||||
|
"<p class=\"subTitle\">" + NL + "<div class=\"block\">This is the " +
|
||||||
|
"description of package pkg.</div>" + NL + "</p>"
|
||||||
|
},
|
||||||
|
{BUG_ID + FS + "pkg" + FS + "C.html",
|
||||||
|
"<p class=\"subTitle\">pkg</p>"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private static final String[] ARGS = new String[]{
|
||||||
|
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The entry point of the test.
|
||||||
|
* @param args the array of command line arguments.
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
TestSubTitle tester = new TestSubTitle();
|
||||||
|
run(tester, ARGS, TEST, NEG_TEST);
|
||||||
|
tester.printSummary();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public String getBugId() {
|
||||||
|
return BUG_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public String getBugName() {
|
||||||
|
return getClass().getName();
|
||||||
|
}
|
||||||
|
}
|
30
langtools/test/com/sun/javadoc/testSubTitle/pkg/C.java
Normal file
30
langtools/test/com/sun/javadoc/testSubTitle/pkg/C.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package pkg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source file for C
|
||||||
|
*/
|
||||||
|
public class C {
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Package Summary</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
This is the description of package pkg.
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue