From ae67c8424c188a2b00920108e6104690137c61b7 Mon Sep 17 00:00:00 2001 From: Uma Mahesh Date: Tue, 15 Dec 2015 15:13:37 -0800 Subject: [PATCH] HADOOP-12639. Improve JavaDoc for getTrimmedStrings. (BELUGA BEHR via umamahesh) --- .../hadoop-common/CHANGES.txt | 2 ++ .../org/apache/hadoop/util/StringUtils.java | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 6e268071cde..b5172b6f65a 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1007,6 +1007,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()) {