diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 0ff925ef80..589c59abad 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -211,6 +211,9 @@ Trunk (Unreleased) HADOOP-8818. Use equals instead == in MD5MD5CRC32FileChecksum and TFileDumper. (Brandon Li via suresh) + HADOOP-8821. Fix findbugs warning related to concatenating string in a + for loop in Configuration#dumpDeprecatedKeys(). (suresh) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) 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 b2128e7578..21454154e0 100644 --- 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 @@ -2332,17 +2332,17 @@ private static void addDeprecatedKeys() { /** * A unique class which is used as a sentinel value in the caching - * for getClassByName. {@see Configuration#getClassByNameOrNull(String)} + * for getClassByName. {@link Configuration#getClassByNameOrNull(String)} */ private static abstract class NegativeCacheSentinel {} public static void dumpDeprecatedKeys() { for (Map.Entry entry : deprecatedKeyMap.entrySet()) { - String newKeys = ""; + StringBuilder newKeys = new StringBuilder(); for (String newKey : entry.getValue().newKeys) { - newKeys += newKey + "\t"; + newKeys.append(newKey).append("\t"); } - System.out.println(entry.getKey() + "\t" + newKeys); + System.out.println(entry.getKey() + "\t" + newKeys.toString()); } } }