-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b24
In java 8, Map interface was enhances with many useful methods, which allow to avoid calling a few separate Map methods.
One of such example is in sun.util.calendar.ZoneInfoFile#getZoneInfo0 method:
String zid = zoneId;
if (aliases.containsKey(zoneId)) {
zid = aliases.get(zoneId);
}
Instead we can just call
aliases.getOrDefault(zoneId, zoneId)
One of such example is in sun.util.calendar.ZoneInfoFile#getZoneInfo0 method:
String zid = zoneId;
if (aliases.containsKey(zoneId)) {
zid = aliases.get(zoneId);
}
Instead we can just call
aliases.getOrDefault(zoneId, zoneId)