You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacopo Cappellato <ja...@hotwaxmedia.com> on 2010/12/09 17:26:00 UTC

Re: svn commit: r1043999 - /ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java

On Dec 9, 2010, at 4:14 PM, doogie@apache.org wrote:

> Author: doogie
> Date: Thu Dec  9 15:14:47 2010
> New Revision: 1043999
> 
> URL: http://svn.apache.org/viewvc?rev=1043999&view=rev
> Log:
> Yet another bad bug.  The name/value pair was never actually turned into
> a map.  findByAnd(entityName, field, value, list) was never a valid
> call.  However, this code still compiled, as it ended up using the
> vararg variant of findByAnd.  If this code had ever been run, then it
> would have blown up.
> 
> broken since: 984366, initial commit
> date: Wed Aug 11 10:39:10 2010 +0000
> 
> Modified:
>    ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
> 
> Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java?rev=1043999&r1=1043998&r2=1043999&view=diff
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java (original)
> +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java Thu Dec  9 15:14:47 2010
> @@ -1269,7 +1269,8 @@ public class EbayStoreAutoPreferences {
>                         } else if (priceType.equals("RETAIL_PRICE")) {
>                             //ignore
>                         } else if (priceType.equals("SELLER_COST")) {
> -                            List<GenericValue> supplierProduct = delegator.findByAnd("SupplierProduct", "productId", SKUItem, UtilMisc.toList("availableFromDate DESC"));
> +                            // FIXME
> +                            List<GenericValue> supplierProduct = delegator.findByAnd("SupplierProduct", UtilMisc.toMap("productId", SKUItem), UtilMisc.toList("availableFromDate DESC"));

And "-availableFromDate" should be used instead of "availableFromDate DESC".

Jacopo

>                             String lastPrice = supplierProduct.get(0).getString("lastPrice");
>                             doBasePrice = Double.parseDouble(lastPrice);
>                         } else if (priceType.equals("SECOND_CHANCE_PRICE")) {
> 
> 


Re: svn commit: r1043999 - /ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java

Posted by Adam Heath <do...@brainfood.com>.
On 12/09/2010 10:26 AM, Jacopo Cappellato wrote:
>
> On Dec 9, 2010, at 4:14 PM, doogie@apache.org wrote:
>
>> Author: doogie
>> Date: Thu Dec  9 15:14:47 2010
>> New Revision: 1043999
>>
>> URL: http://svn.apache.org/viewvc?rev=1043999&view=rev
>> Log:
>> Yet another bad bug.  The name/value pair was never actually turned into
>> a map.  findByAnd(entityName, field, value, list) was never a valid
>> call.  However, this code still compiled, as it ended up using the
>> vararg variant of findByAnd.  If this code had ever been run, then it
>> would have blown up.
>>
>> broken since: 984366, initial commit
>> date: Wed Aug 11 10:39:10 2010 +0000
>>
>> Modified:
>>     ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
>>
>> Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java?rev=1043999&r1=1043998&r2=1043999&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java (original)
>> +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java Thu Dec  9 15:14:47 2010
>> @@ -1269,7 +1269,8 @@ public class EbayStoreAutoPreferences {
>>                          } else if (priceType.equals("RETAIL_PRICE")) {
>>                              //ignore
>>                          } else if (priceType.equals("SELLER_COST")) {
>> -                            List<GenericValue>  supplierProduct = delegator.findByAnd("SupplierProduct", "productId", SKUItem, UtilMisc.toList("availableFromDate DESC"));
>> +                            // FIXME
>> +                            List<GenericValue>  supplierProduct = delegator.findByAnd("SupplierProduct", UtilMisc.toMap("productId", SKUItem), UtilMisc.toList("availableFromDate DESC"));
>
> And "-availableFromDate" should be used instead of "availableFromDate DESC".

Why?  Both work.

My last 4 commits need to be discusssed.  3 of them *NEVER* worked, 
even with the initial commit to ofbiz.  There is no way at all that 
the code was run by the original author.  So why was the code there in 
the first place?

Then, the one change by Scott was a findByAnd->findList, whether the 
parameters were changed, but the method name was not.  I am not 
annoyed that that line was changed badly.  Those things happen.  What 
is annoying is that the problem code hadn't been run by anyone in the 
last 2 years.