Name: pa48320 Date: 11/25/2002
TimeZone.getAvailableIDs() is missing 3 time zone IDs. They are
ROC
GMT+0
GMT-0
Here is how to reproduce the problem.
(test program's source code is provided below)
% javac TestTimeZoneAvailableIDs.java
% java -fullversion
java full version "1.4.1_01-b01"
% java TestTimeZoneAvailableIDs
TimeZone ID ROC is not recognized
TimeZone ID GMT+0 is not recognized
TimeZone ID GMT-0 is not recognized
%
Here is a test program.
import java.util.TimeZone;
import java.util.Hashtable;
public class TestTimeZoneAvailableIDs {
public static void main(String[] args) {
Hashtable zoneTable = new Hashtable();
String[] availableIDs = TimeZone.getAvailableIDs();
for (int i = 0; i < availableIDs.length; i++) {
zoneTable.put(availableIDs[i], TimeZone.getTimeZone(availableIDs[i]));
}
for (int j = 0; j < allIDs.length; j++) {
if (zoneTable.containsKey(allIDs[j])) {
} else {
System.out.println("TimeZone ID " + allIDs[j] + " is not recognized");
}
}
}
static String[] allIDs = {
"Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers",
"Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul",
"Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura",
"Africa/Cairo", "Egypt", "Africa/Casablanca", "Africa/Ceuta",
"Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti",
"Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone",
"Africa/Harare", "Africa/Johannesburg", "Africa/Kampala", "Africa/Khartoum",
"Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville",
"Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka",
"Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane",
"Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena",
"Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou",
"Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Timbuktu", "Africa/Tripoli",
"Libya", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Atka",
"US/Aleutian", "America/Anchorage", "SystemV/YST9YDT", "US/Alaska",
"America/Anguilla", "America/Antigua", "America/Araguaina", "America/Aruba",
"America/Asuncion", "America/Barbados", "America/Belem", "America/Belize",
"America/Boa_Vista", "America/Bogota", "America/Boise",
"America/Buenos_Aires", "America/Cambridge_Bay", "America/Cancun",
"America/Caracas", "America/Catamarca", "America/Cayenne", "America/Cayman",
"America/Chicago", "CST6CDT", "SystemV/CST6CDT", "US/Central",
"America/Chihuahua", "America/Cordoba", "America/Rosario",
"America/Costa_Rica", "America/Cuiaba", "America/Curacao",
"America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek",
"America/Denver", "America/Shiprock", "MST7MDT", "Navajo", "SystemV/MST7MDT",
"US/Mountain", "America/Detroit", "US/Michigan", "America/Dominica",
"America/Edmonton", "Canada/Mountain", "America/Eirunepe",
"America/El_Salvador", "America/Fortaleza", "America/Glace_Bay",
"America/Godthab", "America/Goose_Bay", "America/Grand_Turk",
"America/Grenada", "America/Guadeloupe", "America/Guatemala",
"America/Guayaquil", "America/Guyana", "America/Halifax", "Canada/Atlantic",
"SystemV/AST4ADT", "America/Havana", "Cuba", "America/Hermosillo",
"America/Indiana/Knox", "America/Knox_IN", "US/Indiana-Starke",
"America/Indiana/Marengo", "America/Indiana/Vevay", "America/Indianapolis",
"America/Fort_Wayne", "America/Indiana/Indianapolis", "EST", "SystemV/EST5",
"US/East-Indiana", "America/Inuvik", "America/Iqaluit", "America/Jamaica",
"Jamaica", "America/Jujuy", "America/Juneau", "America/Kentucky/Monticello",
"America/La_Paz", "America/Lima", "America/Los_Angeles", "PST8PDT",
"SystemV/PST8PDT", "US/Pacific", "US/Pacific-New", "America/Louisville",
"America/Kentucky/Louisville", "America/Maceio", "America/Managua",
"America/Manaus", "Brazil/West", "America/Martinique", "America/Mazatlan",
"Mexico/BajaSur", "America/Mendoza", "America/Menominee", "America/Merida",
"America/Mexico_City", "Mexico/General", "America/Miquelon",
"America/Monterrey", "America/Montevideo", "America/Montreal",
"Canada/Eastern", "America/Montserrat", "America/Nassau",
"America/New_York", "EST5EDT", "SystemV/EST5EDT", "US/Eastern",
"America/Nipigon", "America/Nome", "America/Noronha", "Brazil/DeNoronha",
"America/North_Dakota/Center", "America/Panama", "America/Pangnirtung",
"America/Paramaribo", "America/Phoenix", "MST", "SystemV/MST7",
"US/Arizona", "America/Port-au-Prince", "America/Port_of_Spain",
"America/Porto_Velho", "America/Puerto_Rico", "SystemV/AST4",
"America/Rainy_River", "America/Rankin_Inlet", "America/Recife",
"America/Regina", "Canada/East-Saskatchewan", "Canada/Saskatchewan",
"SystemV/CST6", "America/Rio_Branco", "America/Porto_Acre", "Brazil/Acre",
"America/Santiago", "Chile/Continental", "America/Santo_Domingo",
"America/Sao_Paulo", "Brazil/East", "America/Scoresbysund",
"America/St_Johns", "Canada/Newfoundland", "America/St_Kitts",
"America/St_Lucia", "America/St_Thomas", "America/Virgin",
"America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa",
"America/Thule", "America/Thunder_Bay", "America/Tijuana",
"America/Ensenada", "Mexico/BajaNorte", "America/Tortola",
"America/Vancouver", "Canada/Pacific", "America/Whitehorse",
"Canada/Yukon", "America/Winnipeg", "Canada/Central", "America/Yakutat",
"America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis",
"Antarctica/DumontDUrville", "Antarctica/Mawson", "Antarctica/McMurdo",
"Antarctica/South_Pole", "Antarctica/Palmer", "Antarctica/Syowa",
"Antarctica/Vostok", "Asia/Aden", "Asia/Almaty", "Asia/Amman",
"Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat",
"Asia/Ashkhabad", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku",
"Asia/Bangkok", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei",
"Asia/Calcutta", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking",
"Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dacca", "Asia/Dili",
"Asia/Dubai", "Asia/Dushanbe", "Asia/Gaza", "Asia/Harbin", "Asia/Hong_Kong",
"Hongkong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura",
"Asia/Jerusalem", "Asia/Tel_Aviv", "Israel", "Asia/Kabul", "Asia/Kamchatka",
"Asia/Karachi", "Asia/Kashgar", "Asia/Katmandu", "Asia/Krasnoyarsk",
"Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau",
"Asia/Macao", "Asia/Magadan", "Asia/Makassar", "Asia/Ujung_Pandang",
"Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Europe/Nicosia",
"Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh",
"Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qyzylorda",
"Asia/Rangoon", "Asia/Riyadh", "Asia/Riyadh87", "Mideast/Riyadh87",
"Asia/Riyadh88", "Mideast/Riyadh88", "Asia/Riyadh89", "Mideast/Riyadh89",
"Asia/Saigon", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "ROK",
"Asia/Shanghai", "PRC", "Asia/Singapore", "Singapore", "Asia/Taipei", "ROC",
"Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Iran", "Asia/Thimphu",
"Asia/Thimbu", "Asia/Tokyo", "Japan", "Asia/Ulaanbaatar", "Asia/Ulan_Bator",
"Asia/Urumqi", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk",
"Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda",
"Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faeroe",
"Atlantic/Madeira", "Atlantic/Reykjavik", "Iceland",
"Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley",
"Australia/Adelaide", "Australia/South", "Australia/Brisbane",
"Australia/Queensland", "Australia/Broken_Hill", "Australia/Yancowinna",
"Australia/Darwin", "Australia/North", "Australia/Hobart",
"Australia/Tasmania", "Australia/Lindeman", "Australia/Lord_Howe",
"Australia/LHI", "Australia/Melbourne", "Australia/Victoria",
"Australia/Perth", "Australia/West", "Australia/Sydney", "Australia/ACT",
"Australia/Canberra", "Australia/NSW", "CET", "EET", "Etc/GMT", "Etc/GMT+0",
"Etc/GMT-0", "Etc/GMT0", "Etc/Greenwich", "GMT", "GMT+0", "GMT-0", "GMT0",
"Greenwich", "Etc/GMT+1", "Etc/GMT+10", "Etc/GMT+11", "Etc/GMT+12",
"Etc/GMT+2", "Etc/GMT+3", "Etc/GMT+4", "Etc/GMT+5", "Etc/GMT+6", "Etc/GMT+7",
"Etc/GMT+8", "Etc/GMT+9", "Etc/GMT-1", "Etc/GMT-10", "Etc/GMT-11",
"Etc/GMT-12", "Etc/GMT-13", "Etc/GMT-14", "Etc/GMT-2", "Etc/GMT-3",
"Etc/GMT-4", "Etc/GMT-5", "Etc/GMT-6", "Etc/GMT-7", "Etc/GMT-8",
"Etc/GMT-9", "Etc/UCT", "UCT", "Etc/UTC", "Etc/Universal", "Etc/Zulu",
"UTC", "Universal", "Zulu", "Europe/Amsterdam", "Europe/Andorra",
"Europe/Athens", "Europe/Belfast", "Europe/Belgrade", "Europe/Ljubljana",
"Europe/Sarajevo", "Europe/Skopje", "Europe/Zagreb", "Europe/Berlin",
"Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Chisinau",
"Europe/Tiraspol", "Europe/Copenhagen", "Europe/Dublin", "Eire",
"Europe/Gibraltar", "Europe/Helsinki", "Europe/Istanbul", "Asia/Istanbul",
"Turkey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Lisbon", "Portugal",
"Europe/London", "GB", "GB-Eire", "Europe/Luxembourg", "Europe/Madrid",
"Europe/Malta", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "W-SU",
"Europe/Oslo", "Arctic/Longyearbyen", "Atlantic/Jan_Mayen", "Europe/Paris",
"Europe/Prague", "Europe/Bratislava", "Europe/Riga", "Europe/Rome",
"Europe/San_Marino", "Europe/Vatican", "Europe/Samara", "Europe/Simferopol",
"Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane",
"Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vienna", "Europe/Vilnius",
"Europe/Warsaw", "Poland", "Europe/Zaporozhye", "Europe/Zurich",
"Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos",
"Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives",
"Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "MET",
"Pacific/Apia", "Pacific/Auckland", "NZ", "Pacific/Chatham", "NZ-CHAT",
"Pacific/Easter", "Chile/EasterIsland", "Pacific/Efate",
"Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti",
"Pacific/Galapagos", "Pacific/Gambier", "SystemV/YST9",
"Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "HST",
"SystemV/HST10", "US/Hawaii", "Pacific/Johnston", "Pacific/Kiritimati",
"Pacific/Kosrae", "Pacific/Kwajalein", "Kwajalein", "Pacific/Majuro",
"Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue",
"Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Samoa",
"US/Samoa", "Pacific/Palau", "Pacific/Pitcairn", "SystemV/PST8",
"Pacific/Ponape", "Pacific/Port_Moresby", "Pacific/Rarotonga",
"Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu",
"Pacific/Truk", "Pacific/Wake", "Pacific/Wallis", "Pacific/Yap", "WET"
};
}
(Review ID: 178319)
======================================================================