You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by fr...@apache.org on 2003/09/24 22:22:33 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang CharSetUtils.java
fredrik 2003/09/24 13:22:33
Modified: lang/src/java/org/apache/commons/lang CharSetUtils.java
Log:
Using StringUtils.isEmpty where possible.
Revision Changes Path
1.28 +8 -8 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
Index: CharSetUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- CharSetUtils.java 7 Sep 2003 14:32:34 -0000 1.27
+++ CharSetUtils.java 24 Sep 2003 20:22:33 -0000 1.28
@@ -131,7 +131,7 @@
* @return modified String, <code>null</code> if null string input
*/
public static String squeeze(String str, String set) {
- if (str == null || str.length() == 0 || set == null || set.length() == 0) {
+ if (StringUtils.isEmpty(str) || StringUtils.isEmpty(set)) {
return str;
}
String[] strs = new String[1];
@@ -154,7 +154,7 @@
* @return modified String, <code>null</code> if null string input
*/
public static String squeeze(String str, String[] set) {
- if (str == null || str.length() == 0 || set == null || set.length == 0) {
+ if (StringUtils.isEmpty(str) || set == null || set.length == 0) {
return str;
}
CharSet chars = evaluateSet(set);
@@ -197,7 +197,7 @@
* @return character count, zero if null string input
*/
public static int count(String str, String set) {
- if (str == null || str.length() == 0 || set == null || set.length() == 0) {
+ if (StringUtils.isEmpty(str) || StringUtils.isEmpty(set)) {
return 0;
}
String[] strs = new String[1];
@@ -220,7 +220,7 @@
* @return character count, zero if null string input
*/
public static int count(String str, String[] set) {
- if (str == null || str.length() == 0 || set == null || set.length == 0) {
+ if (StringUtils.isEmpty(str) || set == null || set.length == 0) {
return 0;
}
CharSet chars = evaluateSet(set);
@@ -315,7 +315,7 @@
* @return modified String, <code>null</code> if null string input
*/
public static String delete(String str, String set) {
- if (str == null || str.length() == 0 || set == null || set.length() == 0) {
+ if (StringUtils.isEmpty(str) || StringUtils.isEmpty(set)) {
return str;
}
String[] strs = new String[1];
@@ -339,7 +339,7 @@
* @return modified String, <code>null</code> if null string input
*/
public static String delete(String str, String[] set) {
- if (str == null || str.length() == 0 || set == null || set.length == 0) {
+ if (StringUtils.isEmpty(str) || set == null || set.length == 0) {
return str;
}
return modify(str, set, false);
@@ -392,7 +392,7 @@
* Method will be removed in Commons Lang 3.0.
*/
public static String translate(String str, String searchChars, String replaceChars) {
- if (str == null || str.length() == 0) {
+ if (StringUtils.isEmpty(str)) {
return str;
}
StringBuffer buffer = new StringBuffer(str.length());
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org