You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by bi...@apache.org on 2009/01/29 11:06:14 UTC

svn commit: r738810 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Author: bibryam
Date: Thu Jan 29 10:06:13 2009
New Revision: 738810

URL: http://svn.apache.org/viewvc?rev=738810&view=rev
Log:
FastMap doesn't permit null keys, so replaced it with HashMap

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

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=738810&r1=738809&r2=738810&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 Thu Jan 29 10:06:13 2009
@@ -21,6 +21,7 @@
 import java.math.BigDecimal;
 import java.math.MathContext;
 import java.sql.Timestamp;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
@@ -611,7 +612,7 @@
 
         // Convert the quote adjustment to order header adjustments and
         // put them in a map: the key/values pairs are quoteItemSeqId/List of adjs
-        Map<String, List<GenericValue>> orderAdjsMap = FastMap.newInstance() ;
+        Map<String, List<GenericValue>> orderAdjsMap = new HashMap(); // HashMap supports null key
         for (GenericValue quoteAdj : quoteAdjs) {
             List<GenericValue> orderAdjs = (List<GenericValue>)orderAdjsMap.get(quoteAdj.get("quoteItemSeqId"));
             if (orderAdjs == null) {



Re: svn commit: r738810 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Posted by Bilgin Ibryam <bi...@iguanait.com>.
David, thanks for the hint. I will provide another fix later.
Bilgin
On Jan 29, 2009, at 1:04 PM, David E Jones wrote:

> Is there actually a reason to have a null key for this hash map?  
> Usually part of the reason we want to use the FastMap is because it  
> doesn't allow null keys, as generally null keys mean something is  
> messed up...


Re: svn commit: r738810 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Posted by David E Jones <de...@me.com>.
Is there actually a reason to have a null key for this hash map?  
Usually part of the reason we want to use the FastMap is because it  
doesn't allow null keys, as generally null keys mean something is  
messed up...

-David


On Jan 29, 2009, at 3:06 AM, bibryam@apache.org wrote:

> Author: bibryam
> Date: Thu Jan 29 10:06:13 2009
> New Revision: 738810
>
> URL: http://svn.apache.org/viewvc?rev=738810&view=rev
> Log:
> FastMap doesn't permit null keys, so replaced it with HashMap
>
> Modified:
>    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> ShoppingCartServices.java
>
> 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=738810&r1=738809&r2=738810&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 Thu Jan 29 10:06:13 2009
> @@ -21,6 +21,7 @@
> import java.math.BigDecimal;
> import java.math.MathContext;
> import java.sql.Timestamp;
> +import java.util.HashMap;
> import java.util.Iterator;
> import java.util.List;
> import java.util.Locale;
> @@ -611,7 +612,7 @@
>
>         // Convert the quote adjustment to order header adjustments  
> and
>         // put them in a map: the key/values pairs are  
> quoteItemSeqId/List of adjs
> -        Map<String, List<GenericValue>> orderAdjsMap =  
> FastMap.newInstance() ;
> +        Map<String, List<GenericValue>> orderAdjsMap = new  
> HashMap(); // HashMap supports null key
>         for (GenericValue quoteAdj : quoteAdjs) {
>             List<GenericValue> orderAdjs =  
> (List<GenericValue>)orderAdjsMap.get(quoteAdj.get("quoteItemSeqId"));
>             if (orderAdjs == null) {
>
>