-
Bug
-
Resolution: Fixed
-
P4
-
17, 20
-
None
-
b08
There are 3 methods in 'java.util.TimeZone' class, which have suspicious 'synchronized' modifier on them.
Seems that all of them are leftovers and can be removed.
1.
public static synchronized TimeZone getTimeZone(String ID) {
return getTimeZone(ID, true);
}
This method doesn't modify any fields and just calls another method 'getTimeZone(String, boolean)'. Method 'getTimeZone(String, boolean)' is also called in another non-syncrhonized public TimeZone method - 'getTimeZone(ZoneId)'.
2.
public static synchronized String[] getAvailableIDs(int rawOffset) {
return ZoneInfo.getAvailableIDs(rawOffset);
}
This method just call static method in 'ZoneInfo' class, which calls ZoneInfoFile method, which construct array from data initialized in <clinit>.
3.
public static synchronized String[] getAvailableIDs() {
return ZoneInfo.getAvailableIDs();
}
This method just call static method in 'ZoneInfo' class, which calls ZoneInfoFile method, which construct array from data initialized in <clinit>.
Seems that all of them are leftovers and can be removed.
1.
public static synchronized TimeZone getTimeZone(String ID) {
return getTimeZone(ID, true);
}
This method doesn't modify any fields and just calls another method 'getTimeZone(String, boolean)'. Method 'getTimeZone(String, boolean)' is also called in another non-syncrhonized public TimeZone method - 'getTimeZone(ZoneId)'.
2.
public static synchronized String[] getAvailableIDs(int rawOffset) {
return ZoneInfo.getAvailableIDs(rawOffset);
}
This method just call static method in 'ZoneInfo' class, which calls ZoneInfoFile method, which construct array from data initialized in <clinit>.
3.
public static synchronized String[] getAvailableIDs() {
return ZoneInfo.getAvailableIDs();
}
This method just call static method in 'ZoneInfo' class, which calls ZoneInfoFile method, which construct array from data initialized in <clinit>.
- links to
-
Commit(master) openjdk/jdk/bef5f565
-
Review(master) openjdk/jdk/17441