changeset 48039:6a9bb4f77d50

8190822: Remove dead code that could lead to invalid HTML Reviewed-by: bpatel, ksrini
author jjg
date Thu, 16 Nov 2017 15:17:47 -0800
parents 4a28dc8a86c2
children 90e0110a05f6
files src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java
diffstat 4 files changed, 10 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Thu Nov 16 15:16:21 2017 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java	Thu Nov 16 15:17:47 2017 -0800
@@ -1089,12 +1089,11 @@
      * be null or empty string if no member is being referenced.
      * @param label the label for the external link.
      * @param strong true if the link should be strong.
-     * @param style the style of the link.
      * @param code true if the label should be code font.
+     * @return the link
      */
     public Content getCrossClassLink(String qualifiedClassName, String refMemName,
-                                    Content label, boolean strong, String style,
-                                    boolean code) {
+                                    Content label, boolean strong, boolean code) {
         String className = "";
         String packageName = qualifiedClassName == null ? "" : qualifiedClassName;
         int periodIndex;
@@ -1117,8 +1116,8 @@
                                 className + ".html", refMemName);
                 return Links.createLink(link,
                     (label == null) || label.isEmpty() ? defaultLabel : label,
-                    strong, style,
-                    configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName),
+                    strong,
+                    resources.getText("doclet.Href_Class_Or_Interface_Title", packageName),
                     "");
             }
         }
@@ -1407,7 +1406,7 @@
                     return Links.createLink(packageCrossLink,
                         (label.isEmpty() ? text : label));
                 } else if ((classCrossLink = getCrossClassLink(refClassName,
-                        refMemName, label, false, "", !isLinkPlain)) != null) {
+                        refMemName, label, false, !isLinkPlain)) != null) {
                     // Class cross link found (possibly to a member in the class)
                     return classCrossLink;
                 } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Thu Nov 16 15:16:21 2017 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java	Thu Nov 16 15:17:47 2017 -0800
@@ -97,7 +97,6 @@
                                 filename.fragment(classLinkInfo.where),
                                 label,
                                 classLinkInfo.isStrong,
-                                classLinkInfo.styleName,
                                 title,
                                 classLinkInfo.target));
                         if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
@@ -109,8 +108,7 @@
         } else {
             Content crossLink = m_writer.getCrossClassLink(
                 typeElement.getQualifiedName().toString(), classLinkInfo.where,
-                label, classLinkInfo.isStrong, classLinkInfo.styleName,
-                true);
+                label, classLinkInfo.isStrong, true);
             if (crossLink != null) {
                 link.addContent(crossLink);
                 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java	Thu Nov 16 15:16:21 2017 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java	Thu Nov 16 15:17:47 2017 -0800
@@ -231,11 +231,6 @@
     public String where = "";
 
     /**
-     * String style of text defined in style sheet.
-     */
-    public String styleName = "";
-
-    /**
      * The value of the target.
      */
     public String target = "";
@@ -316,15 +311,6 @@
     }
 
     /**
-     * Set the style to be used for the link.
-     * @param styleName  String style of text defined in style sheet.
-     */
-    public LinkInfoImpl styleName(String styleName) {
-        this.styleName = styleName;
-        return this;
-    }
-
-    /**
      * Set the target to be used for the link.
      * @param target the target name.
      */
@@ -443,7 +429,6 @@
         return "LinkInfoImpl{" +
                 "context=" + context +
                 ", where=" + where +
-                ", styleName=" + styleName +
                 ", target=" + target +
                 super.toString() + '}';
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Thu Nov 16 15:16:21 2017 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Thu Nov 16 15:17:47 2017 -0800
@@ -170,7 +170,7 @@
      * @return a content tree for the link
      */
     public static Content createLink(DocPath path, String label) {
-        return Links.createLink(path, new StringContent(label), false, "", "", "");
+        return Links.createLink(path, new StringContent(label), false, "", "");
     }
 
     /**
@@ -192,14 +192,13 @@
      * @param path      the path for the link
      * @param label     the content for the link
      * @param strong    whether to wrap the {@code label} in a SPAN element
-     * @param stylename (deprecated)
      * @param title     the title for the link
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocPath path, Content label, boolean strong, String stylename,
+    public static Content createLink(DocPath path, Content label, boolean strong,
             String title, String target) {
-        return createLink(new DocLink(path), label, strong, stylename, title, target);
+        return createLink(new DocLink(path), label, strong, title, target);
     }
 
     /**
@@ -254,22 +253,16 @@
      * @param link      the details for the link
      * @param label     the content for the link
      * @param strong    whether to wrap the {@code label} in a SPAN element
-     * @param stylename (deprecated)
      * @param title     the title for the link
      * @param target    the target for the link, or null
      * @return a content tree for the link
      */
-    public static Content createLink(DocLink link, Content label, boolean strong, String stylename,
+    public static Content createLink(DocLink link, Content label, boolean strong,
             String title, String target) {
         Content body = label;
         if (strong) {
             body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
         }
-        if (stylename != null && stylename.length() != 0) {
-            HtmlTree t = new HtmlTree(HtmlTag.FONT, body);
-            t.addAttr(HtmlAttr.CLASS, stylename);
-            body = t;
-        }
         HtmlTree l = HtmlTree.A(link.toString(), body);
         if (title != null && title.length() != 0) {
             l.addAttr(HtmlAttr.TITLE, title);