6820360: Fix for definition list tags nesting adds an extra list tag for package summary page

Reviewed-by: jjg
This commit is contained in:
Bhavesh Patel 2009-03-20 15:50:50 -07:00
parent fd5bc72005
commit 34d8fbb5e2
3 changed files with 45 additions and 6 deletions

View File

@ -236,17 +236,19 @@ public class HtmlDocletWriter extends HtmlDocWriter {
configuration.tagletManager.getCustomTags(doc),
getTagletWriterInstance(false), output);
String outputString = output.toString().trim();
// For RootDoc and ClassDoc, this section is not the definition description
// but the start of definition list.
// For RootDoc, ClassDoc and PackageDoc, this section is not the
// definition description but the start of definition list.
if (!outputString.isEmpty()) {
if (!(doc instanceof RootDoc || doc instanceof ClassDoc)) {
if (!(doc instanceof RootDoc || doc instanceof ClassDoc ||
doc instanceof PackageDoc)) {
printMemberDetailsListStartTag();
dd();
}
printTagsInfoHeader();
print(outputString);
printTagsInfoFooter();
if (!(doc instanceof RootDoc || doc instanceof ClassDoc))
if (!(doc instanceof RootDoc || doc instanceof ClassDoc ||
doc instanceof PackageDoc))
ddEnd();
}
}

View File

@ -25,7 +25,7 @@
/*
* @test
* @bug 6786690
* @bug 6786690 6820360
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib/
@ -36,7 +36,7 @@
public class TestHtmlDefinitionListTag extends JavadocTester {
private static final String BUG_ID = "6786690";
private static final String BUG_ID = "6786690-6820360";
// Test common to all runs of javadoc. The class signature should print
// properly enclosed definition list tags and the Annotation Type
@ -55,6 +55,9 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// serialized form should have properly nested definition list tags
// enclosing comments, tags and deprecated information.
private static final String[][] TEST_CMNT_DEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL +
"<DT><STRONG>Since:</STRONG></DT>" + NL +
" <DD>JDK1.0</DD></DL>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
"<DT><STRONG>Since:</STRONG></DT>" + NL +
" <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
@ -193,6 +196,9 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// should display properly nested definition list tags for comments, tags
// and deprecated information.
private static final String[][] TEST_NODEPR = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL +
"<DT><STRONG>Since:</STRONG></DT>" + NL +
" <DD>JDK1.0</DD></DL>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
"<DT><STRONG>Since:</STRONG></DT>" + NL +
" <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
@ -302,6 +308,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// Test for valid HTML generation which should not comprise of empty
// definition list tags.
private static final String[][] NEGATED_TEST = {
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL></DL>"},
{BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL + "</DL>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL></DL>"},
{BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "</DL>"},
{BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL></DL>"},

View File

@ -0,0 +1,29 @@
/*
* Copyright 2009 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* Test package 1.
*
* @since JDK1.0
*/
package pkg1;