Skip to content
Permalink
Browse files

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
  • Loading branch information
mthl committed May 25, 2019
1 parent d7aab2f commit 7bd53374ed79b300e57bef9af9c3abb0ff3b5c45
Showing with 0 additions and 32 deletions.
  1. +0 −32 framework/base/src/main/java/org/apache/ofbiz/base/util/StringUtil.java
@@ -139,38 +139,6 @@ public static String join(Collection<?> col, CharSequence 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.

0 comments on commit 7bd5337

Please sign in to comment.
You can’t perform that action at this time.