Follow-up of #4808, same fix applied to ToXContent.MapParams
This commit is contained in:
parent
53dab85fa2
commit
c8d661608c
|
@ -90,11 +90,7 @@ public interface ToXContent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean paramAsBooleanOptional(String key, Boolean defaultValue) {
|
public Boolean paramAsBooleanOptional(String key, Boolean defaultValue) {
|
||||||
String sValue = param(key);
|
return Booleans.parseBoolean(param(key), defaultValue);
|
||||||
if (sValue == null) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
return !(sValue.equals("false") || sValue.equals("0") || sValue.equals("off"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue