8043698: <title> tag not getting generated in package-summary pages for un-named packages
authorbpatel
Wed, 17 Sep 2014 23:52:19 -0700
changeset 26664 4e8e04f40479
parent 26663 f2d8845a9bb2
child 26665 e813baa25bf2
8043698: <title> tag not getting generated in package-summary pages for un-named packages Reviewed-by: jjg, ksrini
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java
langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Mon Sep 15 12:43:35 2014 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Wed Sep 17 23:52:19 2014 -0700
@@ -90,8 +90,7 @@
      * {@inheritDoc}
      */
     public Content getPackageHeader(String heading) {
-        String pkgName = packageDoc.name();
-        Content bodyTree = getBody(true, getWindowTitle(pkgName));
+        Content bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
         addTop(bodyTree);
         addNavLinks(true, bodyTree);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Mon Sep 15 12:43:35 2014 +0100
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Wed Sep 17 23:52:19 2014 -0700
@@ -103,8 +103,7 @@
      * {@inheritDoc}
      */
     public Content getPackageHeader(String heading) {
-        String pkgName = packageDoc.name();
-        Content bodyTree = getBody(true, getWindowTitle(pkgName));
+        Content bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
         addTop(bodyTree);
         addNavLinks(true, bodyTree);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
--- a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java	Mon Sep 15 12:43:35 2014 +0100
+++ b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java	Wed Sep 17 23:52:19 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4904075 4774450 5015144
+ * @bug      4904075 4774450 5015144 8043698
  * @summary  Reference unnamed package as "Unnamed", not empty string.
  *           Generate a package summary for the unnamed package.
  * @author   jamieh
@@ -51,6 +51,9 @@
                 "This is a package comment for the unnamed package.",
                 "This is a class in the unnamed package.");
 
+        checkOutput("package-summary.html", true,
+                "<title>&lt;Unnamed&gt;</title>");
+
         checkOutput("package-tree.html", true,
                 "<h1 class=\"title\">Hierarchy For Package &lt;Unnamed&gt;</h1>");