svn commit: r1849673 - /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: r1849673 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

adityasharma
Author: adityasharma
Date: Mon Dec 24 07:51:53 2018
New Revision: 1849673

URL: http://svn.apache.org/viewvc?rev=1849673&view=rev
Log:
Improved: Refactor boolean returns for UtilValidate methods
(OFBIZ-10728)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.
Improves code in isGiftCard().
Thanks Suraj Khurana for the review.

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=1849673&r1=1849672&r2=1849673&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 Mon Dec 24 07:51:53 2018
@@ -1070,12 +1070,7 @@ public final class UtilValidate {
      * @return true, if the number passed simple checks
      */
     public static boolean isGiftCard(String stPassed) {
-        if (isOFBGiftCard(stPassed)) {
-            return true;
-        } else if (isValueLinkCard(stPassed)) {
-            return true;
-        }
-        return false;
+        return isOFBGiftCard(stPassed) || isValueLinkCard(stPassed);
     }
 
     public static int getLuhnSum(String stPassed) {