mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8299865: Unnecessary NullPointerException catch in java.util.TimeZone#setDefaultZone
Reviewed-by: lancea, iris, naoto, aturbanov
This commit is contained in:
parent
4ec3659845
commit
500b45e12d
1 changed files with 2 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue