Skip to content

Commit

Permalink
Improved: Remove unused ‘StringUtil#split’ overload
Browse files Browse the repository at this point in the history
(OFBIZ-11014)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859923 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed May 25, 2019
1 parent d7aab2f commit 7bd5337
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,38 +139,6 @@ public static List<String> split(String str, String delim) {
return splitList;
}

/**
* Splits a String on a delimiter into a List of Strings.
* @param str the String to split
* @param delim the delimiter character(s) to join on (null will split on whitespace)
* @param limit see String.split() method
* @return a list of Strings
*/
public static List<String> split(String str, String delim, int limit) {
List<String> splitList = null;
String[] st = null;

if (str == null) {
return splitList;
}

if (delim != null) {
st = Pattern.compile(delim).split(str, limit);
} else {
st = str.split("\\s");
}


if (st != null && st.length > 0) {
splitList = new LinkedList<>();
for (String element : st) {
splitList.add(element);
}
}

return splitList;
}

/**
* Encloses each of a List of Strings in quotes.
* @param list List of String(s) to quote.
Expand Down

0 comments on commit 7bd5337

Please sign in to comment.