Improved: Remove unused ‘StringUtil#split’ overload

(OFBIZ-11014)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mathieu Lirzin
2019-05-25 09:15:38 +00:00
parent d7aab2ff73
commit 7bd53374ed
@@ -139,38 +139,6 @@ public class StringUtil {
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.