We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b317d3 commit 9089c58Copy full SHA for 9089c58
src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java
@@ -157,12 +157,8 @@ private Locale getLocaleForDisplay() {
157
158
private String getFlagCode(Locale locale) {
159
String countryCode = locale.getCountry();
160
- Optional<String> isoCode = LocaleCountryConverter.convertToISO3166Code(countryCode);
161
-
162
- if (isoCode.isPresent())
163
- return isoCode.get().toLowerCase();
164
165
- return DEFAULT_FLAG_CODE;
+ return LocaleCountryConverter.convertToISO3166Code(countryCode).map(String::toLowerCase)
+ .orElse(DEFAULT_FLAG_CODE);
166
}
167
168
private void onValueChange(ComponentValueChangeEvent<ComboBox<Locale>, Locale> event) {
0 commit comments