Skip to content

Commit c193fbb

Browse files
elPeirettijavier-godoy
authored andcommitted
fix: change hasFlags type to boolean to prevent null values
1 parent 354ec35 commit c193fbb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/com/flowingcode/vaadin/addons/localecombobox/LocaleComboBox.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class LocaleComboBox extends ComboBox<Locale> {
5252
* These enums can be used in {@link #setDisplayMode(DisplayMode)} to easily switch between the
5353
* built-in display modes.
5454
*/
55-
public enum DisplayMode {
55+
public enum DisplayMode {
5656

5757
/**
5858
* Default display mode.
@@ -84,7 +84,7 @@ public enum DisplayMode {
8484
/**
8585
* Indicates whether the flags should be displayed alongside the locale names.
8686
*/
87-
private Boolean hasFlags = true;
87+
private boolean hasFlags = true;
8888

8989
/**
9090
* * Creates a new instance of {@code LocaleComboBox}.
@@ -135,7 +135,7 @@ public void setDisplayLocale(Locale displayLocale) {
135135
*
136136
* @return {@code true} if flags are displayed alongside the locale names, {@code false} otherwise
137137
*/
138-
public Boolean hasFlags() {
138+
public boolean hasFlags() {
139139
return hasFlags;
140140
}
141141

@@ -145,9 +145,9 @@ public Boolean hasFlags() {
145145
* This method updates the internal state to reflect whether flags should be displayed and updates
146146
* the rendering based on the new state.
147147
*
148-
* @param hasFlags A {@code Boolean} indicating whether flags should be displayed or not.
148+
* @param hasFlags A {@code boolean} indicating whether flags should be displayed or not.
149149
*/
150-
public void setHasFlags(Boolean hasFlags) {
150+
public void setHasFlags(boolean hasFlags) {
151151
this.hasFlags = hasFlags;
152152
this.setRenderer(this.hasFlags ? getLocaleRenderer() : getLocaleRendererWithoutFlags());
153153
this.setPrefixFlag(this.hasFlags ? this.getValue() : null);

0 commit comments

Comments
 (0)