test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
changeset 49139 771616d26ca1
parent 48654 36f58bd6269f
child 50810 0358dad944c7
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Mar 06 17:43:21 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Mar 06 10:45:47 2018 -0800
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug      4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200
-             8186332 8186703
+             8186332 8186703 8182765
  * @summary  Verify that the public modifier does not show up in the
  *           documentation for public methods, as recommended by the JLS.
  *           If A implements I and B extends A, B should be in the list of
@@ -99,14 +99,14 @@
                 + "</ul>",
                 //Make sure "Specified By" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
-                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
+                + "<dd><code><a href=\"Interface.html#method()\">method</a>"
                 + "</code>&nbsp;in interface&nbsp;<code>"
                 + "<a href=\"Interface.html\" title=\"interface in pkg\">"
                 + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
                 + "CE</a>&gt;</code></dd>",
                 //Make sure "Overrides" has substituted type parameters.
                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
-                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
+                + "<dd><code><a href=\"Parent.html#method()\">method</a>"
                 + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
                 + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
                 + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
@@ -120,7 +120,7 @@
                 + "</dl>");
 
         checkOutput("pkg/Interface.html", false,
-                "public int&nbsp;method()",
+                "public int&nbsp;method--",
                 "public static final&nbsp;int field");
 
         checkOutput("pkg/ClassWithStaticMembers.html", false,
@@ -135,6 +135,52 @@
 
                 "<td class=\"colFirst\"><code>static void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"#m()\">m</a></span>()</code></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\">A hider method</div>\n"
+                + "</td>\n",
+
+                "<h4>staticMethod</h4>\n"
+                + "<pre>public static&nbsp;void&nbsp;staticMethod()</pre>\n"
+                + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
+                + "Description copied from interface:&nbsp;<code>"
+                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod()\">"
+                + "InterfaceWithStaticMembers</a></code></span></div>\n"
+                + "<div class=\"block\">A static method</div>\n");
+
+        checkOutput("pkg/ClassWithStaticMembers.InnerClass.html", true,
+                "<pre>public static class <span class=\"typeNameLabel\">"
+                + "ClassWithStaticMembers.InnerClass</span>\n"
+                + "extends java.lang.Object</pre>\n"
+                + "<div class=\"block\">A hider inner class</div>");
+    }
+
+    @Test
+    void test_html4() {
+        javadoc("-d", "out-html4",
+                "-html4",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/Child.html", true,
+                //Make sure "Specified By" has substituted type parameters.
+                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
+                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
+                + "</code>&nbsp;in interface&nbsp;<code>"
+                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
+                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
+                + "CE</a>&gt;</code></dd>",
+                //Make sure "Overrides" has substituted type parameters.
+                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
+                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
+                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
+                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
+                + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
+
+        checkOutput("pkg/ClassWithStaticMembers.html", true,
+                "<td class=\"colFirst\"><code>static void</code></td>\n"
+                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"#m--\">m</a></span>()</code></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">A hider method</div>\n"
@@ -148,11 +194,8 @@
                 + "InterfaceWithStaticMembers</a></code></span></div>\n"
                 + "<div class=\"block\">A static method</div>\n");
 
-        checkOutput("pkg/ClassWithStaticMembers.InnerClass.html", true,
-                "<pre>public static class <span class=\"typeNameLabel\">"
-                + "ClassWithStaticMembers.InnerClass</span>\n"
-                + "extends java.lang.Object</pre>\n"
-                + "<div class=\"block\">A hider inner class</div>");
+        checkOutput("pkg/Interface.html", false,
+                "public int&nbsp;method()");
     }
 
     @Test
@@ -165,6 +208,23 @@
         checkOutput("pkg1/Child.html", true,
             // Ensure the correct Overrides in the inheritance hierarchy is reported
             "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
+            "<dd><code><a href=\"GrandParent.html#method1()\">method1</a></code>" +
+            "&nbsp;in class&nbsp;" +
+            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
+            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
+    }
+
+    @Test
+    void test1_html4() {
+        javadoc("-d", "out-1-html4",
+                "-html4",
+                "-sourcepath", testSrc,
+                "pkg1");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg1/Child.html", true,
+            // Ensure the correct Overrides in the inheritance hierarchy is reported
+            "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
             "<dd><code><a href=\"GrandParent.html#method1--\">method1</a></code>" +
             "&nbsp;in class&nbsp;" +
             "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +