From 08f4c010cd3d96d42d5fc2f2c449e36e6541b088 Mon Sep 17 00:00:00 2001 From: Marco Risaliti Date: Wed, 2 Feb 2011 20:51:38 +0000 Subject: [PATCH] Remove of some compilation warnings of ShoppingCart (OFBIZ-4102) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1066623 13f79535-47bb-0310-9956-ffa450edef68 --- .../order/shoppingcart/ShoppingCart.java | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java index 7119c5cddc..e84c226e3e 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java @@ -3497,11 +3497,11 @@ public class ShoppingCart implements Iterable, Serializable { } } - public List makeOrderItems() { + public List makeOrderItems() { return makeOrderItems(false, false, null); } - public List makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher) { + public List makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher) { // do the explosion if (explodeItems && dispatcher != null) { explodeItems(dispatcher); @@ -3509,7 +3509,7 @@ public class ShoppingCart implements Iterable, Serializable { // now build the lines synchronized (cartLines) { - List result = FastList.newInstance(); + List result = FastList.newInstance(); for (ShoppingCartItem item : cartLines) { if (UtilValidate.isEmpty(item.getOrderItemSeqId())) { @@ -3616,10 +3616,10 @@ public class ShoppingCart implements Iterable, Serializable { allAdjs.add(orderAdjustment); if ("SHIPPING_CHARGES".equals(orderAdjustment.get("orderAdjustmentTypeId"))) { - Iterator fsppas = this.freeShippingProductPromoActions.iterator(); + Iterator fsppas = this.freeShippingProductPromoActions.iterator(); while (fsppas.hasNext()) { - GenericValue productPromoAction = (GenericValue) fsppas.next(); + GenericValue productPromoAction = fsppas.next(); // TODO - we need to change the way free shipping promotions work /* @@ -3656,10 +3656,10 @@ public class ShoppingCart implements Iterable, Serializable { allAdjs.add(orderAdjustment); if ("SHIPPING_CHARGES".equals(orderAdjustment.get("orderAdjustmentTypeId"))) { - Iterator fsppas = this.freeShippingProductPromoActions.iterator(); + Iterator fsppas = this.freeShippingProductPromoActions.iterator(); while (fsppas.hasNext()) { - GenericValue productPromoAction = (GenericValue) fsppas.next(); + GenericValue productPromoAction = fsppas.next(); // TODO - fix the free shipping promotions!! /* @@ -3729,9 +3729,9 @@ public class ShoppingCart implements Iterable, Serializable { } /** make a list of all OrderPaymentPreferences and Billing info including all payment methods and types */ - public List makeAllOrderPaymentInfos(LocalDispatcher dispatcher) { + public List makeAllOrderPaymentInfos(LocalDispatcher dispatcher) { Delegator delegator = this.getDelegator(); - List allOpPrefs = new LinkedList(); + List allOpPrefs = new LinkedList(); BigDecimal remainingAmount = this.getGrandTotal().subtract(this.getPaymentTotal()); remainingAmount = remainingAmount.setScale(2, BigDecimal.ROUND_HALF_UP); if (getBillingAccountId() != null && this.billingAccountAmt.compareTo(BigDecimal.ZERO) <= 0) { @@ -3746,7 +3746,7 @@ public class ShoppingCart implements Iterable, Serializable { this.billingAccountAmt = billingAccountAvailableAmount; } BigDecimal billingAccountAmountSelected = getBillingAccountAmount(); - GenericValue opp = delegator.makeValue("OrderPaymentPreference", new HashMap()); + GenericValue opp = delegator.makeValue("OrderPaymentPreference", new HashMap()); opp.set("paymentMethodTypeId", "EXT_BILLACT"); opp.set("presentFlag", "N"); opp.set("overflowFlag", "N"); @@ -3758,9 +3758,9 @@ public class ShoppingCart implements Iterable, Serializable { remainingAmount = BigDecimal.ZERO; } } - Iterator i = paymentInfo.iterator(); + Iterator i = paymentInfo.iterator(); while (i.hasNext()) { - CartPaymentInfo inf = (CartPaymentInfo) i.next(); + CartPaymentInfo inf = i.next(); if (inf.amount == null) { inf.amount = remainingAmount; remainingAmount = BigDecimal.ZERO; @@ -3893,12 +3893,12 @@ public class ShoppingCart implements Iterable, Serializable { return allOrderContactMechs; } - public List makeAllShipGroupInfos() { - List groups = new LinkedList(); - Iterator grpIterator = this.shipInfo.iterator(); + public List makeAllShipGroupInfos() { + List groups = new LinkedList(); + Iterator grpIterator = this.shipInfo.iterator(); long seqId = 1; while (grpIterator.hasNext()) { - CartShipInfo csi = (CartShipInfo) grpIterator.next(); + CartShipInfo csi = grpIterator.next(); groups.addAll(csi.makeItemShipGroupAndAssoc(this.getDelegator(), this, seqId)); seqId++; } @@ -3909,22 +3909,22 @@ public class ShoppingCart implements Iterable, Serializable { return this.shipInfo.size(); } - public List makeAllOrderItemAttributes() { + public List makeAllOrderItemAttributes() { return makeAllOrderItemAttributes(null, ALL); } - public List makeAllOrderItemAttributes(String orderId, int mode) { + public List makeAllOrderItemAttributes(String orderId, int mode) { // now build order item attributes synchronized (cartLines) { - List result = FastList.newInstance(); + List result = FastList.newInstance(); for (ShoppingCartItem item : cartLines) { - Map orderItemAttributes = item.getOrderItemAttributes(); - Iterator attributesIter = orderItemAttributes.keySet().iterator(); + Map orderItemAttributes = item.getOrderItemAttributes(); + Iterator attributesIter = orderItemAttributes.keySet().iterator(); while (attributesIter.hasNext()) { - String key = (String) attributesIter.next(); - String value = (String) orderItemAttributes.get(key); + String key = attributesIter.next(); + String value = orderItemAttributes.get(key); GenericValue orderItemAttribute = getDelegator().makeValue("OrderItemAttribute"); if (UtilValidate.isNotEmpty(orderId)) { @@ -4465,9 +4465,9 @@ public class ShoppingCart implements Iterable, Serializable { } } - public List makeItemShipGroupAndAssoc(Delegator delegator, ShoppingCart cart, long groupIndex) { + public List makeItemShipGroupAndAssoc(Delegator delegator, ShoppingCart cart, long groupIndex) { shipGroupSeqId = UtilFormatOut.formatPaddedNumber(groupIndex, 5); - List values = new LinkedList(); + List values = new LinkedList(); // create order contact mech for shipping address if (this.internalContactMechId != null) { @@ -4508,7 +4508,7 @@ public class ShoppingCart implements Iterable, Serializable { values.add(shipGroup); //set estimated ship dates - FastList estimatedShipDates = FastList.newInstance(); + FastList estimatedShipDates = FastList.newInstance(); for (ShoppingCartItem item : shipItemInfo.keySet()) { Timestamp estimatedShipDate = item.getEstimatedShipDate(); if (estimatedShipDate != null) { @@ -4522,7 +4522,7 @@ public class ShoppingCart implements Iterable, Serializable { } //set estimated delivery dates - FastList estimatedDeliveryDates = FastList.newInstance(); + FastList estimatedDeliveryDates = FastList.newInstance(); for (ShoppingCartItem item : shipItemInfo.keySet()) { Timestamp estimatedDeliveryDate = item.getDesiredDeliveryDate(); if (estimatedDeliveryDate != null) { @@ -4545,17 +4545,17 @@ public class ShoppingCart implements Iterable, Serializable { } // create the top level tax adjustments - Iterator ti = shipTaxAdj.iterator(); + Iterator ti = shipTaxAdj.iterator(); while (ti.hasNext()) { - GenericValue taxAdj = (GenericValue) ti.next(); + GenericValue taxAdj = ti.next(); taxAdj.set("shipGroupSeqId", shipGroupSeqId); values.add(taxAdj); } // create the ship group item associations - Iterator i = shipItemInfo.keySet().iterator(); + Iterator i = shipItemInfo.keySet().iterator(); while (i.hasNext()) { - ShoppingCartItem item = (ShoppingCartItem) i.next(); + ShoppingCartItem item = i.next(); CartShipItemInfo itemInfo = (CartShipItemInfo) shipItemInfo.get(item); GenericValue assoc = delegator.makeValue("OrderItemShipGroupAssoc"); @@ -4565,9 +4565,9 @@ public class ShoppingCart implements Iterable, Serializable { values.add(assoc); // create the item tax adjustment - Iterator iti = itemInfo.itemTaxAdj.iterator(); + Iterator iti = itemInfo.itemTaxAdj.iterator(); while (iti.hasNext()) { - GenericValue taxAdj = (GenericValue) iti.next(); + GenericValue taxAdj = iti.next(); taxAdj.set("orderItemSeqId", item.getOrderItemSeqId()); taxAdj.set("shipGroupSeqId", shipGroupSeqId); values.add(taxAdj);