-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 18, 19
-
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);