svn commit: r1832170 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1832170 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

jleroux@apache.org
Author: jleroux
Date: Thu May 24 13:36:08 2018
New Revision: 1832170

URL: http://svn.apache.org/viewvc?rev=1832170&view=rev
Log:
Improved: Remove `UtilValidate::isEmpty(String)` method
(OFBIZ-10412)

UtilValidate class contains a `isEmpty` method both for `CharSequence` and for
`String` types but since the first is an interface for the other and that the
implementation are the same we don't need to keep the one for the concrete type.

Additionnaly I have removed the unused Generic type for the remaining
implementation.

Thanks: Mathieu Lirzin

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java?rev=1832170&r1=1832169&r2=1832170&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java Thu May 24 13:36:08 2018
@@ -181,11 +181,6 @@ public final class UtilValidate {
         return o != null && !o.isEmpty();
     }
 
-    /** Check whether string s is empty. */
-    public static boolean isEmpty(String s) {
-        return (s == null) || s.length() == 0;
-    }
-
     /** Check whether collection c is empty. */
     public static <E> boolean isEmpty(Collection<E> c) {
         return (c == null) || c.isEmpty();
@@ -197,22 +192,17 @@ public final class UtilValidate {
     }
 
     /** Check whether charsequence c is empty. */
-    public static <E> boolean isEmpty(CharSequence c) {
+    public static boolean isEmpty(CharSequence c) {
         return (c == null) || c.length() == 0;
     }
 
-    /** Check whether string s is NOT empty. */
-    public static boolean isNotEmpty(String s) {
-        return (s != null) && s.length() > 0;
-    }
-
     /** Check whether collection c is NOT empty. */
     public static <E> boolean isNotEmpty(Collection<E> c) {
         return (c != null) && !c.isEmpty();
     }
 
     /** Check whether charsequence c is NOT empty. */
-    public static <E> boolean isNotEmpty(CharSequence c) {
+    public static boolean isNotEmpty(CharSequence c) {
         return ((c != null) && (c.length() > 0));
     }