From 2a6a5ff07ac8b3f83ecee8362a20d260c545906e Mon Sep 17 00:00:00 2001 From: Nicolas Malin Date: Tue, 16 Apr 2019 19:30:23 +0000 Subject: [PATCH] Fixed: Backport, Duplicate a ShoppingCartItem didn't propage OrderItemAttributes (OFBIZ-10929) When you clone a ShoppingCartItem by constructor : ShoppingCartItem sci = new ShoppingCartItem(ShoppingCartItem item) The ShoppingCartItem.orderItemAttributes wasn't propage from origin. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1857658 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/ofbiz/order/shoppingcart/ShoppingCartItem.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java index 56d0aefcab..477d21a8c2 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java @@ -679,10 +679,7 @@ public class ShoppingCartItem implements java.io.Serializable { this.associatedOrderItemSeqId = item.getAssociatedOrderItemSeqId(); this.orderItemAssocTypeId = item.getOrderItemAssocTypeId(); this.setStatusId(item.getStatusId()); - if (UtilValidate.isEmpty(item.getOrderItemAttributes())) { - this.orderItemAttributes = new HashMap<>(); - this.orderItemAttributes.putAll(item.getOrderItemAttributes()); - } + this.orderItemAttributes = item.getOrderItemAttributes() == null ? new HashMap<>() : new HashMap<>(item.getOrderItemAttributes()); this.attributes = item.getAttributes() == null ? new HashMap<>() : new HashMap<>(item.getAttributes()); this.setOrderItemSeqId(item.getOrderItemSeqId()); this.locale = item.locale;