HADOOP-16962. Making `getBoolean` log warning message for unrecognized value. Contributed by Ctest.

This commit is contained in:
Ayush Saxena 2020-04-09 23:29:48 +05:30
parent 061afcdf30
commit 5746533cde
1 changed files with 5 additions and 1 deletions

View File

@ -1690,7 +1690,11 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
return true;
else if (StringUtils.equalsIgnoreCase("false", valueString))
return false;
else return defaultValue;
else {
LOG.warn("Invalid value for boolean: " + valueString +
", choose default value: " + defaultValue + " for " + name);
return defaultValue;
}
}
/**