From 3824a4860080dbc3b140e1eb7fa2b4efed115b81 Mon Sep 17 00:00:00 2001 From: Warren Levy Date: Tue, 9 Jan 2001 07:07:51 +0000 Subject: re PR libgcj/1411 (natTimeZone.cc should be removed) Fix for PR libgcj/1411: * Makefile.am: Removed java/util/natTimeZone.cc. * Makefile.in: Rebuilt. * gnu/gcj/text/LocaleData_en_US.java (zoneStringsDefault): Added missing localized timezone names. * java/lang/System.java (getDefaultTimeZoneId): New private method. * java/lang/natSystem.cc (getSystemTimeZone): New private method. (init_properties): Set user.timezone property. * java/text/DateFormatSymbols.java (zoneStringsDefault): Added default timezone names; removed non-standard ones. Use standard ID names per JCL. * java/util/Date.java (toGMTString): Removed zoneGMT variable. (UTC): Ditto. * java/util/TimeZone.java: Add standard ID names per JCL; removed non-standard ones. (getDefaultTimeZoneId): Removed. (zoneGMT): Removed. (getDefaultTimeZoneId): Removed. * java/util/natTimeZone.cc: Removed. From-SVN: r38816 --- libjava/java/util/natTimeZone.cc | 72 ---------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 libjava/java/util/natTimeZone.cc (limited to 'libjava/java/util/natTimeZone.cc') diff --git a/libjava/java/util/natTimeZone.cc b/libjava/java/util/natTimeZone.cc deleted file mode 100644 index 61128c8..0000000 --- a/libjava/java/util/natTimeZone.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include - -#include -#include - -#include -#include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -/* - * This method returns a time zone string that is used by the static - * initializer in java.util.TimeZone to create the default timezone - * instance. This is a key into the timezone table used by - * that class. - */ -jstring -java::util::TimeZone::getDefaultTimeZoneId (void) -{ - time_t current_time; - char **tzinfo, *tzid; - long tzoffset; - jstring retval; - - current_time = time(0); - - mktime(localtime(¤t_time)); - tzinfo = tzname; - tzoffset = timezone; - - if ((tzoffset % 3600) == 0) - tzoffset = tzoffset / 3600; - - if (!strcmp(tzinfo[0], tzinfo[1])) - { - tzid = (char*) _Jv_Malloc (strlen(tzinfo[0]) + 6); - if (!tzid) - return NULL; - - sprintf(tzid, "%s%ld", tzinfo[0], tzoffset); - } - else - { - tzid = (char*) _Jv_Malloc (strlen(tzinfo[0]) + strlen(tzinfo[1]) + 6); - if (!tzid) - return NULL; - - sprintf(tzid, "%s%ld%s", tzinfo[0], tzoffset, tzinfo[1]); - } - - retval = JvNewStringUTF (tzid); - _Jv_Free (tzid); - return retval; -} - -- cgit v1.1