7010342: End tag for element P is not open for few html files generated using new javadoc

Wed, 23 Mar 2011 14:40:18 -0700

author
bpatel
date
Wed, 23 Mar 2011 14:40:18 -0700
changeset 943
72bdd232e0ea
parent 942
148d3dc4e1e1
child 944
83260b3305ac

7010342: End tag for element P is not open for few html files generated using new javadoc
Reviewed-by: jjg

src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testSubTitle/TestSubTitle.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testSubTitle/pkg/C.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testSubTitle/pkg/package.html file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Mar 22 18:32:41 2011 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Wed Mar 23 14:40:18 2011 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -154,8 +154,8 @@
    1.11          div.addStyle(HtmlStyle.header);
    1.12          if (pkgname.length() > 0) {
    1.13              Content pkgNameContent = new StringContent(pkgname);
    1.14 -            Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
    1.15 -            div.addContent(pkgNamePara);
    1.16 +            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
    1.17 +            div.addContent(pkgNameDiv);
    1.18          }
    1.19          LinkInfoImpl linkInfo = new LinkInfoImpl(
    1.20                  LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Tue Mar 22 18:32:41 2011 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Wed Mar 23 14:40:18 2011 -0700
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -161,8 +161,8 @@
    2.11          div.addStyle(HtmlStyle.header);
    2.12          if (pkgname.length() > 0) {
    2.13              Content pkgNameContent = new StringContent(pkgname);
    2.14 -            Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
    2.15 -            div.addContent(pkgNamePara);
    2.16 +            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
    2.17 +            div.addContent(pkgNameDiv);
    2.18          }
    2.19          LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER,
    2.20                  classDoc, false);
     3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Tue Mar 22 18:32:41 2011 -0700
     3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Wed Mar 23 14:40:18 2011 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     3.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     3.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8   *
     3.9   * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -96,7 +96,7 @@
    3.11          Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
    3.12                  getResource("doclet.Help_line_1"));
    3.13          Content div = HtmlTree.DIV(HtmlStyle.header, heading);
    3.14 -        Content line2 = HtmlTree.P(HtmlStyle.subTitle,
    3.15 +        Content line2 = HtmlTree.DIV(HtmlStyle.subTitle,
    3.16                  getResource("doclet.Help_line_2"));
    3.17          div.addContent(line2);
    3.18          contentTree.addContent(div);
     4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Tue Mar 22 18:32:41 2011 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Wed Mar 23 14:40:18 2011 -0700
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -163,10 +163,10 @@
    4.11       */
    4.12      protected void addOverviewHeader(Content body) {
    4.13          if (root.inlineTags().length > 0) {
    4.14 -            HtmlTree p = new HtmlTree(HtmlTag.P);
    4.15 -            p.addStyle(HtmlStyle.subTitle);
    4.16 -            addSummaryComment(root, p);
    4.17 -            Content div = HtmlTree.DIV(HtmlStyle.header, p);
    4.18 +            HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
    4.19 +            subTitleDiv.addStyle(HtmlStyle.subTitle);
    4.20 +            addSummaryComment(root, subTitleDiv);
    4.21 +            Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv);
    4.22              Content see = seeLabel;
    4.23              see.addContent(" ");
    4.24              Content descPara = HtmlTree.P(see);
    4.25 @@ -188,10 +188,10 @@
    4.26      protected void addOverviewComment(Content htmltree) {
    4.27          if (root.inlineTags().length > 0) {
    4.28              htmltree.addContent(getMarkerAnchor("overview_description"));
    4.29 -            HtmlTree p = new HtmlTree(HtmlTag.P);
    4.30 -            p.addStyle(HtmlStyle.subTitle);
    4.31 -            addInlineComment(root, p);
    4.32 -            htmltree.addContent(p);
    4.33 +            HtmlTree div = new HtmlTree(HtmlTag.DIV);
    4.34 +            div.addStyle(HtmlStyle.subTitle);
    4.35 +            addInlineComment(root, div);
    4.36 +            htmltree.addContent(div);
    4.37          }
    4.38      }
    4.39  
     5.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Tue Mar 22 18:32:41 2011 -0700
     5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Wed Mar 23 14:40:18 2011 -0700
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -115,10 +115,10 @@
    5.11          tHeading.addContent(packageHead);
    5.12          div.addContent(tHeading);
    5.13          if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
    5.14 -            HtmlTree p = new HtmlTree(HtmlTag.P);
    5.15 -            p.addStyle(HtmlStyle.subTitle);
    5.16 -            addSummaryComment(packageDoc, p);
    5.17 -            div.addContent(p);
    5.18 +            HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
    5.19 +            subTitleDiv.addStyle(HtmlStyle.subTitle);
    5.20 +            addSummaryComment(packageDoc, subTitleDiv);
    5.21 +            div.addContent(subTitleDiv);
    5.22              Content space = getSpace();
    5.23              Content descLink = getHyperLink("", "package_description",
    5.24                      descriptionLabel, "", "");
     6.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Tue Mar 22 18:32:41 2011 -0700
     6.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Wed Mar 23 14:40:18 2011 -0700
     6.3 @@ -183,8 +183,6 @@
     6.4  .subTitle {
     6.5      margin:0;
     6.6      padding-top:10px;
     6.7 -    font-size:0.75em;
     6.8 -    font-weight:bold;
     6.9  }
    6.10  /*
    6.11  Page layout container styles
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/test/com/sun/javadoc/testSubTitle/TestSubTitle.java	Wed Mar 23 14:40:18 2011 -0700
     7.3 @@ -0,0 +1,83 @@
     7.4 +/*
     7.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     7.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.7 + *
     7.8 + * This code is free software; you can redistribute it and/or modify it
     7.9 + * under the terms of the GNU General Public License version 2 only, as
    7.10 + * published by the Free Software Foundation.
    7.11 + *
    7.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    7.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    7.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    7.15 + * version 2 for more details (a copy is included in the LICENSE file that
    7.16 + * accompanied this code).
    7.17 + *
    7.18 + * You should have received a copy of the GNU General Public License version
    7.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    7.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    7.21 + *
    7.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    7.23 + * or visit www.oracle.com if you need additional information or have any
    7.24 + * questions.
    7.25 + */
    7.26 +
    7.27 +/*
    7.28 + * @test
    7.29 + * @bug 7010342
    7.30 + * @summary Test for correct sub title generation.
    7.31 + * @author Bhavesh Patel
    7.32 + * @library ../lib/
    7.33 + * @build JavadocTester
    7.34 + * @build TestSubTitle
    7.35 + * @run main TestSubTitle
    7.36 + */
    7.37 +
    7.38 +public class TestSubTitle extends JavadocTester {
    7.39 +
    7.40 +    private static final String BUG_ID = "7010342";
    7.41 +    private static final String[][] TEST = {
    7.42 +        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
    7.43 +            "<div class=\"subTitle\">" + NL + "<div class=\"block\">This is the " +
    7.44 +            "description of package pkg.</div>" + NL + "</div>"
    7.45 +        },
    7.46 +        {BUG_ID + FS + "pkg" + FS + "C.html",
    7.47 +            "<div class=\"subTitle\">pkg</div>"
    7.48 +        }
    7.49 +    };
    7.50 +    private static final String[][] NEG_TEST = {
    7.51 +        {BUG_ID + FS + "pkg" + FS + "package-summary.html",
    7.52 +            "<p class=\"subTitle\">" + NL + "<div class=\"block\">This is the " +
    7.53 +            "description of package pkg.</div>" + NL + "</p>"
    7.54 +        },
    7.55 +        {BUG_ID + FS + "pkg" + FS + "C.html",
    7.56 +            "<p class=\"subTitle\">pkg</p>"
    7.57 +        }
    7.58 +    };
    7.59 +    private static final String[] ARGS = new String[]{
    7.60 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
    7.61 +    };
    7.62 +
    7.63 +    /**
    7.64 +     * The entry point of the test.
    7.65 +     * @param args the array of command line arguments.
    7.66 +     */
    7.67 +    public static void main(String[] args) {
    7.68 +        TestSubTitle tester = new TestSubTitle();
    7.69 +        run(tester, ARGS, TEST, NEG_TEST);
    7.70 +        tester.printSummary();
    7.71 +    }
    7.72 +
    7.73 +    /**
    7.74 +     * {@inheritDoc}
    7.75 +     */
    7.76 +    public String getBugId() {
    7.77 +        return BUG_ID;
    7.78 +    }
    7.79 +
    7.80 +    /**
    7.81 +     * {@inheritDoc}
    7.82 +     */
    7.83 +    public String getBugName() {
    7.84 +        return getClass().getName();
    7.85 +    }
    7.86 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/test/com/sun/javadoc/testSubTitle/pkg/C.java	Wed Mar 23 14:40:18 2011 -0700
     8.3 @@ -0,0 +1,30 @@
     8.4 +/*
     8.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     8.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.7 + *
     8.8 + * This code is free software; you can redistribute it and/or modify it
     8.9 + * under the terms of the GNU General Public License version 2 only, as
    8.10 + * published by the Free Software Foundation.
    8.11 + *
    8.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    8.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    8.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    8.15 + * version 2 for more details (a copy is included in the LICENSE file that
    8.16 + * accompanied this code).
    8.17 + *
    8.18 + * You should have received a copy of the GNU General Public License version
    8.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    8.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    8.21 + *
    8.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    8.23 + * or visit www.oracle.com if you need additional information or have any
    8.24 + * questions.
    8.25 + */
    8.26 +
    8.27 +package pkg;
    8.28 +
    8.29 +/**
    8.30 + * Source file for C
    8.31 + */
    8.32 +public class C {
    8.33 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/test/com/sun/javadoc/testSubTitle/pkg/package.html	Wed Mar 23 14:40:18 2011 -0700
     9.3 @@ -0,0 +1,8 @@
     9.4 +<html lang="en">
     9.5 +<head>
     9.6 +    <title>Package Summary</title>
     9.7 +</head>
     9.8 +<body>
     9.9 +This is the description of package pkg.
    9.10 +</body>
    9.11 +</html>

mercurial