From c8d661608c9b412866ac0a2de3d0ed30c68588d4 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Mon, 20 Jan 2014 15:38:30 +0100 Subject: [PATCH] Follow-up of #4808, same fix applied to ToXContent.MapParams --- .../java/org/elasticsearch/common/xcontent/ToXContent.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java b/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java index 7c53f20162c..05e9fae5da8 100644 --- a/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java +++ b/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java @@ -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); } }