-
Type:
Enhancement
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 17, 18, 19
-
Component/s: client-libs
-
b07
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.font.Type1Font#expandAbbreviation method:
private String expandAbbreviation(String abbr) {
if (styleAbbreviationsMapping.containsKey(abbr))
return styleAbbreviationsMapping.get(abbr);
return abbr;
}
Instead we can just call
return styleAbbreviationsMapping.getOrDefault(abbr, abbr);
One of such example is in sun.font.Type1Font#expandAbbreviation method:
private String expandAbbreviation(String abbr) {
if (styleAbbreviationsMapping.containsKey(abbr))
return styleAbbreviationsMapping.get(abbr);
return abbr;
}
Instead we can just call
return styleAbbreviationsMapping.getOrDefault(abbr, abbr);