changeset 60079:020b43d344aa amber-demo-II

Automatic merge with sealed-types
author mcimadamore
date Sat, 15 Feb 2020 01:20:34 +0000
parents 380a4051d443 61dc64ca3023
children 40865a85217a
files src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css test/langtools/jdk/javadoc/doclet/testSealedTypes/TestSealedTypes.java
diffstat 6 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Fri Feb 14 22:20:53 2020 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java	Sat Feb 15 01:20:34 2020 +0000
@@ -112,8 +112,7 @@
             Content tdSummary) {
         ExecutableElement ee = (ExecutableElement)member;
         Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
-                writer.getDocLink(context, te, ee,
-                        writer.getDocLink(context, te, ee, name(ee), false)));
+                writer.getDocLink(context, te, ee, name(ee), false));
         Content code = HtmlTree.CODE(memberLink);
         addParameters(ee, code);
         tdSummary.add(code);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Fri Feb 14 22:20:53 2020 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Sat Feb 15 01:20:34 2020 +0000
@@ -268,13 +268,13 @@
                         type));
                 pre.add(link);
             }
-
+            if (linkablePermits.size() < permits.size()) {
+                Content c = new StringContent(resources.getText("doclet.not.exhaustive"));
+                pre.add(" ");
+                pre.add(HtmlTree.SPAN(HtmlStyle.permitsNote, c));
+            }
         }
         classInfoTree.add(pre);
-        // TODO: is this the right place to document this, as compared to an "all permitted subtypes" list
-        if (linkablePermits.size() < permits.size()) {
-            classInfoTree.add(" (not exhaustive)"); // FIXME: use <span> and L10N
-        }
     }
 
     @SuppressWarnings("preview")
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Fri Feb 14 22:20:53 2020 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Sat Feb 15 01:20:34 2020 +0000
@@ -112,6 +112,7 @@
     packagesSummary,
     packageUses,
     paramLabel,
+    permitsNote,
     propertyDetails,
     propertySummary,
     providesSummary,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Fri Feb 14 22:20:53 2020 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Sat Feb 15 01:20:34 2020 +0000
@@ -62,6 +62,7 @@
 doclet.navEnum=Enum Constants
 doclet.navConstructor=Constr
 doclet.navMethod=Method
+doclet.not.exhaustive=(not exhaustive)
 doclet.Index=Index
 doclet.Window_Single_Index=Index
 doclet.Window_Split_Index={0}-Index
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Fri Feb 14 22:20:53 2020 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Sat Feb 15 01:20:34 2020 +0000
@@ -692,6 +692,11 @@
 .verticalSeparator {
     padding: 0 5px;
 }
+span.permitsNote {
+    color: grey;
+    font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
+    font-style: italic
+}
 /*
  * Indicator icon for external links.
  */
--- a/test/langtools/jdk/javadoc/doclet/testSealedTypes/TestSealedTypes.java	Fri Feb 14 22:20:53 2020 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testSealedTypes/TestSealedTypes.java	Sat Feb 15 01:20:34 2020 +0000
@@ -219,7 +219,8 @@
                 "<pre>public sealed class <span class=\"typeNameLabel\">A</span>\n"
                 + "extends java.lang.Object\n"
                 + "permits <a href=\"B.html\" title=\"class in p\">B</a>, "
-                + "<a href=\"C.html\" title=\"class in p\">C</a>, p.D</pre>");
+                + "<a href=\"C.html\" title=\"class in p\">C</a> "
+		+ "<span class=\"permitsNote\">(not exhaustive)</span></pre>");
     }
 
     // @Test // javac incorrectly rejects the source
@@ -267,7 +268,8 @@
                 "<pre>public sealed class <span class=\"typeNameLabel\">A</span>\n"
                 + "extends java.lang.Object\n"
                 + "permits <a href=\"B.html\" title=\"class in p\">B</a>, "
-                + "<a href=\"C.html\" title=\"class in p\">C</a>, p.D</pre>");
+                + "<a href=\"C.html\" title=\"class in p\">C</a> "
+		+ "<span class=\"permitsNote\">(not exhaustive)</span></pre>");
     }
 
     @Test