changeset 4083:2e47daa5c52b

8177417: Constructor Summary readability problems in jdk9 javadoc Reviewed-by: jjg, ksrini
author bpatel
date Tue, 04 Apr 2017 14:06:54 -0700
parents 17bb6279f8cb
children 838ccb5763e1
files src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java
diffstat 6 files changed, 30 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Apr 04 14:02:03 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Apr 04 14:06:54 2017 -0700
@@ -169,11 +169,7 @@
      */
     @Override
     public void setSummaryColumnStyleAndScope(HtmlTree thTree) {
-        if (foundNonPubConstructor) {
-            thTree.addStyle(HtmlStyle.colSecond);
-        } else {
-            thTree.addStyle(HtmlStyle.colFirst);
-        }
+        thTree.addStyle(HtmlStyle.colConstructorName);
         thTree.addAttr(HtmlAttr.SCOPE, "row");
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Tue Apr 04 14:02:03 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Tue Apr 04 14:06:54 2017 -0700
@@ -46,6 +46,7 @@
     bottomNav,
     circle,
     classUseContainer,
+    colConstructorName,
     colFirst,
     colLast,
     colSecond,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Tue Apr 04 14:02:03 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Tue Apr 04 14:06:54 2017 -0700
@@ -540,14 +540,14 @@
     text-align:left;
     padding:0px 0px 12px 10px;
 }
-th.colFirst, th.colSecond, th.colLast, .useSummary th, .constantsSummary th, .packagesSummary th,
+th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .useSummary th, .constantsSummary th, .packagesSummary th,
 td.colFirst, td.colSecond, td.colLast, .useSummary td, .constantsSummary td {
     vertical-align:top;
     padding-right:0px;
     padding-top:8px;
     padding-bottom:3px;
 }
-th.colFirst, th.colSecond, th.colLast, .constantsSummary th, .packagesSummary th {
+th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .constantsSummary th, .packagesSummary th {
     background:#dee3e9;
     text-align:left;
     padding:8px 3px 3px 7px;
@@ -556,7 +556,7 @@
     white-space:nowrap;
     font-size:13px;
 }
-td.colSecond, th.colSecond, td.colLast, th.colLast {
+td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colLast {
     font-size:13px;
 }
 .constantsSummary th, .packagesSummary th {
@@ -573,8 +573,8 @@
 .usesSummary td.colFirst, .usesSummary th.colFirst,
 .providesSummary td.colFirst, .providesSummary th.colFirst,
 .memberSummary td.colFirst, .memberSummary th.colFirst,
-.memberSummary td.colSecond, .memberSummary th.colSecond,
-.typeSummary td.colFirst{
+.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,
+.typeSummary td.colFirst {
     vertical-align:top;
 }
 .packagesSummary th.colLast, .packagesSummary td.colLast {
@@ -584,6 +584,8 @@
 td.colSecond a:link, td.colSecond a:active, td.colSecond a:visited, td.colSecond a:hover,
 th.colFirst a:link, th.colFirst a:active, th.colFirst a:visited, th.colFirst a:hover,
 th.colSecond a:link, th.colSecond a:active, th.colSecond a:visited, th.colSecond a:hover,
+th.colConstructorName a:link, th.colConstructorName a:active, th.colConstructorName a:visited,
+th.colConstructorName a:hover,
 td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover,
 .constantValuesContainer td a:link, .constantValuesContainer td a:active,
 .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
--- a/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Apr 04 14:02:03 2017 -0700
+++ b/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java	Tue Apr 04 14:06:54 2017 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200
+ * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417
  * @summary  Test the case where the overriden method returns a different
  *           type than the method in the child class.  Make sure the
  *           documentation is inherited but the return type isn't.
@@ -43,7 +43,7 @@
 
     @Test
     void test() {
-        javadoc("-d", "out",
+        javadoc("-d", "out", "-private",
                 "-sourcepath", testSrc,
                 "pkg","pkg2");
         checkExit(Exit.OK);
@@ -55,7 +55,15 @@
                 + "returnTypeTest</a></span>&#8203;()</code>",
                 // Check return type in member detail.
                 "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
-                + "PublicChild</a>&nbsp;returnTypeTest&#8203;()</pre>");
+                + "PublicChild</a>&nbsp;returnTypeTest&#8203;()</pre>",
+                "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../pkg/PublicChild.html#PublicChild--\">PublicChild</a></span>&#8203;()</code></th>");
+
+        checkOutput("pkg/PrivateParent.html", true,
+                "<td class=\"colFirst\"><code>private </code></td>\n"
+                + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../pkg/PrivateParent.html#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
+                + "</th>");
 
         // Legacy anchor dimensions (6290760)
         checkOutput("pkg2/A.html", true,
--- a/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java	Tue Apr 04 14:02:03 2017 -0700
+++ b/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java	Tue Apr 04 14:06:54 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -24,6 +24,12 @@
 package pkg;
 
 class PrivateParent {
+    /**
+     * Test private constructor.
+     * @param i a test parameter.
+     */
+    private PrivateParent(int i) {
+    }
 
     /**
      * Test to make sure the member summary inherits documentation
--- a/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Tue Apr 04 14:02:03 2017 -0700
+++ b/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Tue Apr 04 14:06:54 2017 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743
+ * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib
@@ -140,8 +140,8 @@
                 + ".usesSummary td.colFirst, .usesSummary th.colFirst,\n"
                 + ".providesSummary td.colFirst, .providesSummary th.colFirst,\n"
                 + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
-                + ".memberSummary td.colSecond, .memberSummary th.colSecond,\n"
-                + ".typeSummary td.colFirst{\n"
+                + ".memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,\n"
+                + ".typeSummary td.colFirst {\n"
                 + "    vertical-align:top;\n"
                 + "}",
                 ".overviewSummary td, .memberSummary td, .typeSummary td,\n"