[patch] use the classpath version for gjdoc as well

Alexander Sack asac@ubuntu.com
Mon Jun 15 10:11:00 GMT 2009


On Sat, Jun 13, 2009 at 09:31:58PM +0200, Mark Wielaard wrote:
> > 
> > 2009-06-13  Alexander Sack  <asac@jwsdot.com>
> > 
> >         * tools/gnu/classpath/tools/gjdoc/Main.java (start): Use
> >         gnu.classpath.Configuration.CLASSPATH_VERSION as version number.
> >         * tools/classes/gnu/classpath/tools/gjdoc/Main.class: Regenerate.
> 
> The idea is fine. But then please do also submit a patch to GNU
> Classpath that just removes the whole getGjdocVersion() method.
> Note that there is another variant called getDocletVersion() in
> HtmlDoclet.java that you also want to change in this case.
> 

Please consider this one instead. I kept the get...Version methods and
made them use the constant from Confguration. I think thats better
than removing the methods alltogether. If you want them to be removed
anyway, let me know.

Also, I added HtmlDoclet.java to the patch as suggested. Matthias also
added the "Regenerate." of the .class to the changelog. Am I supposed
to include a diff for the .class files as well?

2009-06-15  Alexander Sack  <asac@ubuntu.com>

	* tools/gnu/classpath/tools/gjdoc/Main.java,
	  tools/doclets/htmldoclet/HtmlDoclet.java: Use
	gnu.classpath.Configuration.CLASSPATH_VERSION to implement
	get...Version()

---
 src/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java |   17 +---------
 src/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java                    |   11 ------
 2 files changed, 3 insertions(+), 25 deletions(-)

Index: gcj-4.4-4.4.0/src/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
===================================================================
--- gcj-4.4-4.4.0.orig/src/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
+++ gcj-4.4-4.4.0/src/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
@@ -1820,26 +1820,17 @@ public final class Main
   public boolean isCacheRawComments()
   {
     return true;
   }
 
   public String getGjdocVersion()
   {
     if (null == gjdocVersion) {
-      try {
-        Properties versionProperties = new Properties();
-        versionProperties.load(getClass().getResourceAsStream("version.properties"));
-        gjdocVersion = versionProperties.getProperty("gjdoc.version");
-      }
-      catch (IOException ignore) {
-      }
-      if (null == gjdocVersion) {
-        gjdocVersion = "unknown";
-      }
+      gjdocVersion = "" + gnu.classpath.Configuration.CLASSPATH_VERSION;
     }
     return gjdocVersion;
   }
 
   public boolean isReflectionEnabled()
   {
     return this.option_reflection;
   }
Index: gcj-4.4-4.4.0/src/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
===================================================================
--- gcj-4.4-4.4.0.orig/src/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
+++ gcj-4.4-4.4.0/src/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
@@ -3731,30 +3731,17 @@ public class HtmlDoclet
       else {
          return title + " (" + optionWindowTitle.getValue() + ")";
       }
    }
 
    protected String getDocletVersion()
    {
       if (null == docletVersion) {
-         try {
-            Properties versionProperties = new Properties();
-            InputStream in = getClass().getResourceAsStream("/version.properties");
-            if (in == null) {
-            	in = new FileInputStream("src/resources/version.properties");
-            }
-            versionProperties.load(in);
-            docletVersion = versionProperties.getProperty("gjdoc.version");
-         }
-         catch (IOException ignore) {
-         }
-         if (null == docletVersion) {
-            docletVersion = "unknown";
-         }
+         docletVersion = "" + gnu.classpath.Configuration.CLASSPATH_VERSION;
       }
       return docletVersion;
    }
 
    private Map getStylesheets()
    {
       Map sheets = new HashMap();
       if (null != optionStylesheetFile.getValue()) {



 - Alexander



More information about the Java-patches mailing list