You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2011/03/13 11:26:01 UTC
svn commit: r1081070 - in
/ofbiz/trunk/applications/order/src/org/ofbiz/order: order/ quote/
requirement/ shoppingcart/
Author: mrisaliti
Date: Sun Mar 13 10:26:01 2011
New Revision: 1081070
URL: http://svn.apache.org/viewvc?rev=1081070&view=rev
Log:
Remove some reduntant cast warning in product component (OFBIZ-4102)
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java Sun Mar 13 10:26:01 2011
@@ -103,7 +103,7 @@ public class OrderContentWrapper {
String cacheKey = orderContentTypeId + SEPARATOR + locale + SEPARATOR + mimeTypeId + SEPARATOR + order.get("orderId") + SEPARATOR + orderItemSeqId;
try {
if (orderContentCache != null && orderContentCache.get(cacheKey) != null) {
- return (String) orderContentCache.get(cacheKey);
+ return orderContentCache.get(cacheKey);
}
Writer outWriter = new StringWriter();
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java Sun Mar 13 10:26:01 2011
@@ -67,7 +67,7 @@ public class OrderEvents {
return "error";
}
- GenericValue orderRoleAndProductContentInfo = (GenericValue) orderRoleAndProductContentInfoList.get(0);
+ GenericValue orderRoleAndProductContentInfo = orderRoleAndProductContentInfoList.get(0);
// TODO: check validity based on ProductContent fields: useCountLimit, useTime/useTimeUomId
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Sun Mar 13 10:26:01 2011
@@ -1323,7 +1323,7 @@ public class OrderReturnServices {
// See how much we can refund to the payment method
BigDecimal orderPayPrefReceivedTotal = ZERO;
if (receivedPaymentTotalsByPaymentMethod.containsKey(orderPayPrefKey)) {
- orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add((BigDecimal)receivedPaymentTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding);
+ orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add(receivedPaymentTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding);
}
if (receivedPaymentTotalsByBillingAccount != null) {
@@ -1331,7 +1331,7 @@ public class OrderReturnServices {
}
BigDecimal orderPayPrefRefundedTotal = ZERO;
if (refundedTotalsByPaymentMethod.containsKey(orderPayPrefKey)) {
- orderPayPrefRefundedTotal = orderPayPrefRefundedTotal.add((BigDecimal)refundedTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding);
+ orderPayPrefRefundedTotal = orderPayPrefRefundedTotal.add(refundedTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding);
}
BigDecimal orderPayPrefAvailableTotal = orderPayPrefReceivedTotal.subtract(orderPayPrefRefundedTotal);
@@ -1680,9 +1680,9 @@ public class OrderReturnServices {
// now allocate responseAmount * invoiceTotal / grandTotal to each invoice
for (Iterator<GenericValue> iter = returnInvoices.values().iterator(); iter.hasNext();) {
- GenericValue invoice = (GenericValue) iter.next();
+ GenericValue invoice = iter.next();
String invoiceId = invoice.getString("invoiceId");
- BigDecimal invoiceTotal = (BigDecimal) invoiceTotals.get(invoiceId);
+ BigDecimal invoiceTotal = invoiceTotals.get(invoiceId);
BigDecimal amountApplied = responseAmount.multiply(invoiceTotal).divide(grandTotal, decimals, rounding).setScale(decimals, rounding);
@@ -1832,7 +1832,7 @@ public class OrderReturnServices {
Iterator<GenericValue> returnItemIter = returnItemList.iterator();
int itemCount = 1;
while (returnItemIter.hasNext()) {
- GenericValue returnItem = (GenericValue) returnItemIter.next();
+ GenericValue returnItem = returnItemIter.next();
GenericValue orderItem = null;
GenericValue product = null;
try {
@@ -2409,7 +2409,7 @@ public class OrderReturnServices {
Iterator<String> orderIterator = returnAmountByOrder.keySet().iterator();
while (orderIterator.hasNext()) {
String orderId = orderIterator.next();
- BigDecimal returnAmount = (BigDecimal) returnAmountByOrder.get(orderId);
+ BigDecimal returnAmount = returnAmountByOrder.get(orderId);
if (returnAmount.abs().compareTo(new BigDecimal("0.000001")) < 0) {
Debug.logError("Order [" + orderId + "] refund amount[ " + returnAmount + "] less than zero", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Sun Mar 13 10:26:01 2011
@@ -1407,7 +1407,7 @@ public class OrderServices {
if (eli != null) {
// reset each order
GenericValue orderHeader = null;
- while ((orderHeader = (GenericValue) eli.next()) != null) {
+ while ((orderHeader = eli.next()) != null) {
String orderId = orderHeader.getString("orderId");
Map<String, Object> resetResult = null;
try {
@@ -1523,7 +1523,7 @@ public class OrderServices {
// build up the list of tax calc service parameters
for (int i = 0; i < validOrderItems.size(); i++) {
- GenericValue orderItem = (GenericValue) validOrderItems.get(i);
+ GenericValue orderItem = validOrderItems.get(i);
String productId = orderItem.getString("productId");
try {
products.add(i, delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))); // get the product entity
@@ -1997,10 +1997,10 @@ public class OrderServices {
String reasonEnumId = null;
String changeComments = null;
if (UtilValidate.isNotEmpty(itemReasonMap)) {
- reasonEnumId = (String) itemReasonMap.get(orderItem.getString("orderItemSeqId"));
+ reasonEnumId = itemReasonMap.get(orderItem.getString("orderItemSeqId"));
}
if (UtilValidate.isNotEmpty(itemCommentMap)) {
- changeComments = (String) itemCommentMap.get(orderItem.getString("orderItemSeqId"));
+ changeComments = itemCommentMap.get(orderItem.getString("orderItemSeqId"));
}
Map<String, Object> serviceCtx = FastMap.newInstance();
@@ -3558,7 +3558,7 @@ public class OrderServices {
Iterator<String> i = itemQtyMap.keySet().iterator();
while (i.hasNext()) {
String key = i.next();
- String quantityStr = (String) itemQtyMap.get(key);
+ String quantityStr = itemQtyMap.get(key);
BigDecimal groupQty = BigDecimal.ZERO;
try {
groupQty = new BigDecimal(quantityStr);
@@ -3573,7 +3573,7 @@ public class OrderServices {
}
String[] itemInfo = key.split(":");
- BigDecimal tally = (BigDecimal) itemTotals.get(itemInfo[0]);
+ BigDecimal tally = itemTotals.get(itemInfo[0]);
if (tally == null) {
tally = groupQty;
} else {
@@ -3589,7 +3589,7 @@ public class OrderServices {
ShoppingCartItem cartItem = cart.findCartItem(itemSeqId);
if (cartItem != null) {
- BigDecimal qty = (BigDecimal) itemTotals.get(itemSeqId);
+ BigDecimal qty = itemTotals.get(itemSeqId);
BigDecimal priceSave = cartItem.getBasePrice();
// set quantity
@@ -3605,7 +3605,7 @@ public class OrderServices {
cartItem.setBasePrice(priceSave);
if (overridePriceMap.containsKey(itemSeqId)) {
- String priceStr = (String) itemPriceMap.get(itemSeqId);
+ String priceStr = itemPriceMap.get(itemSeqId);
if (UtilValidate.isNotEmpty(priceStr)) {
BigDecimal price = new BigDecimal("-1");
price = new BigDecimal(priceStr).setScale(orderDecimals, orderRounding);
@@ -3618,7 +3618,7 @@ public class OrderServices {
// Update the item description
if (itemDescriptionMap != null && itemDescriptionMap.containsKey(itemSeqId)) {
- String description = (String) itemDescriptionMap.get(itemSeqId);
+ String description = itemDescriptionMap.get(itemSeqId);
if (UtilValidate.isNotEmpty(description)) {
cartItem.setName(description);
Debug.log("Set item description: [" + itemSeqId + "] " + description, module);
@@ -3632,7 +3632,7 @@ public class OrderServices {
if (itemAttributesMap != null) {
String attrValue = null;
for (String attrName : attributeNames) {
- attrValue = (String) itemAttributesMap.get(attrName + ":" + itemSeqId);
+ attrValue = itemAttributesMap.get(attrName + ":" + itemSeqId);
if (UtilValidate.isNotEmpty(attrName)) {
cartItem.setOrderItemAttribute(attrName, attrValue);
Debug.log("Set item attribute Name: [" + itemSeqId + "] " + attrName + " , Value:" + attrValue, module);
@@ -3671,7 +3671,7 @@ public class OrderServices {
Iterator<String> gai = itemQtyMap.keySet().iterator();
while (gai.hasNext()) {
String key = gai.next();
- String quantityStr = (String) itemQtyMap.get(key);
+ String quantityStr = itemQtyMap.get(key);
BigDecimal groupQty = BigDecimal.ZERO;
try {
groupQty = new BigDecimal(quantityStr);
@@ -3996,7 +3996,7 @@ public class OrderServices {
for (long itr = 1; itr <= groupIndex; itr++) {
shipGroupSeqId = UtilFormatOut.formatPaddedNumber(itr, 5);
List<GenericValue> removeList = new ArrayList<GenericValue>();
- for (GenericValue stored: (List<GenericValue>)toStore) {
+ for (GenericValue stored: toStore) {
if ("OrderAdjustment".equals(stored.getEntityName())) {
if (("SHIPPING_CHARGES".equals(stored.get("orderAdjustmentTypeId")) ||
"SALES_TAX".equals(stored.get("orderAdjustmentTypeId"))) &&
@@ -4013,7 +4013,7 @@ public class OrderServices {
}
toStore.removeAll(removeList);
}
- for (GenericValue toAdd: (List<GenericValue>)toAddList) {
+ for (GenericValue toAdd: toAddList) {
if ("OrderAdjustment".equals(toAdd.getEntityName())) {
if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && (("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId"))) ||
("SHIPPING_CHARGES".equals(toAdd.get("orderAdjustmentTypeId"))) || ("SALES_TAX".equals(toAdd.get("orderAdjustmentTypeId"))))) {
@@ -5394,7 +5394,7 @@ public class OrderServices {
if (eli != null) {
GenericValue subscription;
- while (((subscription = (GenericValue) eli.next()) != null)) {
+ while (((subscription = eli.next()) != null)) {
Calendar endDate = Calendar.getInstance();
endDate.setTime(UtilDateTime.nowTimestamp());
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java Sun Mar 13 10:26:01 2011
@@ -194,7 +194,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteItems)) {
Iterator<GenericValue> quoteIt = quoteItems.iterator();
while (quoteIt.hasNext()) {
- GenericValue quoteItem = (GenericValue)quoteIt.next();
+ GenericValue quoteItem = quoteIt.next();
quoteItem.set("quoteId", quoteId);
Map<String, Object> quoteItemIn = quoteItem.getAllFields();
quoteItemIn.put("userLogin", userLogin);
@@ -207,7 +207,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteAttributes)) {
Iterator<GenericValue> quoteAttrIt = quoteAttributes.iterator();
while (quoteAttrIt.hasNext()) {
- GenericValue quoteAttr = (GenericValue)quoteAttrIt.next();
+ GenericValue quoteAttr = quoteAttrIt.next();
quoteAttr.set("quoteId", quoteId);
Map<String, Object> quoteAttrIn = quoteAttr.getAllFields();
quoteAttrIn.put("userLogin", userLogin);
@@ -220,7 +220,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteCoefficients)) {
Iterator<GenericValue> quoteCoefficientIt = quoteCoefficients.iterator();
while (quoteCoefficientIt.hasNext()) {
- GenericValue quoteCoefficient = (GenericValue)quoteCoefficientIt.next();
+ GenericValue quoteCoefficient = quoteCoefficientIt.next();
quoteCoefficient.set("quoteId", quoteId);
Map<String, Object> quoteCoefficientIn = quoteCoefficient.getAllFields();
quoteCoefficientIn.put("userLogin", userLogin);
@@ -233,7 +233,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteRoles)) {
Iterator<GenericValue> quoteRoleIt = quoteRoles.iterator();
while (quoteRoleIt.hasNext()) {
- GenericValue quoteRole = (GenericValue)quoteRoleIt.next();
+ GenericValue quoteRole = quoteRoleIt.next();
quoteRole.set("quoteId", quoteId);
Map<String, Object> quoteRoleIn = quoteRole.getAllFields();
quoteRoleIn.put("userLogin", userLogin);
@@ -246,7 +246,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteWorkEfforts)) {
Iterator<GenericValue> quoteWorkEffortIt = quoteWorkEfforts.iterator();
while (quoteWorkEffortIt.hasNext()) {
- GenericValue quoteWorkEffort = (GenericValue)quoteWorkEffortIt.next();
+ GenericValue quoteWorkEffort = quoteWorkEffortIt.next();
quoteWorkEffort.set("quoteId", quoteId);
Map<String, Object> quoteWorkEffortIn = quoteWorkEffort.getAllFields();
quoteWorkEffortIn.put("userLogin", userLogin);
@@ -259,7 +259,7 @@ public class QuoteServices {
if (UtilValidate.isNotEmpty(quoteAdjustments)) {
Iterator<GenericValue> quoteAdjustmentIt = quoteAdjustments.iterator();
while (quoteAdjustmentIt.hasNext()) {
- GenericValue quoteAdjustment = (GenericValue)quoteAdjustmentIt.next();
+ GenericValue quoteAdjustment = quoteAdjustmentIt.next();
quoteAdjustment.set("quoteId", quoteId);
Map<String, Object> quoteAdjustmentIn = quoteAdjustment.getAllFields();
quoteAdjustmentIn.put("userLogin", userLogin);
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java Sun Mar 13 10:26:01 2011
@@ -101,7 +101,7 @@ public class RequirementServices {
List<Map<String, Object>> requirements = FastList.newInstance();
for (Iterator<GenericValue> iter = requirementAndRoles.iterator(); iter.hasNext();) {
Map<String, Object> union = FastMap.newInstance();
- GenericValue requirement = (GenericValue) iter.next();
+ GenericValue requirement = iter.next();
String productId = requirement.getString("productId");
partyId = requirement.getString("partyId");
String facilityId = requirement.getString("facilityId");
@@ -132,7 +132,7 @@ public class RequirementServices {
}
// for good identification, get the UPCA type (UPC code)
- GenericValue gid = (GenericValue) gids.get(productId);
+ GenericValue gid = gids.get(productId);
if (gid == null) {
gid = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("goodIdentificationTypeId", "UPCA", "productId", requirement.get("productId")));
gids.put(productId, gid);
@@ -157,7 +157,7 @@ public class RequirementServices {
}
// how many of the products were sold (note this is for a fixed time period across all product stores)
- BigDecimal sold = (BigDecimal) productsSold.get(productId);
+ BigDecimal sold = productsSold.get(productId);
if (sold == null) {
EntityCondition prodConditions = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
@@ -214,7 +214,7 @@ public class RequirementServices {
String facilityId = productStore.getString("inventoryFacilityId");
List<GenericValue> orderItems = order.getRelated("OrderItem");
for (Iterator<GenericValue> iter = orderItems.iterator(); iter.hasNext();) {
- GenericValue item = (GenericValue) iter.next();
+ GenericValue item = iter.next();
GenericValue product = item.getRelatedOne("Product");
if (product == null) continue;
if ((!"PRODRQM_AUTO".equals(product.get("requirementMethodEnumId")) &&
@@ -270,7 +270,7 @@ public class RequirementServices {
String facilityId = productStore.getString("inventoryFacilityId");
List<GenericValue> orderItems = order.getRelated("OrderItem");
for (Iterator<GenericValue> iter = orderItems.iterator(); iter.hasNext();) {
- GenericValue item = (GenericValue) iter.next();
+ GenericValue item = iter.next();
GenericValue product = item.getRelatedOne("Product");
if (product == null) continue;
@@ -305,7 +305,7 @@ public class RequirementServices {
EntityOperator.AND);
List<GenericValue> requirements = delegator.findList("Requirement", ecl, null, null, null, false);
for (Iterator<GenericValue> riter = requirements.iterator(); riter.hasNext();) {
- GenericValue requirement = (GenericValue) riter.next();
+ GenericValue requirement = riter.next();
pendingRequirements = pendingRequirements.add(requirement.get("quantity") == null ? BigDecimal.ZERO : requirement.getBigDecimal("quantity"));
}
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sun Mar 13 10:26:01 2011
@@ -454,7 +454,7 @@ public class ShoppingCart implements Ite
Map<String, Object> result = dispatcher.runSync("getSuppliersForProduct", params);
List<GenericValue> productSuppliers = UtilGenerics.checkList(result.get("supplierProducts"));
if ((productSuppliers != null) && (productSuppliers.size() > 0)) {
- supplierProduct = (GenericValue) productSuppliers.get(0);
+ supplierProduct = productSuppliers.get(0);
}
//} catch (GenericServiceException e) {
} catch (Exception e) {
@@ -941,7 +941,7 @@ public class ShoppingCart implements Ite
public ShoppingCart.ShoppingCartItemGroup getItemGroupByNumber(String groupNumber) {
if (UtilValidate.isEmpty(groupNumber)) return null;
- return (ShoppingCart.ShoppingCartItemGroup) this.itemGroupByNumberMap.get(groupNumber);
+ return this.itemGroupByNumberMap.get(groupNumber);
}
/** Creates a new Item Group and returns the groupNumber that represents it */
@@ -1577,7 +1577,7 @@ public class ShoppingCart implements Ite
CartPaymentInfo thisInf = this.makePaymentInfo(id, refNum, authCode, amount);
Iterator<CartPaymentInfo> i = paymentInfo.iterator();
while (i.hasNext()) {
- CartPaymentInfo inf = (CartPaymentInfo) i.next();
+ CartPaymentInfo inf = i.next();
if (inf.compareTo(thisInf) == 0) {
// update the info
if (update) {
@@ -1711,7 +1711,7 @@ public class ShoppingCart implements Ite
public void clearPaymentMethodsById(List<String> paymentMethodIdsToRemove) {
if (UtilValidate.isEmpty(paymentMethodIdsToRemove)) return;
for (Iterator<CartPaymentInfo> iter = paymentInfo.iterator(); iter.hasNext();) {
- CartPaymentInfo info = (CartPaymentInfo) iter.next();
+ CartPaymentInfo info = iter.next();
if (paymentMethodIdsToRemove.contains(info.paymentMethodId)) {
iter.remove();
}
@@ -2036,7 +2036,7 @@ public class ShoppingCart implements Ite
shipInfo.add(csi);
}
- return (CartShipInfo) shipInfo.get(idx);
+ return shipInfo.get(idx);
}
public int getShipGroupSize() {
@@ -2515,7 +2515,7 @@ public class ShoppingCart implements Ite
GenericValue orderParty = this.getDelegator().findByPrimaryKey("Party", UtilMisc.toMap("partyId", this.getPartyId()));
Collection<GenericValue> shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
if (UtilValidate.isNotEmpty(shippingContactMechList)) {
- GenericValue shippingContactMech = (GenericValue)(shippingContactMechList.iterator()).next();
+ GenericValue shippingContactMech = (shippingContactMechList.iterator()).next();
this.setShippingContactMechId(shippingContactMech.getString("contactMechId"));
}
} catch (GenericEntityException e) {
@@ -2904,7 +2904,7 @@ public class ShoppingCart implements Ite
BigDecimal itemTotal = BigDecimal.ZERO;
for (ShoppingCartItem item : info.shipItemInfo.keySet()) {
- CartShipInfo.CartShipItemInfo csii = (CartShipInfo.CartShipItemInfo) info.shipItemInfo.get(item);
+ CartShipInfo.CartShipItemInfo csii = info.shipItemInfo.get(item);
if (csii != null && csii.quantity.compareTo(BigDecimal.ZERO) > 0) {
if (item.shippingApplies()) {
itemTotal = itemTotal.add(item.getItemSubTotal(csii.quantity));
@@ -3019,7 +3019,7 @@ public class ShoppingCart implements Ite
Map<String, BigDecimal> featureMap = FastMap.newInstance();
for (ShoppingCartItem item : info.shipItemInfo.keySet()) {
- CartShipInfo.CartShipItemInfo csii = (CartShipInfo.CartShipItemInfo) info.shipItemInfo.get(item);
+ CartShipInfo.CartShipItemInfo csii = info.shipItemInfo.get(item);
if (csii != null && csii.quantity.compareTo(BigDecimal.ZERO) > 0) {
featureMap.putAll(item.getFeatureIdQtyMap(csii.quantity));
}
@@ -4115,7 +4115,7 @@ public class ShoppingCart implements Ite
public TreeMap<Integer, CartShipInfo> getShipGroupsBySupplier(String supplierPartyId) {
TreeMap<Integer, CartShipInfo> shipGroups = new TreeMap<Integer, CartShipInfo>();
for (int i = 0; i < this.shipInfo.size(); i++) {
- CartShipInfo csi = (CartShipInfo) shipInfo.get(i);
+ CartShipInfo csi = shipInfo.get(i);
if ((csi.supplierPartyId == null && supplierPartyId == null) ||
(UtilValidate.isNotEmpty(csi.supplierPartyId) && csi.supplierPartyId.equals(supplierPartyId))) {
shipGroups.put(Integer.valueOf(i), csi);
@@ -4249,12 +4249,12 @@ public class ShoppingCart implements Ite
// Attempt to get the first ship group for the supplierPartyId
TreeMap<Integer, CartShipInfo> supplierShipGroups = this.getShipGroupsBySupplier(supplierPartyId);
if (! UtilValidate.isEmpty(supplierShipGroups)) {
- newShipGroupIndex = ((Integer) supplierShipGroups.firstKey()).intValue();
- shipInfo = (CartShipInfo) supplierShipGroups.get(supplierShipGroups.firstKey());
+ newShipGroupIndex = (supplierShipGroups.firstKey()).intValue();
+ shipInfo = supplierShipGroups.get(supplierShipGroups.firstKey());
}
if (newShipGroupIndex == -1) {
newShipGroupIndex = addShipInfo();
- shipInfo = (CartShipInfo) this.shipInfo.get(newShipGroupIndex);
+ shipInfo = this.shipInfo.get(newShipGroupIndex);
}
shipInfo.supplierPartyId = supplierPartyId;
@@ -4524,7 +4524,7 @@ public class ShoppingCart implements Ite
}
if (estimatedShipDates.size() > 0) {
Collections.sort(estimatedShipDates);
- Timestamp estimatedShipDate = (Timestamp) estimatedShipDates.getLast();
+ Timestamp estimatedShipDate = estimatedShipDates.getLast();
shipGroup.set("estimatedShipDate", estimatedShipDate);
}
@@ -4538,7 +4538,7 @@ public class ShoppingCart implements Ite
}
if (UtilValidate.isNotEmpty(estimatedDeliveryDates)) {
Collections.sort(estimatedDeliveryDates);
- Timestamp estimatedDeliveryDate = (Timestamp) estimatedDeliveryDates.getLast();
+ Timestamp estimatedDeliveryDate = estimatedDeliveryDates.getLast();
shipGroup.set("estimatedDeliveryDate", estimatedDeliveryDate);
}
@@ -4563,7 +4563,7 @@ public class ShoppingCart implements Ite
Iterator<ShoppingCartItem> i = shipItemInfo.keySet().iterator();
while (i.hasNext()) {
ShoppingCartItem item = i.next();
- CartShipItemInfo itemInfo = (CartShipItemInfo) shipItemInfo.get(item);
+ CartShipItemInfo itemInfo = shipItemInfo.get(item);
GenericValue assoc = delegator.makeValue("OrderItemShipGroupAssoc");
assoc.set("orderItemSeqId", item.getOrderItemSeqId());
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sun Mar 13 10:26:01 2011
@@ -918,7 +918,7 @@ public class ShoppingCartEvents {
}
ShoppingCart newCart = null;
if (cartIndex >= 0 && cartIndex < cartList.size()) {
- newCart = (ShoppingCart) cartList.remove(cartIndex);
+ newCart = cartList.remove(cartIndex);
} else {
String productStoreId = request.getParameter("productStoreId");
if (UtilValidate.isNotEmpty(productStoreId)) {
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Sun Mar 13 10:26:01 2011
@@ -381,7 +381,7 @@ public class ShoppingCartHelper {
String itemGroupNumberToUse = itemGroupNumber;
String originalProductId = null;
if (entry.getKey() instanceof String) {
- String key = (String) entry.getKey();
+ String key = entry.getKey();
//Debug.logInfo("Bulk Key: " + key, module);
int ignIndex = key.indexOf(ignSeparator);
@@ -983,7 +983,7 @@ public class ShoppingCartHelper {
// set the currency based on the pricing agreement
List<GenericValue> agreementItems = agreement.getRelated("AgreementItem", UtilMisc.toMap("agreementItemTypeId", "AGREEMENT_PRICING_PR"), null);
if (agreementItems.size() > 0) {
- GenericValue agreementItem = (GenericValue) agreementItems.get(0);
+ GenericValue agreementItem = agreementItems.get(0);
String currencyUomId = (String) agreementItem.get("currencyUomId");
if (UtilValidate.isNotEmpty(currencyUomId)) {
try {
@@ -1007,7 +1007,7 @@ public class ShoppingCartHelper {
List<GenericValue> agreementTerms = EntityUtil.filterByDate(agreement.getRelated("AgreementTerm"));
if (agreementTerms.size() > 0) {
for (int i = 0; agreementTerms.size() > i;i++) {
- GenericValue agreementTerm = (GenericValue) agreementTerms.get(i);
+ GenericValue agreementTerm = agreementTerms.get(i);
String termTypeId = (String) agreementTerm.get("termTypeId");
BigDecimal termValue = agreementTerm.getBigDecimal("termValue");
Long termDays = (Long) agreementTerm.get("termDays");
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Sun Mar 13 10:26:01 2011
@@ -1429,7 +1429,7 @@ public class ShoppingCartItem implements
BigDecimal quantityUsed = entry.getValue();
if (productPromoId.equals(productPromoCondActionPK.getString("productPromoId")) && productPromoRuleId.equals(productPromoCondActionPK.getString("productPromoRuleId"))) {
entryIter.remove();
- BigDecimal existingValue = (BigDecimal) this.quantityUsedPerPromoActual.get(productPromoCondActionPK);
+ BigDecimal existingValue = this.quantityUsedPerPromoActual.get(productPromoCondActionPK);
if (existingValue == null) {
this.quantityUsedPerPromoActual.put(productPromoCondActionPK, quantityUsed);
} else {
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1081070&r1=1081069&r2=1081070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Sun Mar 13 10:26:01 2011
@@ -1100,7 +1100,7 @@ public class ShoppingCartServices {
if (shoppingCart != null && UtilValidate.isNotEmpty(shoppingCart.items())) {
List<ShoppingCartItem> items = shoppingCart.findAllCartItems(productId);
if (items.size() > 0) {
- ShoppingCartItem item = (ShoppingCartItem)items.get(0);
+ ShoppingCartItem item = items.get(0);
int itemIndex = shoppingCart.getItemIndex(item);
result.put("itemIndex", String.valueOf(itemIndex));
}