changeset 51416:e92d48cf94f9

8205627: Replace hardcoded spec version value in build.tools.ExtLink taglet Reviewed-by: jjg, erikj
author mchung
date Mon, 25 Jun 2018 22:27:09 -0700
parents 9f781ce22e7d
children 0ed32e0d98e1
files make/Docs.gmk make/jdk/src/classes/build/tools/taglet/ExtLink.java
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/make/Docs.gmk	Mon Jun 25 20:58:01 2018 -0700
+++ b/make/Docs.gmk	Mon Jun 25 22:27:09 2018 -0700
@@ -327,7 +327,8 @@
   )
 
   ifeq ($$($1_JAVADOC_CMD), )
-    $1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
+    $1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true \
+        -Dextlink.spec.version=$$(VERSION_SPECIFICATION) $$($1_JAVA_ARGS) \
         $$(NEW_JAVADOC)
   endif
 
--- a/make/jdk/src/classes/build/tools/taglet/ExtLink.java	Mon Jun 25 20:58:01 2018 -0700
+++ b/make/jdk/src/classes/build/tools/taglet/ExtLink.java	Mon Jun 25 22:27:09 2018 -0700
@@ -37,7 +37,6 @@
 import jdk.javadoc.doclet.Taglet;
 
 import static com.sun.source.doctree.DocTree.Kind.*;
-import static jdk.javadoc.doclet.Taglet.Location.*;
 
 /**
  * An inline tag to conveniently insert an external link.
@@ -53,13 +52,23 @@
  * }
  */
 public class ExtLink implements Taglet {
+    static final String SPEC_VERSION;
+
+    static {
+        SPEC_VERSION = System.getProperty("extlink.spec.version");
+        if (SPEC_VERSION == null) {
+            throw new RuntimeException("extlink.spec.version property not set");
+        }
+    }
 
     static final String TAG_NAME = "extLink";
 
-    static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase10&id=";
+    static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase" +
+        SPEC_VERSION + "&id=";
 
     static final Pattern TAG_PATTERN = Pattern.compile("(?s)(\\s*)(?<name>\\w+)(\\s+)(?<desc>.*)$");
 
+
     /**
      * Returns the set of locations in which the tag may be used.
      */