Author: sascharodekamp
Date: Wed Sep 14 11:34:25 2011
New Revision: 1170546
URL:
http://svn.apache.org/viewvc?rev=1170546&view=revLog:
Revert Rev1170521 - Build a String using concatenation in loop - Because it's not a bugfix, it's a improvement.
Modified:
ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilValidate.java
Modified: ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilValidate.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilValidate.java?rev=1170546&r1=1170545&r2=1170546&view=diff==============================================================================
--- ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilValidate.java (original)
+++ ofbiz/branches/release11.04/framework/base/src/org/ofbiz/base/util/UtilValidate.java Wed Sep 14 11:34:25 2011
@@ -264,31 +264,31 @@ public class UtilValidate {
/** Removes all characters which appear in string bag from string s. */
public static String stripCharsInBag(String s, String bag) {
int i;
- StringBuilder stringBuilder = new StringBuilder("");
+ String returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if (bag.indexOf(c) == -1) stringBuilder.append(c);
+ if (bag.indexOf(c) == -1) returnString += c;
}
- return stringBuilder.toString();
+ return returnString;
}
/** Removes all characters which do NOT appear in string bag from string s. */
public static String stripCharsNotInBag(String s, String bag) {
int i;
- StringBuilder stringBuilder = new StringBuilder("");
+ String returnString = "";
// Search through string's characters one by one.
// If character is in bag, append to returnString.
for (i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if (bag.indexOf(c) != -1) stringBuilder.append(c);
+ if (bag.indexOf(c) != -1) returnString += c;
}
- return stringBuilder.toString();
+ return returnString;
}
/** Removes all whitespace characters from s.