diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e28e68c11f0..7bf06ef7332 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -356,6 +356,8 @@ Release 2.8.0 - UNRELEASED HADOOP-12618. Fix NPE in TestSequenceFile. (Brahma Reddy Battula via umamahesh) + HADOOP-12639. Improve JavaDoc for getTrimmedStrings. (BELUGA BEHR via umamahesh) + OPTIMIZATIONS HADOOP-11785. Reduce the number of listStatus operation in distcp diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java index 1dff0fa6b10..1ccdb227dba 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java @@ -399,10 +399,12 @@ public class StringUtils { } /** - * Splits a comma separated value String, trimming leading and trailing whitespace on each value. - * Duplicate and empty values are removed. - * @param str a comma separated with values - * @return a Collection of String values + * Splits a comma separated value String, trimming leading and + * trailing whitespace on each value. Duplicate and empty values are removed. + * + * @param str a comma separated with values, may be null + * @return a Collection of String values, empty + * Collection if null String input */ public static Collection getTrimmedStringCollection(String str){ Set set = new LinkedHashSet( @@ -412,9 +414,12 @@ public class StringUtils { } /** - * Splits a comma separated value String, trimming leading and trailing whitespace on each value. - * @param str a comma separated with values - * @return an array of String values + * Splits a comma separated value String, trimming leading and + * trailing whitespace on each value. + * + * @param str a comma separated String with values, may be null + * @return an array of String values, empty array if null String + * input */ public static String[] getTrimmedStrings(String str){ if (null == str || str.trim().isEmpty()) {