This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7c9d583e5c Fixed: ProductWorker getBoolean logic update (OFBIZ-12609)
7c9d583e5c is described below

commit 7c9d583e5ceb7806dbf36ca3b449c904eb73b0a4
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Tue May 3 16:17:55 2022 +0200

    Fixed: ProductWorker getBoolean logic update (OFBIZ-12609)
    
    If chargeShipping is null (default) the method ProductWorker.shippingApplies
    fails.
    GenericEntity::getBoolean has changed. If the passed value equals null, 
false is
    returned. ProductWorker expects "null".
    
    jleroux: GenericEntity::getBoolean has been changed for OFBIZ-12386 "Fix 
some
    bugs SpotBugs reports". I checked at least that
    "CommunicationEventServices::sendEmailToContactList handles correctly
    tmpResult != null". After this fix I have to check other possible similar 
cases
    I neglected. Fortunately, only trunk is concerned.
    
    Thanks: Ingo Wolfmayr
---
 .../main/java/org/apache/ofbiz/product/product/ProductWorker.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
 
b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
index 52e8c72a88..610d7689a2 100644
--- 
a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
+++ 
b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
@@ -72,12 +72,10 @@ public final class ProductWorker {
                 // don't charge shipping on services or digital goods
                 return false;
             }
-            Boolean chargeShipping = product.getBoolean("chargeShipping");
-
-            if (chargeShipping == null) {
+            if (product.get("chargeShipping") == null) {
                 return true;
             }
-            return chargeShipping;
+            return product.getBoolean("chargeShipping");
         }
         throw new IllegalArgumentException(errMsg);
     }

Reply via email to