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.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aditya Sharma
2018-12-24 07:51:53 +00:00
parent 71988f71ca
commit 4487e3ccb0
@@ -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) {