Improved: Inline ‘StringUtil#quoteStrList’ method
(OFBIZ-11014) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859924 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -139,21 +139,6 @@ public class StringUtil {
|
||||
return splitList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encloses each of a List of Strings in quotes.
|
||||
* @param list List of String(s) to quote.
|
||||
*/
|
||||
public static List<String> quoteStrList(List<String> list) {
|
||||
List<String> tmpList = list;
|
||||
|
||||
list = new LinkedList<>();
|
||||
for (String str: tmpList) {
|
||||
str = "'" + str + "'";
|
||||
list.add(str);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Map from an encoded name/value pair string
|
||||
* @param str The string to decode and format
|
||||
|
||||
@@ -79,11 +79,6 @@ public class StringUtilTests extends GenericTestCaseBase {
|
||||
assertEquals("no-sep", list("1", "2", "3", "4", "5", "6"), StringUtil.split("1 2\t3\n4\r5\f6", null));
|
||||
}
|
||||
|
||||
public void testQuoteStrList() {
|
||||
assertEquals("single", list("'1'"), StringUtil.quoteStrList(list("1")));
|
||||
assertEquals("double", list("'1'", "'2'"), StringUtil.quoteStrList(list("1", "2")));
|
||||
}
|
||||
|
||||
public void testStrToMap() {
|
||||
assertNull("null-string", StringUtil.strToMap(null, false));
|
||||
assertEquals("missing =", Collections.emptyMap(), StringUtil.strToMap("1", false));
|
||||
|
||||
Reference in New Issue
Block a user