[m-rev.] for review: Java implementation of time library now tested and correct

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 17 09:02:33 AEDT 2003


On 16-Dec-2003, James Goddard <goddardjames at yahoo.com> wrote:
> [Fergus wrote:]
> > What happened to the code using DST_OFFSET?
> 
> It turns out that the DST_OFFSET value changes
> depending on whether the current time the Calendar is
> set to is daylight savings or not.
...
> I'll change it to use SimpleTimeZone.getDSTSavings(), which stays constant.

OK. 

Oh, wait... getDSTSavings() is new in J2SE 1.4 (version 1.4 of the Java
2 SDK Standard Edition), which was released by Sun in Feb 2002.  I think
we only have J2SE 1.3.1 installed on our systems, specifically jupiter &
swordfish, which are running SuSE 8.1.  So that won't work, will it?

In general our users might not have the latest and greatest Java
implementation installed.  Version 1.3 dates to May 2000 or earlier,
so I think it is reasonable to assume that, but given the multiplicity
of Java implementations, some of which are playing catch-up with Sun,
it might be wiser to avoid relying on 1.4 if we don't have to.

An alternative would be to use Reflection to see whether the library
had getDSTSavings(), and if not, to fall back to just hard-coding one
hour. 

There might well be other places where we are depending on J2SE 1.4,
though if we are running our tests with J2SE 1.3.1, those should show up
as test case failures.

We should document somewhere which version of Java we require.  Probably
we should add a README.Java file, alongside the other README.* files,
and mention README.Java in w3/include/backends.inc.  The README.java
file should also describe how to install the Java versions of the Mercury
runtime and library.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list