[jdom-interest] JDOM Beta 9 RC 2

Attila Szegedi szegedia at freemail.hu
Wed Apr 23 11:01:43 PDT 2003


One - quite subtle - issue you might run into is that in JDK 1.4 several
core classes have new overloaded methods, and the compiler will generate
calls to them, which under earlier JDKs will cause NoSuchMethodError-s as
the affected classes in earlier JDKs don't feature those methods. The maybe
most prominent example is

java.lang.StringBuffer.append(java.lang.StringBuffer)

method added in 1.4. If you happen to have code where you append a string
buffer to another, then if you compile against 1.4 classes the compiler will
emit code to call this overload, whereas compiling against older (1.3 or
1.2) JDK will emit code to call

java.lang.StringBuffer.append(java.lang.Object)

I was researching this very problem recently because I want to 100% ensure
1.2 compatibility on binary level and not only on source level in another
project (the FreeMarker template engine) I'm administering, so I'm now
adding bootclasspath attributes to the javac tasks in its build.xml file to
point to a 1.2.2 JDK installation and making it mandatory for distro builds.

Attila.


----- Original Message -----
From: "Jason Hunter" <jhunter at servlets.com>
To: "Stephan Trebels" <stephan at ncube.de>
Cc: "Gordon Tyler" <gordon.tyler at sitraka.com>; "JDOM Interest"
<jdom-interest at jdom.org>
Sent: Wednesday, April 23, 2003 5:19 PM
Subject: Re: [jdom-interest] JDOM Beta 9 RC 2


> In my testing the samples ran against JDK 1.2, but I'd like someone else
> to confirm that.
>
> -jh-
>





More information about the jdom-interest mailing list