From 4d49054fb522dd08ee87f63c38baa286e6bbb7d0 Mon Sep 17 00:00:00 2001 From: tromey Date: Mon, 13 May 2002 20:10:37 +0000 Subject: Fixes PR libgcj/6389: * Makefile.in: Rebuilt. * Makefile.am (nat_source_files): Added natTimeZone.cc. * java/util/natTimeZone.cc: New file. * java/util/TimeZone.java (getDefaultTimeZoneId): New method. * java/lang/System.java: Merged with Classpath. * java/lang/Runtime.java: Merged with Classpath. * java/lang/natSystem.cc (setErr0): Renamed from setErr; don't run security check. (setIn0): Renamed from setIn; don't run security check. (setOut0): Renamed from setOut; don't run security check. (file_encoding, getpwuid_adaptor, getSystemTimeZone, init_properties): Moved to natRuntime.cc. Moved many includes to natRuntime.cc. (isWordsBigEndian): New method. * java/lang/natRuntime.cc: Include Long.h, also other includes previously in natSystem.cc. (maxMemory): New function. (exitInternal): Renamed from `_exit'. (exit): Removed. (init): Don't set finalize_on_exit. (exitInternal): Use `finalizeOnExit'. (file_encoding, getpwuid_adaptor): New functions from natSystem.cc. (insertSystemProperties): New method, renamed from System::init_properties. Don't set user.timezone. (_load): Don't call checkLink. (execInternal): New method. (availableProcessors): Likewise. (nativeGetLibname): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53429 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/util/TimeZone.java | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'libjava/java/util/TimeZone.java') diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java index 974065a6e65..eba22363d18 100644 --- a/libjava/java/util/TimeZone.java +++ b/libjava/java/util/TimeZone.java @@ -1,5 +1,5 @@ /* java.util.TimeZone - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,6 +38,7 @@ exception statement from your version. */ package java.util; import java.text.DateFormatSymbols; +import gnu.classpath.Configuration; /** * This class represents a time zone offset and handles daylight savings. @@ -753,16 +754,32 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable /* Look up default timezone */ static { - // System.loadLibrary("javautil"); - + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary("javautil"); + } String tzid = System.getProperty("user.timezone"); + if (tzid == null) + tzid = getDefaultTimeZoneId(); + if (tzid == null) tzid = "GMT"; defaultZone = getTimeZone(tzid); } + /* This method returns us a time zone id string which is in the + form . + The GMT offset is in seconds, except where it is evenly divisible + by 3600, then it is in hours. If the zone does not observe + daylight time, then the daylight zone name is omitted. Examples: + in Chicago, the timezone would be CST6CDT. In Indianapolis + (which does not have Daylight Savings Time) the string would + be EST5 + */ + private static native String getDefaultTimeZoneId(); + /** * Gets the time zone offset, for current date, modified in case of * daylight savings. This is the offset to add to UTC to get the local -- cgit v1.2.1