/* java.util.TimeZone
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.util;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.text.DateFormatSymbols;
/**
* This class represents a time zone offset and handles daylight savings.
*
* You can get the default time zone with getDefault.
* This represents the time zone where program is running.
*
* Another way to create a time zone is getTimeZone, where
* you can give an identifier as parameter. For instance, the identifier
* of the Central European Time zone is "CET".
*
* With the getAvailableIDs method, you can get all the
* supported time zone identifiers.
*
* @see Calendar
* @see SimpleTimeZone
* @author Jochen Hoenicke
*/
public abstract class TimeZone implements java.io.Serializable, Cloneable
{
/**
* Constant used to indicate that a short timezone abbreviation should
* be returned, such as "EST"
*/
public static final int SHORT = 0;
/**
* Constant used to indicate that a long timezone name should be
* returned, such as "Eastern Standard Time".
*/
public static final int LONG = 1;
/**
* The time zone identifier, e.g. PST.
*/
private String ID;
/**
* The default time zone, as returned by getDefault.
*/
private static TimeZone defaultZone0;
/**
* Tries to get the default TimeZone for this system if not already
* set. It will call getDefaultTimeZone(String) with
* the result of System.getProperty("user.timezone").
* If that fails it calls VMTimeZone.getDefaultTimeZoneId().
* If that also fails GMT is returned.
*/
private static synchronized TimeZone defaultZone()
{
/* Look up default timezone */
if (defaultZone0 == null)
{
defaultZone0 = (TimeZone) AccessController.doPrivileged
(new PrivilegedAction()
{
public Object run()
{
TimeZone zone = null;
// Prefer System property user.timezone.
String tzid = System.getProperty("user.timezone");
if (tzid != null && !tzid.equals(""))
zone = getDefaultTimeZone(tzid);
// Try platfom specific way.
if (zone == null)
zone = VMTimeZone.getDefaultTimeZoneId();
// Fall back on GMT.
if (zone == null)
zone = (TimeZone) timezones().get("GMT");
return zone;
}
});
}
return defaultZone0;
}
private static final long serialVersionUID = 3581463369166924961L;
/**
* HashMap for timezones by ID.
*/
private static HashMap timezones0;
/* initialize this static field lazily to overhead if
* it is not needed:
*/
// Package-private to avoid a trampoline.
static synchronized HashMap timezones()
{
if (timezones0 == null)
{
HashMap timezones = new HashMap();
timezones0 = timezones;
TimeZone tz;
// Automatically generated by scripts/timezones.pl
// XXX - Should we read this data from a file?
tz = new SimpleTimeZone(-11000 * 3600, "MIT");
timezones0.put("MIT", tz);
timezones0.put("Pacific/Apia", tz);
timezones0.put("Pacific/Midway", tz);
timezones0.put("Pacific/Niue", tz);
timezones0.put("Pacific/Pago_Pago", tz);
tz = new SimpleTimeZone
(-10000 * 3600, "America/Adak",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("America/Adak", tz);
tz = new SimpleTimeZone(-10000 * 3600, "HST");
timezones0.put("HST", tz);
timezones0.put("Pacific/Fakaofo", tz);
timezones0.put("Pacific/Honolulu", tz);
timezones0.put("Pacific/Johnston", tz);
timezones0.put("Pacific/Rarotonga", tz);
timezones0.put("Pacific/Tahiti", tz);
tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
timezones0.put("Pacific/Marquesas", tz);
tz = new SimpleTimeZone
(-9000 * 3600, "AST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("AST", tz);
timezones0.put("America/Anchorage", tz);
timezones0.put("America/Juneau", tz);
timezones0.put("America/Nome", tz);
timezones0.put("America/Yakutat", tz);
tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
timezones0.put("Pacific/Gambier", tz);
tz = new SimpleTimeZone
(-8000 * 3600, "PST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("PST", tz);
timezones0.put("PST8PDT", tz);
timezones0.put("America/Dawson", tz);
timezones0.put("America/Los_Angeles", tz);
timezones0.put("America/Tijuana", tz);
timezones0.put("America/Vancouver", tz);
timezones0.put("America/Whitehorse", tz);
timezones0.put("US/Pacific-New", tz);
tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
timezones0.put("Pacific/Pitcairn", tz);
tz = new SimpleTimeZone
(-7000 * 3600, "MST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("MST", tz);
timezones0.put("MST7MDT", tz);
timezones0.put("America/Boise", tz);
timezones0.put("America/Chihuahua", tz);
timezones0.put("America/Denver", tz);
timezones0.put("America/Edmonton", tz);
timezones0.put("America/Inuvik", tz);
timezones0.put("America/Mazatlan", tz);
timezones0.put("America/Shiprock", tz);
timezones0.put("America/Yellowknife", tz);
tz = new SimpleTimeZone(-7000 * 3600, "MST7");
timezones0.put("MST7", tz);
timezones0.put("PNT", tz);
timezones0.put("America/Dawson_Creek", tz);
timezones0.put("America/Hermosillo", tz);
timezones0.put("America/Phoenix", tz);
tz = new SimpleTimeZone
(-6000 * 3600, "CST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("CST", tz);
timezones0.put("CST6CDT", tz);
timezones0.put("America/Cambridge_Bay", tz);
timezones0.put("America/Cancun", tz);
timezones0.put("America/Chicago", tz);
timezones0.put("America/Menominee", tz);
timezones0.put("America/Merida", tz);
timezones0.put("America/Mexico_City", tz);
timezones0.put("America/Monterrey", tz);
timezones0.put("America/Rainy_River", tz);
timezones0.put("America/Winnipeg", tz);
tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
timezones0.put("America/Belize", tz);
timezones0.put("America/Costa_Rica", tz);
timezones0.put("America/El_Salvador", tz);
timezones0.put("America/Guatemala", tz);
timezones0.put("America/Managua", tz);
timezones0.put("America/Regina", tz);
timezones0.put("America/Swift_Current", tz);
timezones0.put("America/Tegucigalpa", tz);
timezones0.put("Pacific/Galapagos", tz);
tz = new SimpleTimeZone
(-6000 * 3600, "Pacific/Easter",
Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
timezones0.put("Pacific/Easter", tz);
tz = new SimpleTimeZone
(-5000 * 3600, "America/Grand_Turk",
Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
timezones0.put("America/Grand_Turk", tz);
timezones0.put("America/Havana", tz);
tz = new SimpleTimeZone(-5000 * 3600, "EST5");
timezones0.put("EST5", tz);
timezones0.put("IET", tz);
timezones0.put("America/Bogota", tz);
timezones0.put("America/Cayman", tz);
timezones0.put("America/Eirunepe", tz);
timezones0.put("America/Guayaquil", tz);
timezones0.put("America/Indiana/Indianapolis", tz);
timezones0.put("America/Indiana/Knox", tz);
timezones0.put("America/Indiana/Marengo", tz);
timezones0.put("America/Indiana/Vevay", tz);
timezones0.put("America/Indianapolis", tz);
timezones0.put("America/Iqaluit", tz);
timezones0.put("America/Jamaica", tz);
timezones0.put("America/Lima", tz);
timezones0.put("America/Panama", tz);
timezones0.put("America/Pangnirtung", tz);
timezones0.put("America/Port-au-Prince", tz);
timezones0.put("America/Porto_Acre", tz);
timezones0.put("/*--------------------------------------------------------------------------*/
/* File name : err8.java */
/* : */
/* Cause : When "do while" statement has only "break", error. */
/* : */
/* Message : err8.java: In class `err8': xxxxxx */
/* : err8.java: In method `main(java.lang.String[])': */
/* : err8.java:20: Unreachable statement. */
/* : } while (true) ; */
/* : ^ */
/* : 1 error */
/*--------------------------------------------------------------------------*/
public class err8 {
public static void main(String[] args) {
do {
break;
} while (true) ;
System.out.println("OK");
}
}