db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tiago Espinha <ti...@espinhas.net>
Subject Java 1.4.2 or Java6?
Date Thu, 25 Jun 2009 11:45:45 GMT
Hello everyone,

I have been around for a couple of months and I still manage to learn
something new everyday; also, I manage to find something everyday about
which I am not sure how I should address.

This time I am wondering about the Java version. Basically I have two
setups: on one of them I have *only* jdk 1.6 and on the other I have the
whole set of jdks (1.4.2, 1.5 and 1.6).

Yesterday, I made a change and it compiled normally against Sun's jdk1.6 -
however, when I ported it over to the other setup to run suites.All, it
wouldn't compile since it was attempting to use 1.4.2 (on this one I have
all the jdks declared in the ant.properties file) and the change uses an
overload that was only introduced in either 1.5 or 1.6.

Since this is a change I made on a test, should I make sure it is backwards
compatible with 1.4.2 or is 1.6 fine? Also, is there a way to force ant to
use 1.6 when all the jdks are available?

Finally, for some background, the overload is the
String.replace(CharSequence, CharSequence);. On 1.4.2 there is only a
replace method in Strings that takes two chars and it doesn't allow us to
replace whole chunks of a string, so that's why I got the error. If I have
to make it 1.4.2-compatible I am also open to suggestions on replacing
chunks of a string, in this case with an empty string (so in essence,
removing whole pieces of a string a string).


View raw message