svn commit: r930322 - /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: r930322 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

doogie-3
Author: doogie
Date: Fri Apr  2 16:48:48 2010
New Revision: 930322

URL: http://svn.apache.org/viewvc?rev=930322&view=rev
Log:
Don't constantly convert the internal ShoppingCartItemGroup.groupNumber
from an int to a String; instead, do the conversion once inside the
constructor.

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=930322&r1=930321&r2=930322&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 16:48:48 2010
@@ -4201,7 +4201,7 @@ public class ShoppingCart implements Ite
     }
 
     public static class ShoppingCartItemGroup implements Serializable {
-        private long groupNumber;
+        private String groupNumber;
         private String groupName;
         private ShoppingCartItemGroup parentGroup;
 
@@ -4214,7 +4214,7 @@ public class ShoppingCart implements Ite
 
         /** Note that to avoid foreign key issues when the groups are created a parentGroup should have a lower number than the child group. */
         protected ShoppingCartItemGroup(long groupNumber, String groupName, ShoppingCartItemGroup parentGroup) {
-            this.groupNumber = groupNumber;
+            this.groupNumber = UtilFormatOut.formatPaddedNumber(groupNumber, 2);
             this.groupName = groupName;
             this.parentGroup = parentGroup;
         }
@@ -4226,7 +4226,7 @@ public class ShoppingCart implements Ite
         }
 
         public String getGroupNumber() {
-            return UtilFormatOut.formatPaddedNumber(this.groupNumber, 2);
+            return this.groupNumber;
         }
 
         public String getGroupName() {
@@ -4260,7 +4260,7 @@ public class ShoppingCart implements Ite
         public boolean equals(Object obj) {
             if (obj == null) return false;
             ShoppingCartItemGroup that = (ShoppingCartItemGroup) obj;
-            if (that.groupNumber == this.groupNumber) {
+            if (that.groupNumber.equals(this.groupNumber)) {
                 return true;
             }
             return false;