From f7d152821d37de3c875b969e3a77a91dd65afece Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 18 Feb 2010 23:11:10 +0200 Subject: [PATCH] supprot 1 as true for boolean setting --- .../java/org/elasticsearch/util/settings/ImmutableSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/settings/ImmutableSettings.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/settings/ImmutableSettings.java index 731727d52c5..c4ba384fef5 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/settings/ImmutableSettings.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/settings/ImmutableSettings.java @@ -155,7 +155,7 @@ public class ImmutableSettings implements Settings { return defaultValue; } try { - return Boolean.valueOf(sValue); + return sValue.equals("true") || sValue.equals("1"); } catch (NumberFormatException e) { throw new SettingsException("Failed to parse boolean setting [" + setting + "] with value [" + sValue + "]", e); }