HADOOP-12639. Improve JavaDoc for getTrimmedStrings. (BELUGA BEHR via umamahesh)

This commit is contained in:
Uma Mahesh 2015-12-15 15:13:37 -08:00
parent 49949a4bb0
commit ae67c8424c
2 changed files with 14 additions and 7 deletions

View File

@ -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

View File

@ -399,10 +399,12 @@ public class StringUtils {
}
/**
* Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
* Duplicate and empty values are removed.
* @param str a comma separated <String> with values
* @return a <code>Collection</code> of <code>String</code> values
* Splits a comma separated value <code>String</code>, trimming leading and
* trailing whitespace on each value. Duplicate and empty values are removed.
*
* @param str a comma separated <String> with values, may be null
* @return a <code>Collection</code> of <code>String</code> values, empty
* Collection if null String input
*/
public static Collection<String> getTrimmedStringCollection(String str){
Set<String> set = new LinkedHashSet<String>(
@ -412,9 +414,12 @@ public class StringUtils {
}
/**
* Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
* @param str a comma separated <String> with values
* @return an array of <code>String</code> values
* Splits a comma separated value <code>String</code>, trimming leading and
* trailing whitespace on each value.
*
* @param str a comma separated <code>String</code> with values, may be null
* @return an array of <code>String</code> values, empty array if null String
* input
*/
public static String[] getTrimmedStrings(String str){
if (null == str || str.trim().isEmpty()) {