Follow-up of #4808, same fix applied to ToXContent.MapParams

This commit is contained in:
Luca Cavanna 2014-01-20 15:38:30 +01:00
parent 53dab85fa2
commit c8d661608c
1 changed files with 1 additions and 5 deletions

View File

@ -90,11 +90,7 @@ public interface ToXContent {
@Override
public Boolean paramAsBooleanOptional(String key, Boolean defaultValue) {
String sValue = param(key);
if (sValue == null) {
return defaultValue;
}
return !(sValue.equals("false") || sValue.equals("0") || sValue.equals("off"));
return Booleans.parseBoolean(param(key), defaultValue);
}
}