Fri, 20 Mar 2009 15:50:50 -0700
6820360: Fix for definition list tags nesting adds an extra list tag for package summary page.
Reviewed-by: jjg
1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Mar 19 19:00:54 2009 -0700 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Mar 20 15:50:50 2009 -0700 1.3 @@ -236,17 +236,19 @@ 1.4 configuration.tagletManager.getCustomTags(doc), 1.5 getTagletWriterInstance(false), output); 1.6 String outputString = output.toString().trim(); 1.7 - // For RootDoc and ClassDoc, this section is not the definition description 1.8 - // but the start of definition list. 1.9 + // For RootDoc, ClassDoc and PackageDoc, this section is not the 1.10 + // definition description but the start of definition list. 1.11 if (!outputString.isEmpty()) { 1.12 - if (!(doc instanceof RootDoc || doc instanceof ClassDoc)) { 1.13 + if (!(doc instanceof RootDoc || doc instanceof ClassDoc || 1.14 + doc instanceof PackageDoc)) { 1.15 printMemberDetailsListStartTag(); 1.16 dd(); 1.17 } 1.18 printTagsInfoHeader(); 1.19 print(outputString); 1.20 printTagsInfoFooter(); 1.21 - if (!(doc instanceof RootDoc || doc instanceof ClassDoc)) 1.22 + if (!(doc instanceof RootDoc || doc instanceof ClassDoc || 1.23 + doc instanceof PackageDoc)) 1.24 ddEnd(); 1.25 } 1.26 }
2.1 --- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Thu Mar 19 19:00:54 2009 -0700 2.2 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Mar 20 15:50:50 2009 -0700 2.3 @@ -25,7 +25,7 @@ 2.4 2.5 /* 2.6 * @test 2.7 - * @bug 6786690 2.8 + * @bug 6786690 6820360 2.9 * @summary This test verifies the nesting of definition list tags. 2.10 * @author Bhavesh Patel 2.11 * @library ../lib/ 2.12 @@ -36,7 +36,7 @@ 2.13 2.14 public class TestHtmlDefinitionListTag extends JavadocTester { 2.15 2.16 - private static final String BUG_ID = "6786690"; 2.17 + private static final String BUG_ID = "6786690-6820360"; 2.18 2.19 // Test common to all runs of javadoc. The class signature should print 2.20 // properly enclosed definition list tags and the Annotation Type 2.21 @@ -55,6 +55,9 @@ 2.22 // serialized form should have properly nested definition list tags 2.23 // enclosing comments, tags and deprecated information. 2.24 private static final String[][] TEST_CMNT_DEPR = { 2.25 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL + 2.26 + "<DT><STRONG>Since:</STRONG></DT>" + NL + 2.27 + " <DD>JDK1.0</DD></DL>"}, 2.28 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + 2.29 "<DT><STRONG>Since:</STRONG></DT>" + NL + 2.30 " <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" + 2.31 @@ -193,6 +196,9 @@ 2.32 // should display properly nested definition list tags for comments, tags 2.33 // and deprecated information. 2.34 private static final String[][] TEST_NODEPR = { 2.35 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL + 2.36 + "<DT><STRONG>Since:</STRONG></DT>" + NL + 2.37 + " <DD>JDK1.0</DD></DL>"}, 2.38 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + 2.39 "<DT><STRONG>Since:</STRONG></DT>" + NL + 2.40 " <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" + 2.41 @@ -302,6 +308,8 @@ 2.42 // Test for valid HTML generation which should not comprise of empty 2.43 // definition list tags. 2.44 private static final String[][] NEGATED_TEST = { 2.45 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL></DL>"}, 2.46 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL + "</DL>"}, 2.47 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL></DL>"}, 2.48 {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "</DL>"}, 2.49 {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL></DL>"},
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/package-info.java Fri Mar 20 15:50:50 2009 -0700 3.3 @@ -0,0 +1,29 @@ 3.4 +/* 3.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 + * 3.8 + * This code is free software; you can redistribute it and/or modify it 3.9 + * under the terms of the GNU General Public License version 2 only, as 3.10 + * published by the Free Software Foundation. 3.11 + * 3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.15 + * version 2 for more details (a copy is included in the LICENSE file that 3.16 + * accompanied this code). 3.17 + * 3.18 + * You should have received a copy of the GNU General Public License version 3.19 + * 2 along with this work; if not, write to the Free Software Foundation, 3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.21 + * 3.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 3.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 3.24 + * have any questions. 3.25 + */ 3.26 + 3.27 +/** 3.28 + * Test package 1. 3.29 + * 3.30 + * @since JDK1.0 3.31 + */ 3.32 +package pkg1;