This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] use the classpath version for gjdoc as well


2009/6/15 Alexander Sack <asac@ubuntu.com>:
> 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
>
>

CLASSPATH_VERSION is a string, you don't need to concatenate it with
the empty string.

A rebuild with --enable-java-maintainer-mode will regenerate the class files.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]