Author: doogie
Date: Fri Apr  2 21:58:05 2010
New Revision: 930407

URL: http://svn.apache.org/viewvc?rev=930407&view=rev
Log:
Improve getAttribute() method on ShoppingCart and CartShipInfo, so that
calling code doesn't have to cast.

Modified:
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.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=930407&r1=930406&r2=930407&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
 Fri Apr  2 21:58:05 2010
@@ -371,8 +371,9 @@ public class ShoppingCart implements Ite
         this.attributes.remove(name);
     }
 
-    public Object getAttribute(String name) {
-        return this.attributes.get(name);
+    @SuppressWarnings("unchecked")
+    public <T> T getAttribute(String name) {
+        return (T) this.attributes.get(name);
     }
 
     public void removeOrderAttribute(String name) {
@@ -4335,8 +4336,9 @@ public class ShoppingCart implements Ite
             this.attributes.remove(name);
         }
 
-        public Object getAttribute(String name) {
-            return this.attributes.get(name);
+        @SuppressWarnings("unchecked")
+        public <T> T getAttribute(String name) {
+            return (T) this.attributes.get(name);
         }
 
         public String getOrderTypeId() { return orderTypeId; }


Reply via email to