svn commit: r930407 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r930407 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

doogie-3
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; }