8349873: StackOverflowError after JDK-8342550 if -Duser.timezone= is set to a deprecated zone id

Reviewed-by: joehw, jlu, iris
This commit is contained in:
Naoto Sato 2025-02-13 20:57:48 +00:00
parent d8fcd43a24
commit 3e7acfac48
2 changed files with 20 additions and 11 deletions

View file

@ -47,7 +47,6 @@ import jdk.internal.util.StaticProperty;
import sun.util.calendar.ZoneInfo;
import sun.util.calendar.ZoneInfoFile;
import sun.util.locale.provider.TimeZoneNameUtility;
import sun.util.logging.PlatformLogger;
/**
* {@code TimeZone} represents a time zone offset, and also figures out daylight
@ -599,9 +598,9 @@ public abstract class TimeZone implements Serializable, Cloneable {
private static TimeZone getTimeZone(String ID, boolean fallback) {
if (ZoneId.SHORT_IDS.containsKey(ID)) {
PlatformLogger.getLogger(TimeZone.class.getName())
.warning("Use of the three-letter time zone ID \"%s\" is deprecated and it will be removed in a future release"
.formatted(ID));
System.err.printf(
"WARNING: Use of the three-letter time zone ID \"%s\" is deprecated and it will be removed in a future release%n",
ID);
}
TimeZone tz = ZoneInfo.getTimeZone(ID);
if (tz == null) {