From affc8a17cc86844867f3ac200b12bd6ea9d32e96 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Thu, 24 May 2018 13:36:08 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832170 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/ofbiz/base/util/UtilValidate.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java index 2a069e18a9..4673fde453 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java @@ -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 boolean isEmpty(Collection c) { return (c == null) || c.isEmpty(); @@ -197,22 +192,17 @@ public final class UtilValidate { } /** Check whether charsequence c is empty. */ - public static 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 boolean isNotEmpty(Collection c) { return (c != null) && !c.isEmpty(); } /** Check whether charsequence c is NOT empty. */ - public static boolean isNotEmpty(CharSequence c) { + public static boolean isNotEmpty(CharSequence c) { return ((c != null) && (c.length() > 0)); }