svn commit: r1849672 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java

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

svn commit: r1849672 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java

adityasharma
Author: adityasharma
Date: Mon Dec 24 07:10:19 2018
New Revision: 1849672

URL: http://svn.apache.org/viewvc?rev=1849672&view=rev
Log:
Improved: Refactor boolean returns for ShoppingCart methods
(OFBIZ-10745)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.
Thanks Suraj Khurana and Jacques Le Roux for the review.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1849672&r1=1849671&r2=1849672&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java Mon Dec 24 07:10:19 2018
@@ -1965,10 +1965,7 @@ public class ShoppingCart implements Ite
         try {
             GenericValue giftCertSettings = getGiftCertSettingFromStore(delegator);
             if (giftCertSettings != null) {
-                if ("Y".equals(giftCertSettings.getString("requirePinCode"))) {
-                    return true;
-                }
-                return false;
+                return "Y".equals(giftCertSettings.getString("requirePinCode"));
             }
             Debug.logWarning("No product store gift certificate settings found for store [" + getProductStoreId() + "]",
                     module);