You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2009/09/12 13:20:30 UTC

svn commit: r814145 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: finaccount/FinAccountPaymentServices.java invoice/InvoiceServices.java

Author: lektran
Date: Sat Sep 12 11:20:30 2009
New Revision: 814145

URL: http://svn.apache.org/viewvc?rev=814145&view=rev
Log:
Fix some compilations errors I introduced, UtilMisc.toMap is nowhere near as much fun as it used to be

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java?rev=814145&r1=814144&r2=814145&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java Sat Sep 12 11:20:30 2009
@@ -126,7 +126,7 @@
 
         try {
             // fin the store requires a pin number; validate the PIN with the code
-            Map<String, Object> findProductStoreFinActSettingMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId);
+            Map<String, Object> findProductStoreFinActSettingMap = UtilMisc.<String, Object>toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId);
             GenericValue finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", findProductStoreFinActSettingMap);
 
             if (finAccountSettings == null) {
@@ -716,7 +716,7 @@
 
         // get the product store settings
         GenericValue finAccountSettings;
-        Map<String, Object> psfasFindMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccount.getString("finAccountTypeId"));
+        Map<String, Object> psfasFindMap = UtilMisc.<String, Object>toMap("productStoreId", productStoreId, "finAccountTypeId", finAccount.getString("finAccountTypeId"));
         try {
             finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", psfasFindMap);
         } catch (GenericEntityException e) {
@@ -942,7 +942,7 @@
 
         // payment amount should always be positive; adjustments may
         // create the payment for the transaction
-        Map<String, Object> paymentCtx = UtilMisc.toMap("paymentTypeId", paymentType);
+        Map<String, Object> paymentCtx = UtilMisc.<String, Object>toMap("paymentTypeId", paymentType);
         paymentCtx.put("paymentMethodTypeId", paymentMethodType);
         paymentCtx.put("partyIdTo", partyIdTo);
         paymentCtx.put("partyIdFrom", partyIdFrom);
@@ -968,7 +968,7 @@
         paymentId = (String) payResult.get("paymentId");
 
         // create the initial transaction
-        Map<String, Object> transCtx = UtilMisc.toMap("finAccountTransTypeId", txType);
+        Map<String, Object> transCtx = UtilMisc.<String, Object>toMap("finAccountTransTypeId", txType);
         transCtx.put("finAccountId", finAccountId);
         transCtx.put("partyId", partyId);
         transCtx.put("orderId", orderId);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=814145&r1=814144&r2=814145&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat Sep 12 11:20:30 2009
@@ -1816,7 +1816,7 @@
                 description = "Return Invoice for Vendor Return #" + returnId;
             }
             // set the invoice data
-            Map<String, Object> input = UtilMisc.toMap("invoiceTypeId", invoiceTypeId, "statusId", "INVOICE_IN_PROCESS");
+            Map<String, Object> input = UtilMisc.<String, Object>toMap("invoiceTypeId", invoiceTypeId, "statusId", "INVOICE_IN_PROCESS");
             input.put("partyId", returnHeader.get("toPartyId"));
             input.put("partyIdFrom", returnHeader.get("fromPartyId"));
             input.put("currencyUomId", returnHeader.get("currencyUomId"));



Re: svn commit: r814145 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: finaccount/FinAccountPaymentServices.java invoice/InvoiceServices.java

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Big +1 on the service definition enhancement, I cringe whenever I see  
an undocumented List or Map as an attribute because I have to go  
digging to find out what it is.

In general I like generics and I've been adding it whenever I have  
time.  My main complaint about UtilMisc is that a decent portion of  
the usefulness has disappeared, for example I want to create a list of  
EntityConditions:
List<EntityCondition> condList =  
UtilMisc.toList(EntityCondition.makeConditionDate("fromDate",  
"thruDate"));  //  Not allowed even though EntityDateFilterCondition  
extends EntityCondition
condList.add(someOtherCondition);

or this common map usage:
Map<String, Object> serviceMap = UtilMisc.toMap("param1",  
"aString");  // Eclipse doesn't complain but results in a compile time  
error
serviceMap.put("param2", aBigDecimal);

I just don't like having to force it to use my types by repeating  
myself with another set of <...>.  It gets to the point where it's  
easier to use the javolution collections and have the extra  
newInstance line.

Regards
Scott

On 17/09/2009, at 3:25 AM, Adam Heath wrote:

> Scott Gray wrote:
>> Well I'm glad we've managed to solve a problem that has caused us so
>> many issues in the past.
>
> It's not just about solving problems.  It's also about documentation.
>
> I've thought about extending the service engine, so that parameter
> definitions can have generics markup.  Initially, the extra markup
> would just be thrown away(this is how groovy deals with generics).
>


Re: svn commit: r814145 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: finaccount/FinAccountPaymentServices.java invoice/InvoiceServices.java

Posted by Adam Heath <do...@brainfood.com>.
Scott Gray wrote:
> Well I'm glad we've managed to solve a problem that has caused us so
> many issues in the past.

It's not just about solving problems.  It's also about documentation.

I've thought about extending the service engine, so that parameter
definitions can have generics markup.  Initially, the extra markup
would just be thrown away(this is how groovy deals with generics).


Re: svn commit: r814145 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: finaccount/FinAccountPaymentServices.java invoice/InvoiceServices.java

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Well I'm glad we've managed to solve a problem that has caused us so  
many issues in the past.

Regards
Scott

On 16/09/2009, at 9:48 AM, Adam Heath wrote:

> lektran@apache.org wrote:
>> Author: lektran
>> Date: Sat Sep 12 11:20:30 2009
>> New Revision: 814145
>>
>> URL: http://svn.apache.org/viewvc?rev=814145&view=rev
>> Log:
>> Fix some compilations errors I introduced, UtilMisc.toMap is  
>> nowhere near as much fun as it used to be
>
> That's because it's safer.


Re: svn commit: r814145 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: finaccount/FinAccountPaymentServices.java invoice/InvoiceServices.java

Posted by Adam Heath <do...@brainfood.com>.
lektran@apache.org wrote:
> Author: lektran
> Date: Sat Sep 12 11:20:30 2009
> New Revision: 814145
> 
> URL: http://svn.apache.org/viewvc?rev=814145&view=rev
> Log:
> Fix some compilations errors I introduced, UtilMisc.toMap is nowhere near as much fun as it used to be

That's because it's safer.