From 5746533cde0065761a68a9b3e89ee01da6c8eeeb Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Thu, 9 Apr 2020 23:29:48 +0530 Subject: [PATCH] HADOOP-16962. Making `getBoolean` log warning message for unrecognized value. Contributed by Ctest. --- .../src/main/java/org/apache/hadoop/conf/Configuration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java index 9a8841e701..9751a9b669 100755 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java @@ -1690,7 +1690,11 @@ public boolean getBoolean(String name, boolean defaultValue) { 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; + } } /**