Author: mrisaliti
Date: Tue Feb 1 19:57:12 2011 New Revision: 1066180 URL: http://svn.apache.org/viewvc?rev=1066180&view=rev Log: Remove of some java compilation warnings of methods getLineListOrderedByBasePrice/findAllCartItems of ShoppingCart (OFBIZ-4102) Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java 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=1066180&r1=1066179&r2=1066180&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 Tue Feb 1 19:57:12 2011 @@ -661,14 +661,14 @@ public class ShoppingCart implements Ite } /** Get all ShoppingCartItems from the cart object with the given productId. */ - public List findAllCartItems(String productId) { + public List<ShoppingCartItem> findAllCartItems(String productId) { return this.findAllCartItems(productId, null); } /** Get all ShoppingCartItems from the cart object with the given productId and optional groupNumber to limit it to a specific item group */ - public List findAllCartItems(String productId, String groupNumber) { + public List<ShoppingCartItem> findAllCartItems(String productId, String groupNumber) { if (productId == null) return this.items(); - List itemsToReturn = FastList.newInstance(); + List<ShoppingCartItem> itemsToReturn = FastList.newInstance(); // Check for existing cart item. for (ShoppingCartItem cartItem : cartLines) { if (UtilValidate.isNotEmpty(groupNumber) && !cartItem.isInItemGroup(groupNumber)) { @@ -4100,8 +4100,8 @@ public class ShoppingCart implements Ite return result; } - public List getLineListOrderedByBasePrice(boolean ascending) { - List result = new ArrayList(this.cartLines); + public List<ShoppingCartItem> getLineListOrderedByBasePrice(boolean ascending) { + List<ShoppingCartItem> result = new ArrayList<ShoppingCartItem>(this.cartLines); Collections.sort(result, new BasePriceOrderComparator(ascending)); return result; } 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=1066180&r1=1066179&r2=1066180&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 Tue Feb 1 19:57:12 2011 @@ -1058,8 +1058,7 @@ public class ShoppingCartServices { ShoppingCart shoppingCart = (ShoppingCart) context.get("shoppingCart"); String productId = (String) context.get("productId"); if (shoppingCart != null && UtilValidate.isNotEmpty(shoppingCart.items())) { - List allItems = shoppingCart.items(); - List items = shoppingCart.findAllCartItems(productId); + List<ShoppingCartItem> items = shoppingCart.findAllCartItems(productId); if (items.size() > 0) { ShoppingCartItem item = (ShoppingCartItem)items.get(0); int itemIndex = shoppingCart.getItemIndex(item); |
Free forum by Nabble | Edit this page |