6726154: javadoc generated with incorrect version in comment
authorkizune
Tue, 19 Nov 2013 22:14:51 +0400
changeset 21888 568c5da9f16b
parent 21887 8dc93a1c9782
child 21889 7c3939a495ab
6726154: javadoc generated with incorrect version in comment Reviewed-by: jjg, bpatel, erikj, tbell
langtools/make/BuildLangtools.gmk
langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java
langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
--- a/langtools/make/BuildLangtools.gmk	Mon Nov 04 11:08:41 2013 +0100
+++ b/langtools/make/BuildLangtools.gmk	Tue Nov 19 22:14:51 2013 +0400
@@ -81,6 +81,7 @@
 	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javap/resources/version.properties
 	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javac/resources/version.properties
 	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties
+	$(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javadoc/resources/version.properties
 	$(ECHO) Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles
 	$(TOOL_COMPILEPROPS_CMD) $(PROPCMDLINE) \
 	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties \
@@ -94,6 +95,9 @@
 	        java.util.ListResourceBundle \
 	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties \
 	        $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.java \
+	        java.util.ListResourceBundle \
+	    -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javadoc/resources/version.properties \
+	        $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javadoc/resources/version.java \
 	        java.util.ListResourceBundle
 	$(ECHO) PROPS_ARE_CREATED = yes > $@
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Mon Nov 04 11:08:41 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Tue Nov 19 22:14:51 2013 +0400
@@ -204,12 +204,27 @@
             "com.sun.tools.doclets.formats.html.resources.standard");
     }
 
+    private final String versionRBName = "com.sun.tools.javadoc.resources.version";
+    private ResourceBundle versionRB;
+
     /**
      * Return the build date for the doclet.
      */
     @Override
     public String getDocletSpecificBuildDate() {
-        return BUILD_DATE;
+        if (versionRB == null) {
+            try {
+                versionRB = ResourceBundle.getBundle(versionRBName);
+            } catch (MissingResourceException e) {
+                return BUILD_DATE;
+            }
+        }
+
+        try {
+            return versionRB.getString("release");
+        } catch (MissingResourceException e) {
+            return BUILD_DATE;
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Mon Nov 04 11:08:41 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Tue Nov 19 22:14:51 2013 +0400
@@ -331,7 +331,7 @@
         if (timestamp) {
             Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
             Date today = calendar.getTime();
-            text += " ("+ ConfigurationImpl.BUILD_DATE + ") on " + today;
+            text += " ("+ configuration.getDocletSpecificBuildDate() + ") on " + today;
         }
         return new Comment(text);
     }