8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone
Reviewed-by: lancea, iris, naoto, aturbanov
This commit is contained in:
parent
4ec3659845
commit
500b45e12d
@ -674,13 +674,8 @@ public abstract class TimeZone implements Serializable, Cloneable {
|
||||
// if the time zone ID is not set (yet), perform the
|
||||
// platform to Java time zone ID mapping.
|
||||
if (zoneID == null || zoneID.isEmpty()) {
|
||||
String javaHome = StaticProperty.javaHome();
|
||||
try {
|
||||
zoneID = getSystemTimeZoneID(javaHome);
|
||||
if (zoneID == null) {
|
||||
zoneID = GMT_ID;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
zoneID = getSystemTimeZoneID(StaticProperty.javaHome());
|
||||
if (zoneID == null) {
|
||||
zoneID = GMT_ID;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user