diff --git a/src/main/java/org/elasticsearch/common/Booleans.java b/src/main/java/org/elasticsearch/common/Booleans.java index 280a7eec076..e954ea5e813 100644 --- a/src/main/java/org/elasticsearch/common/Booleans.java +++ b/src/main/java/org/elasticsearch/common/Booleans.java @@ -24,10 +24,9 @@ package org.elasticsearch.common; */ public class Booleans { + // nocommit remove this lenient one and cutover to parseBooleanExact /** - * Returns true iff the sequence is neither of the following: - * false, 0, off, no, - * otherwise false + * Returns false if text is in false, 0, off, no; else, true */ public static boolean parseBoolean(char[] text, int offset, int length, boolean defaultValue) { if (text == null || length == 0) { @@ -45,6 +44,7 @@ public class Booleans { if (length == 5) { return !(text[offset] == 'f' && text[offset + 1] == 'a' && text[offset + 2] == 'l' && text[offset + 3] == 's' && text[offset + 4] == 'e'); } + // nocommit check for known "true" values and throw exc if it's not recognized return true; }