You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/11/19 18:26:04 UTC

svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Author: jleroux
Date: Thu Nov 19 17:26:03 2009
New Revision: 882210

URL: http://svn.apache.org/viewvc?rev=882210&view=rev
Log:
A patch from Marc Morin "Resolve java warnings exposed in Eclipse :  application - accounting" (https://issues.apache.org/jira/browse/OFBIZ-3157) - OFBIZ-3157¨
Patch for generic's warnings for accounting application 

I will soon commit InvoiceWorker.java (got a conflict) and some other changes I want to do, mostly enhanced for loops

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java Thu Nov 19 17:26:03 2009
@@ -19,7 +19,6 @@
 package org.ofbiz.accounting;
 
 import java.math.BigDecimal;
-import java.util.List;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;

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=882210&r1=882209&r2=882210&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 Thu Nov 19 17:26:03 2009
@@ -1158,7 +1158,7 @@
         return serviceResult;
     }
 
-    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map context) {
+    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         List<String> shipmentIds = UtilGenerics.checkList(context.get("shipmentIds"));

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
    (empty)

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Thu Nov 19 17:26:03 2009
@@ -57,7 +57,7 @@
     public static BigDecimal ZERO = BigDecimal.ZERO;
 
     // Base Gift Certificate Services
-    public static Map createGiftCertificate(DispatchContext dctx, Map context) {
+    public static Map<String, Object> createGiftCertificate(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
 
@@ -83,7 +83,7 @@
             final String deposit = "DEPOSIT";
 
             GenericValue giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId));
-            Map acctResult = null;
+            Map<String, Object> acctResult = null;
 
             if ("Y".equals(giftCertSettings.getString("requirePinCode"))) {
                 // TODO: move this code to createFinAccountForStore as well
@@ -102,7 +102,7 @@
                 finAccountId = cardNumber;
 
                 // create the FinAccount
-                Map acctCtx = UtilMisc.toMap("finAccountId", finAccountId);
+                Map<String, Object> acctCtx = UtilMisc.toMap("finAccountId", (Object)finAccountId);
                 acctCtx.put("finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId);
                 acctCtx.put("finAccountName", accountName);
                 acctCtx.put("finAccountCode", pinNumber);
@@ -141,7 +141,7 @@
             return ServiceUtil.returnError(e.getMessage());
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("cardNumber", cardNumber);
         result.put("pinNumber", pinNumber);
         result.put("initialAmount", initialAmount);
@@ -152,7 +152,7 @@
         return result;
     }
 
-    public static Map addFundsToGiftCertificate(DispatchContext dctx, Map context) {
+    public static Map<String, Object> addFundsToGiftCertificate(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         final String deposit = "DEPOSIT";
@@ -223,7 +223,7 @@
             return ServiceUtil.returnError(e.getMessage());
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("previousBalance", previousBalance);
         result.put("balance", balance);
         result.put("amount", amount);
@@ -234,7 +234,7 @@
         return result;
     }
 
-    public static Map redeemGiftCertificate(DispatchContext dctx, Map context) {
+    public static Map<String, Object> redeemGiftCertificate(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         final String withdrawl = "WITHDRAWAL";
@@ -300,7 +300,7 @@
             refNum = "N/A";
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("previousBalance", previousBalance);
         result.put("balance", balance);
         result.put("amount", amount);
@@ -311,7 +311,7 @@
         return result;
     }
 
-    public static Map checkGiftCertificateBalance(DispatchContext dctx, Map context) {
+    public static Map<String, Object> checkGiftCertificateBalance(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
         String cardNumber = (String) context.get("cardNumber");
         String pinNumber = (String) context.get("pinNumber");
@@ -333,14 +333,14 @@
         // get the balance
         BigDecimal balance = finAccount.get("availableBalance") == null ? BigDecimal.ZERO : finAccount.getBigDecimal("availableBalance");
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("balance", balance);
         Debug.log("GC Balance Result - " + result, module);
         return result;
     }
 
     // Fullfilment Services
-    public static Map giftCertificateProcessor(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateProcessor(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -380,7 +380,7 @@
             // obtain the order information
             OrderReadHelper orh = new OrderReadHelper(delegator, orderPaymentPreference.getString("orderId"));
 
-            Map redeemCtx = new HashMap();
+            Map<String, Object> redeemCtx = new HashMap<String, Object>();
             redeemCtx.put("userLogin", userLogin);
             redeemCtx.put("productStoreId", orh.getProductStoreId());
             redeemCtx.put("cardNumber", giftCard.get("finAccountId"));
@@ -392,20 +392,20 @@
             redeemCtx.put("amount", amount);
 
             // invoke the redeem service
-            Map redeemResult = null;
+            Map<String, Object> redeemResult = null;
             redeemResult = dispatcher.runSync("redeemGiftCertificate", redeemCtx);
             if (ServiceUtil.isError(redeemResult)) {
                 return redeemResult;
             }
 
             // now release the authorization should this use the gift card release service?
-            Map releaseResult = dispatcher.runSync("expireFinAccountAuth", UtilMisc.<String, Object>toMap("userLogin", userLogin, "finAccountAuthId", finAccountAuthId));
+            Map<String, Object> releaseResult = dispatcher.runSync("expireFinAccountAuth", UtilMisc.<String, Object>toMap("userLogin", userLogin, "finAccountAuthId", finAccountAuthId));
             if (ServiceUtil.isError(releaseResult)) {
                 return releaseResult;
             }
 
             String authRefNum = authTransaction.getString("referenceNum");
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             if (redeemResult != null) {
                 Boolean processResult = (Boolean) redeemResult.get("processResult");
                 result.put("processAmount", amount);
@@ -425,7 +425,7 @@
 }
 
 
-    public static Map giftCertificateAuthorize(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateAuthorize(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -479,7 +479,7 @@
             BigDecimal availableBalance = finAccount.getBigDecimal("availableBalance");
             Boolean processResult = null;
             String refNum = null;
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
 
             // make sure to round and scale it to the same as availableBalance
             amount = amount.setScale(FinAccountHelper.decimals, FinAccountHelper.rounding);
@@ -490,7 +490,7 @@
                 if (giftCertSettings.getLong("authValidDays") != null) {
                     thruDate = UtilDateTime.getDayEnd(UtilDateTime.nowTimestamp(), giftCertSettings.getLong("authValidDays"));
                 }
-                Map tmpResult = dispatcher.runSync("createFinAccountAuth", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, "amount", amount, "currencyUomId", currency,
+                Map<String, Object> tmpResult = dispatcher.runSync("createFinAccountAuth", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, "amount", amount, "currencyUomId", currency,
                         "thruDate", thruDate, "userLogin", userLogin));
                 if (ServiceUtil.isError(tmpResult)) {
                     return tmpResult;
@@ -522,7 +522,7 @@
         }
     }
 
-    public static Map giftCertificateRefund(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateRefund(DispatchContext dctx, Map<String, Object> context) {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference");
         String currency = (String) context.get("currency");
@@ -530,7 +530,7 @@
         return giftCertificateRestore(dctx, userLogin, paymentPref, amount, currency, "refund");
     }
 
-    public static Map giftCertificateRelease(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateRelease(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
 
@@ -543,10 +543,10 @@
             if (authTransaction == null) {
                 return ServiceUtil.returnError(err + " Could not find authorization transaction.");
             }
-            Map input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum"));
-            Map serviceResults = dispatcher.runSync("expireFinAccountAuth", input);
+            Map<String, Object> input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum"));
+            Map<String, Object> serviceResults = dispatcher.runSync("expireFinAccountAuth", input);
 
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             result.put("releaseRefNum", authTransaction.getString("referenceNum"));
             result.put("releaseAmount", authTransaction.getBigDecimal("amount"));
             result.put("releaseResult", Boolean.TRUE);
@@ -563,7 +563,7 @@
         }
     }
 
-    private static Map giftCertificateRestore(DispatchContext dctx, GenericValue userLogin, GenericValue paymentPref, BigDecimal amount, String currency, String resultPrefix) {
+    private static Map<String, Object> giftCertificateRestore(DispatchContext dctx, GenericValue userLogin, GenericValue paymentPref, BigDecimal amount, String currency, String resultPrefix) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
 
@@ -597,7 +597,7 @@
             currency = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD");
         }
 
-        Map refundCtx = new HashMap();
+        Map<String, Object> refundCtx = new HashMap<String, Object>();
         refundCtx.put("productStoreId", productStoreId);
         refundCtx.put("currency", currency);
         refundCtx.put("partyId", partyId);
@@ -607,7 +607,7 @@
         refundCtx.put("amount", amount);
         refundCtx.put("userLogin", userLogin);
 
-        Map restoreGcResult = null;
+        Map<String, Object> restoreGcResult = null;
         try {
             restoreGcResult = dispatcher.runSync("addFundsToGiftCertificate", refundCtx);
         } catch (GenericServiceException e) {
@@ -618,7 +618,7 @@
             return ServiceUtil.returnError(ServiceUtil.getErrorMessage(restoreGcResult));
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         if (restoreGcResult != null) {
             Boolean processResult = (Boolean) restoreGcResult.get("processResult");
             result.put(resultPrefix + "Amount", amount);
@@ -631,7 +631,7 @@
         return result;
     }
 
-    public static Map giftCertificatePurchase(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificatePurchase(DispatchContext dctx, Map<String, Object> context) {
         // this service should always be called via FULFILLMENT_EXTASYNC
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
@@ -708,9 +708,9 @@
         // get the survey response
         GenericValue surveyResponse = null;
         try {
-            Map fields = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "surveyId", surveyId);
-            List order = UtilMisc.toList("-responseDate");
-            List responses = delegator.findByAnd("SurveyResponse", fields, order);
+            Map<String, Object> fields = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "surveyId", surveyId);
+            List<String> order = UtilMisc.toList("-responseDate");
+            List<GenericValue> responses = delegator.findByAnd("SurveyResponse", fields, order);
             // there should be only one
             surveyResponse = EntityUtil.getFirst(responses);
         } catch (GenericEntityException e) {
@@ -722,7 +722,7 @@
         }
 
         // get the response answers
-        List responseAnswers = null;
+        List<GenericValue> responseAnswers = null;
         try {
             responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
         } catch (GenericEntityException e) {
@@ -731,11 +731,11 @@
         }
 
         // make a map of answer info
-        Map answerMap = new HashMap();
+        Map<String, Object> answerMap = new HashMap<String, Object>();
         if (responseAnswers != null) {
-            Iterator rai = responseAnswers.iterator();
+            Iterator<GenericValue> rai = responseAnswers.iterator();
             while (rai.hasNext()) {
-                GenericValue answer = (GenericValue) rai.next();
+                GenericValue answer = rai.next();
                 GenericValue question = null;
                 try {
                     question = answer.getRelatedOne("SurveyQuestion");
@@ -765,7 +765,7 @@
         int qtyLoop = quantity.intValue();
         for (int i = 0; i < qtyLoop; i++) {
             // create a gift certificate
-            Map createGcCtx = new HashMap();
+            Map<String, Object> createGcCtx = new HashMap<String, Object>();
             //createGcCtx.put("paymentConfig", paymentConfig);
             createGcCtx.put("productStoreId", productStoreId);
             createGcCtx.put("currency", currency);
@@ -774,7 +774,7 @@
             createGcCtx.put("initialAmount", amount);
             createGcCtx.put("userLogin", userLogin);
 
-            Map createGcResult = null;
+            Map<String, Object> createGcResult = null;
             try {
                 createGcResult = dispatcher.runSync("createGiftCertificate", createGcCtx);
             } catch (GenericServiceException e) {
@@ -786,7 +786,7 @@
             }
 
             // create the fulfillment record
-            Map gcFulFill = new HashMap();
+            Map<String, Object> gcFulFill = new HashMap<String, Object>();
             gcFulFill.put("typeEnumId", "GC_ACTIVATE");
             gcFulFill.put("partyId", partyId);
             gcFulFill.put("orderId", orderId);
@@ -837,7 +837,7 @@
                     }
                 }
 
-                Map emailCtx = new HashMap();
+                Map<String, Object> emailCtx = new HashMap<String, Object>();
                 String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                 if (UtilValidate.isEmpty(bodyScreenLocation)) {
                     bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -868,7 +868,7 @@
         return ServiceUtil.returnSuccess();
     }
 
-    public static Map giftCertificateReload(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateReload(DispatchContext dctx, Map<String, Object> context) {
         // this service should always be called via FULFILLMENT_EXTSYNC
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
@@ -934,9 +934,9 @@
         // get the survey response
         GenericValue surveyResponse = null;
         try {
-            Map fields = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "surveyId", surveyId);
-            List order = UtilMisc.toList("-responseDate");
-            List responses = delegator.findByAnd("SurveyResponse", fields, order);
+            Map<String, Object> fields = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "surveyId", surveyId);
+            List<String> order = UtilMisc.toList("-responseDate");
+            List<GenericValue> responses = delegator.findByAnd("SurveyResponse", fields, order);
             // there should be only one
             surveyResponse = EntityUtil.getFirst(responses);
         } catch (GenericEntityException e) {
@@ -945,7 +945,7 @@
         }
 
         // get the response answers
-        List responseAnswers = null;
+        List<GenericValue> responseAnswers = null;
         try {
             responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
         } catch (GenericEntityException e) {
@@ -954,11 +954,11 @@
         }
 
         // make a map of answer info
-        Map answerMap = new HashMap();
+        Map<String, Object> answerMap = new HashMap<String, Object>();
         if (responseAnswers != null) {
-            Iterator rai = responseAnswers.iterator();
+            Iterator<GenericValue> rai = responseAnswers.iterator();
             while (rai.hasNext()) {
-                GenericValue answer = (GenericValue) rai.next();
+                GenericValue answer = rai.next();
                 GenericValue question = null;
                 try {
                     question = answer.getRelatedOne("SurveyQuestion");
@@ -980,7 +980,7 @@
         String pinNumber = (String) answerMap.get(pinNumberKey);
 
         // reload the gift card
-        Map reloadCtx = new HashMap();
+        Map<String, Object> reloadCtx = new HashMap<String, Object>();
         reloadCtx.put("productStoreId", productStoreId);
         reloadCtx.put("currency", currency);
         reloadCtx.put("partyId", partyId);
@@ -991,7 +991,7 @@
         reloadCtx.put("userLogin", userLogin);
 
         String errorMessage = null;
-        Map reloadGcResult = null;
+        Map<String, Object> reloadGcResult = null;
         try {
             reloadGcResult = dispatcher.runSync("addFundsToGiftCertificate", reloadCtx);
         } catch (GenericServiceException e) {
@@ -1003,7 +1003,7 @@
         }
 
         // create the fulfillment record
-        Map gcFulFill = new HashMap();
+        Map<String, Object> gcFulFill = new HashMap<String, Object>();
         gcFulFill.put("typeEnumId", "GC_RELOAD");
         gcFulFill.put("userLogin", userLogin);
         gcFulFill.put("partyId", partyId);
@@ -1030,7 +1030,7 @@
 
             // process the return
             try {
-                Map refundCtx = UtilMisc.toMap("orderItem", orderItem, "partyId", partyId, "userLogin", userLogin);
+                Map<String, Object> refundCtx = UtilMisc.toMap("orderItem", orderItem, "partyId", partyId, "userLogin", userLogin);
                 dispatcher.runAsync("refundGcPurchase", refundCtx, null, true, 300, true);
             } catch (GenericServiceException e) {
                 Debug.logError(e, "ERROR! Unable to call create refund service; this failed reload will NOT be refunded", module);
@@ -1062,7 +1062,7 @@
             answerMap.put("uiLabelMap", uiLabelMap);
             answerMap.put("locale", locale);
 
-            Map emailCtx = new HashMap();
+            Map<String, Object> emailCtx = new HashMap<String, Object>();
             String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
             if (UtilValidate.isEmpty(bodyScreenLocation)) {
                 bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -1091,7 +1091,7 @@
     }
 
     // Tracking Service
-    public static Map createFulfillmentRecord(DispatchContext dctx, Map context) {
+    public static Map<String, Object> createFulfillmentRecord(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
 
         // create the fulfillment record
@@ -1120,7 +1120,7 @@
     }
 
     // Refund Service
-    public static Map refundGcPurchase(DispatchContext dctx, Map context) {
+    public static Map<String, Object> refundGcPurchase(DispatchContext dctx, Map<String, Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -1134,7 +1134,7 @@
             Debug.logError(e, module);
         }
 
-        Map returnableInfo = null;
+        Map<String, Object> returnableInfo = null;
         try {
             returnableInfo = dispatcher.runSync("getReturnableQuantity", UtilMisc.toMap("orderItem", orderItem, "userLogin", userLogin));
         } catch (GenericServiceException e) {
@@ -1148,10 +1148,10 @@
             Debug.logInfo("Returnable INFO : " + returnableQuantity + " @ " + returnablePrice + " :: " + orderItem, module);
 
             // create the return header
-            Map returnHeaderInfo = new HashMap();
+            Map<String, Object> returnHeaderInfo = new HashMap<String, Object>();
             returnHeaderInfo.put("fromPartyId", partyId);
             returnHeaderInfo.put("userLogin", userLogin);
-            Map returnHeaderResp = null;
+            Map<String, Object> returnHeaderResp = null;
             try {
                 returnHeaderResp = dispatcher.runSync("createReturnHeader", returnHeaderInfo);
             } catch (GenericServiceException e) {
@@ -1176,7 +1176,7 @@
             }
 
             // create the return item
-            Map returnItemInfo = new HashMap();
+            Map<String, Object> returnItemInfo = new HashMap<String, Object>();
             returnItemInfo.put("returnId", returnId);
             returnItemInfo.put("returnReasonId", "RTN_DIG_FILL_FAIL");
             returnItemInfo.put("returnTypeId", "RTN_REFUND");
@@ -1187,7 +1187,7 @@
             returnItemInfo.put("returnQuantity", returnableQuantity);
             returnItemInfo.put("returnPrice", returnablePrice);
             returnItemInfo.put("userLogin", userLogin);
-            Map returnItemResp = null;
+            Map<String, Object> returnItemResp = null;
             try {
                 returnItemResp = dispatcher.runSync("createReturnItem", returnItemInfo);
             } catch (GenericServiceException e) {
@@ -1223,12 +1223,12 @@
             }
 
             // update the status to received so it can process
-            Map updateReturnInfo = new HashMap();
+            Map<String, Object> updateReturnInfo = new HashMap<String, Object>();
             updateReturnInfo.put("returnId", returnId);
             updateReturnInfo.put("statusId", "RETURN_RECEIVED");
             updateReturnInfo.put("currentStatusId", "RETURN_REQUESTED");
             updateReturnInfo.put("userLogin", admin);
-            Map updateReturnResp = null;
+            Map<String, Object> updateReturnResp = null;
             try {
                 updateReturnResp = dispatcher.runSync("updateReturnHeader", updateReturnInfo);
             } catch (GenericServiceException e) {
@@ -1292,7 +1292,7 @@
         }
 
         // create the payment for the transaction
-        Map paymentCtx = UtilMisc.toMap("paymentTypeId", paymentType);
+        Map<String, Object> paymentCtx = UtilMisc.toMap("paymentTypeId", (Object)paymentType);
         paymentCtx.put("paymentMethodTypeId", paymentMethodType);
         //paymentCtx.put("paymentMethodId", "");
         //paymentCtx.put("paymentGatewayResponseId", "");
@@ -1306,7 +1306,7 @@
         paymentCtx.put("paymentRefNum", "N/A");
 
         String paymentId = null;
-        Map payResult = null;
+        Map<String, Object> payResult = null;
         try {
             payResult = dispatcher.runSync("createPayment", paymentCtx);
         } catch (GenericServiceException e) {
@@ -1322,14 +1322,14 @@
         }
 
         // create the initial transaction
-        Map transCtx = UtilMisc.toMap("finAccountTransTypeId", txType);
+        Map<String, Object> transCtx = UtilMisc.toMap("finAccountTransTypeId", (Object)txType);
         transCtx.put("finAccountId", finAccountId);
         transCtx.put("partyId", userLogin.getString("partyId"));
         transCtx.put("userLogin", userLogin);
         transCtx.put("paymentId", paymentId);
         transCtx.put("amount", amount);
 
-        Map transResult = null;
+        Map<String, Object> transResult = null;
         String txId = null;
         try {
             transResult = dispatcher.runSync("createFinAccountTrans", transCtx);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Thu Nov 19 17:26:03 2009
@@ -387,7 +387,7 @@
 
             if (((Boolean) results.get("finished")).booleanValue()) finished += 1;
             if (((Boolean) results.get("errors")).booleanValue()) hadError += 1;
-            if (results.get("messages") != null) messages.addAll((List) results.get("messages"));
+            if (results.get("messages") != null) messages.addAll(UtilGenerics.<List<String>>cast(results.get("messages")));
             if (results.get("processAmount") != null) totalRemaining = totalRemaining.subtract(((BigDecimal) results.get("processAmount")));
         }
 

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java Thu Nov 19 17:26:03 2009
@@ -50,8 +50,8 @@
      * @param context Map containing the input parameters
      * @return Map with the result of the service, the output parameters
      */
-    public static Map deletePaymentMethod(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> deletePaymentMethod(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -92,8 +92,8 @@
         return result;
     }
 
-    public static Map makeExpireDate(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> makeExpireDate(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         String expMonth = (String) context.get("expMonth");
         String expYear = (String) context.get("expYear");
 
@@ -113,8 +113,8 @@
      * @param context Map containing the input parameters
      * @return Map with the result of the service, the output parameters
      */
-    public static Map createCreditCard(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> createCreditCard(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -126,7 +126,7 @@
         if (result.size() > 0) return result;
 
         // do some more complicated/critical validation...
-        List messages = new LinkedList();
+        List<String> messages = new LinkedList<String>();
 
         // first remove all spaces from the credit card number
         context.put("cardNumber", StringUtil.removeSpaces((String) context.get("cardNumber")));
@@ -145,7 +145,7 @@
             return ServiceUtil.returnError(messages);
         }
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         GenericValue newPm = delegator.makeValue("PaymentMethod");
 
         toBeStored.add(newPm);
@@ -192,7 +192,7 @@
             GenericValue tempVal = null;
 
             try {
-                List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
+                List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
                         UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null), true);
 
                 tempVal = EntityUtil.getFirst(allPCMPs);
@@ -229,8 +229,8 @@
      * @param context Map containing the input parameters
      * @return Map with the result of the service, the output parameters
      */
-    public static Map updateCreditCard(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> updateCreditCard(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -241,7 +241,7 @@
 
         if (result.size() > 0) return result;
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         boolean isModified = false;
 
         GenericValue paymentMethod = null;
@@ -267,7 +267,7 @@
         }
 
         // do some more complicated/critical validation...
-        List messages = new LinkedList();
+        List<String> messages = new LinkedList<String>();
 
         // first remove all spaces from the credit card number
         String updatedCardNumber = StringUtil.removeSpaces((String) context.get("cardNumber"));
@@ -355,7 +355,7 @@
             GenericValue tempVal = null;
 
             try {
-                List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
+                List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
                         UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null), true);
 
                 tempVal = EntityUtil.getFirst(allPCMPs);
@@ -403,7 +403,7 @@
         return result;
     }
 
-    public static Map clearCreditCardData(DispatchContext dctx, Map context) {
+    public static Map<String, Object> clearCreditCardData(DispatchContext dctx, Map<String, Object> context) {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String paymentMethodId = (String) context.get("paymentMethodId");
 
@@ -429,8 +429,8 @@
 
         // expire the payment method
         LocalDispatcher dispatcher = dctx.getDispatcher();
-        Map expireCtx = UtilMisc.toMap("userLogin", userLogin, "paymentMethodId", paymentMethodId);
-        Map expireResp;
+        Map<String, Object> expireCtx = UtilMisc.toMap("userLogin", userLogin, "paymentMethodId", paymentMethodId);
+        Map<String, Object> expireResp;
         try {
             expireResp = dispatcher.runSync("deletePaymentMethod", expireCtx);
         } catch (GenericServiceException e) {
@@ -444,8 +444,8 @@
         return ServiceUtil.returnSuccess();
     }
 
-    public static Map createGiftCard(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> createGiftCard(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -457,7 +457,7 @@
         if (result.size() > 0)
             return result;
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         GenericValue newPm = delegator.makeValue("PaymentMethod");
         toBeStored.add(newPm);
         GenericValue newGc = delegator.makeValue("GiftCard");
@@ -497,8 +497,8 @@
         return result;
     }
 
-    public static Map updateGiftCard(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> updateGiftCard(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -511,7 +511,7 @@
         if (result.size() > 0)
             return result;
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         boolean isModified = false;
 
         GenericValue paymentMethod = null;
@@ -623,8 +623,8 @@
      * @param context Map containing the input parameters
      * @return Map with the result of the service, the output parameters
      */
-    public static Map createEftAccount(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> createEftAccount(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -635,7 +635,7 @@
 
         if (result.size() > 0) return result;
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         GenericValue newPm = delegator.makeValue("PaymentMethod");
 
         toBeStored.add(newPm);
@@ -677,7 +677,7 @@
 
             GenericValue tempVal = null;
             try {
-                List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
+                List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
                         UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null), true);
 
                 tempVal = EntityUtil.getFirst(allPCMPs);
@@ -715,8 +715,8 @@
      * @param context Map containing the input parameters
      * @return Map with the result of the service, the output parameters
      */
-    public static Map updateEftAccount(DispatchContext ctx, Map context) {
-        Map result = new HashMap();
+    public static Map<String, Object> updateEftAccount(DispatchContext ctx, Map<String, Object> context) {
+        Map<String, Object> result = new HashMap<String, Object>();
         Delegator delegator = ctx.getDelegator();
         Security security = ctx.getSecurity();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -727,7 +727,7 @@
 
         if (result.size() > 0) return result;
 
-        List toBeStored = new LinkedList();
+        List<GenericValue> toBeStored = new LinkedList<GenericValue>();
         boolean isModified = false;
 
         GenericValue paymentMethod = null;
@@ -794,7 +794,7 @@
             GenericValue tempVal = null;
 
             try {
-                List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
+                List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",
                             UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId",contactMechPurposeTypeId), null), true);
                 tempVal = EntityUtil.getFirst(allPCMPs);
             } catch (GenericEntityException e) {

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java Thu Nov 19 17:26:03 2009
@@ -29,7 +29,6 @@
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
-import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.ServiceUtil;

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Thu Nov 19 17:26:03 2009
@@ -31,22 +31,19 @@
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilNumber;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.common.geo.GeoWorker;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
-import org.ofbiz.entity.condition.EntityConditionList;
-import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.party.contact.ContactMechWorker;
 import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
 
 /**
@@ -63,7 +60,7 @@
     public static int salestaxCalcDecimals = UtilNumber.getBigDecimalScale("salestax.calc.decimals");
     public static int salestaxRounding = UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
 
-    public static Map rateProductTaxCalcForDisplay(DispatchContext dctx, Map context) {
+    public static Map<String, Object> rateProductTaxCalcForDisplay(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
         String productStoreId = (String) context.get("productStoreId");
         String billToPartyId = (String) context.get("billToPartyId");
@@ -88,9 +85,9 @@
             }
 
             if ("Y".equals(productStore.getString("showPricesWithVatTax"))) {
-                Set taxAuthoritySet = FastSet.newInstance();
+                Set<GenericValue> taxAuthoritySet = FastSet.newInstance();
                 if (productStore.get("vatTaxAuthPartyId") == null) {
-                    List taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null, null, true);
+                    List<GenericValue> taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null, null, true);
                     taxAuthoritySet.addAll(taxAuthorityRawList);
                 } else {
                     GenericValue taxAuthority = delegator.findByPrimaryKeyCache("TaxAuthority", UtilMisc.toMap("taxAuthGeoId", productStore.get("vatTaxAuthGeoId"), "taxAuthPartyId", productStore.get("vatTaxAuthPartyId")));
@@ -101,16 +98,16 @@
                     throw new IllegalArgumentException("Could not find any Tax Authories for store with ID [" + productStoreId + "] for tax calculation; the store settings may need to be corrected.");
                 }
 
-                List taxAdustmentList = getTaxAdjustments(delegator, product, productStore, null, billToPartyId, taxAuthoritySet, basePrice, amount, shippingPrice, ZERO_BASE);
+                List<GenericValue> taxAdustmentList = getTaxAdjustments(delegator, product, productStore, null, billToPartyId, taxAuthoritySet, basePrice, amount, shippingPrice, ZERO_BASE);
                 if (taxAdustmentList.size() == 0) {
                     // this is something that happens every so often for different products and such, so don't blow up on it...
                     Debug.logWarning("Could not find any Tax Authories Rate Rules for store with ID [" + productStoreId + "], productId [" + productId + "], basePrice [" + basePrice + "], amount [" + amount + "], for tax calculation; the store settings may need to be corrected.", module);
                 }
 
                 // add up amounts from adjustments (amount OR exemptAmount, sourcePercentage)
-                Iterator taxAdustmentIter = taxAdustmentList.iterator();
+                Iterator<GenericValue> taxAdustmentIter = taxAdustmentList.iterator();
                 while (taxAdustmentIter.hasNext()) {
-                    GenericValue taxAdjustment = (GenericValue) taxAdustmentIter.next();
+                    GenericValue taxAdjustment = taxAdustmentIter.next();
                     taxPercentage = taxPercentage.add(taxAdjustment.getBigDecimal("sourcePercentage"));
                     BigDecimal adjAmount = taxAdjustment.getBigDecimal("amount");
                     taxTotal = taxTotal.add(adjAmount);
@@ -128,22 +125,22 @@
         taxTotal = taxTotal.setScale(salestaxFinalDecimals, salestaxRounding);
         priceWithTax = priceWithTax.setScale(salestaxFinalDecimals, salestaxRounding);
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("taxTotal", taxTotal);
         result.put("taxPercentage", taxPercentage);
         result.put("priceWithTax", priceWithTax);
         return result;
     }
 
-    public static Map rateProductTaxCalc(DispatchContext dctx, Map context) {
+    public static Map<String, Object> rateProductTaxCalc(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
         String productStoreId = (String) context.get("productStoreId");
         String payToPartyId = (String) context.get("payToPartyId");
         String billToPartyId = (String) context.get("billToPartyId");
-        List itemProductList = (List) context.get("itemProductList");
-        List itemAmountList = (List) context.get("itemAmountList");
-        List itemPriceList = (List) context.get("itemPriceList");
-        List itemShippingList = (List) context.get("itemShippingList");
+        List<GenericValue> itemProductList = UtilGenerics.cast(context.get("itemProductList"));
+        List<BigDecimal> itemAmountList = UtilGenerics.cast(context.get("itemAmountList"));
+        List<BigDecimal> itemPriceList = UtilGenerics.cast(context.get("itemPriceList"));
+        List<BigDecimal> itemShippingList = UtilGenerics.cast(context.get("itemShippingList"));
         BigDecimal orderShippingAmount = (BigDecimal) context.get("orderShippingAmount");
         BigDecimal orderPromotionsAmount = (BigDecimal) context.get("orderPromotionsAmount");
         GenericValue shippingAddress = (GenericValue) context.get("shippingAddress");
@@ -153,7 +150,7 @@
         }
 
         // without knowing the TaxAuthority parties, just find all TaxAuthories for the set of IDs...
-        Set taxAuthoritySet = FastSet.newInstance();
+        Set<GenericValue> taxAuthoritySet = FastSet.newInstance();
         GenericValue productStore = null;
         // Check value productStore *** New
         if (productStoreId!=null) {
@@ -185,16 +182,16 @@
         }
      
         // Setup the return lists.
-        List orderAdjustments = FastList.newInstance();
-        List itemAdjustments = FastList.newInstance();
+        List<GenericValue> orderAdjustments = FastList.newInstance();
+        List<List<GenericValue>> itemAdjustments = FastList.newInstance();
 
         // Loop through the products; get the taxCategory; and lookup each in the cache.
         for (int i = 0; i < itemProductList.size(); i++) {
-            GenericValue product = (GenericValue) itemProductList.get(i);
-            BigDecimal itemAmount = (BigDecimal) itemAmountList.get(i);
-            BigDecimal itemPrice = (BigDecimal) itemPriceList.get(i);
-            BigDecimal shippingAmount = (BigDecimal) itemShippingList.get(i);
-            List taxList = null;
+            GenericValue product = itemProductList.get(i);
+            BigDecimal itemAmount = itemAmountList.get(i);
+            BigDecimal itemPrice = itemPriceList.get(i);
+            BigDecimal shippingAmount = itemShippingList.get(i);
+            List<GenericValue> taxList = null;
             if (shippingAddress != null) {
                 taxList = getTaxAdjustments(delegator, product, productStore, payToPartyId, billToPartyId, taxAuthoritySet, itemPrice, itemAmount, shippingAmount, ZERO_BASE);
             }
@@ -202,23 +199,23 @@
             itemAdjustments.add(taxList);
         }
         if (orderShippingAmount != null && orderShippingAmount.compareTo(BigDecimal.ZERO) > 0) {
-            List taxList = getTaxAdjustments(delegator, null, productStore, payToPartyId, billToPartyId, taxAuthoritySet, ZERO_BASE, ZERO_BASE, orderShippingAmount, ZERO_BASE);
+            List<GenericValue> taxList = getTaxAdjustments(delegator, null, productStore, payToPartyId, billToPartyId, taxAuthoritySet, ZERO_BASE, ZERO_BASE, orderShippingAmount, ZERO_BASE);
             orderAdjustments.addAll(taxList);
         }
         if (orderPromotionsAmount != null && orderPromotionsAmount.compareTo(BigDecimal.ZERO) != 0) {
-            List taxList = getTaxAdjustments(delegator, null, productStore, payToPartyId, billToPartyId, taxAuthoritySet, ZERO_BASE, ZERO_BASE, ZERO_BASE, orderPromotionsAmount);
+            List<GenericValue> taxList = getTaxAdjustments(delegator, null, productStore, payToPartyId, billToPartyId, taxAuthoritySet, ZERO_BASE, ZERO_BASE, ZERO_BASE, orderPromotionsAmount);
             orderAdjustments.addAll(taxList);
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("orderAdjustments", orderAdjustments);
         result.put("itemAdjustments", itemAdjustments);
 
         return result;
     }
 
-    private static void getTaxAuthorities(Delegator delegator, GenericValue shippingAddress, Set taxAuthoritySet) throws GenericEntityException {
-        Set geoIdSet = FastSet.newInstance();
+    private static void getTaxAuthorities(Delegator delegator, GenericValue shippingAddress, Set<GenericValue> taxAuthoritySet) throws GenericEntityException {
+        Set<String> geoIdSet = FastSet.newInstance();
         if (shippingAddress != null) {
             if (UtilValidate.isNotEmpty(shippingAddress.getString("countryGeoId"))) {
                 geoIdSet.add(shippingAddress.getString("countryGeoId"));
@@ -242,14 +239,14 @@
         geoIdSet = GeoWorker.expandGeoRegionDeep(geoIdSet, delegator);
         //Debug.logInfo("Tax calc geoIdSet after expand:" + geoIdSet, module);
 
-        List taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.IN, geoIdSet), null, null, null, true);
+        List<GenericValue> taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.IN, geoIdSet), null, null, null, true);
         taxAuthoritySet.addAll(taxAuthorityRawList);
         //Debug.logInfo("Tax calc taxAuthoritySet after expand:" + taxAuthoritySet, module);
     }
 
-    private static List getTaxAdjustments(Delegator delegator, GenericValue product, GenericValue productStore, String payToPartyId, String billToPartyId, Set taxAuthoritySet, BigDecimal itemPrice, BigDecimal itemAmount, BigDecimal shippingAmount, BigDecimal orderPromotionsAmount) {
+    private static List<GenericValue> getTaxAdjustments(Delegator delegator, GenericValue product, GenericValue productStore, String payToPartyId, String billToPartyId, Set<GenericValue> taxAuthoritySet, BigDecimal itemPrice, BigDecimal itemAmount, BigDecimal shippingAmount, BigDecimal orderPromotionsAmount) {
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
-        List adjustments = FastList.newInstance();
+        List<GenericValue> adjustments = FastList.newInstance();
 
         if (payToPartyId == null) {
             if (productStore != null) {
@@ -269,16 +266,16 @@
         }
 
         // build the TaxAuthority expressions (taxAuthGeoId, taxAuthPartyId)
-        List taxAuthCondOrList = FastList.newInstance();
+        List<EntityCondition> taxAuthCondOrList = FastList.newInstance();
         // start with the _NA_ TaxAuthority...
         taxAuthCondOrList.add(EntityCondition.makeCondition(
                 EntityCondition.makeCondition("taxAuthPartyId", EntityOperator.EQUALS, "_NA_"),
                 EntityOperator.AND,
                 EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, "_NA_")));
 
-        Iterator taxAuthorityIter = taxAuthoritySet.iterator();
+        Iterator<GenericValue> taxAuthorityIter = taxAuthoritySet.iterator();
         while (taxAuthorityIter.hasNext()) {
-            GenericValue taxAuthority = (GenericValue) taxAuthorityIter.next();
+            GenericValue taxAuthority = taxAuthorityIter.next();
             EntityCondition taxAuthCond = EntityCondition.makeCondition(
                     EntityCondition.makeCondition("taxAuthPartyId", EntityOperator.EQUALS, taxAuthority.getString("taxAuthPartyId")),
                     EntityOperator.AND,
@@ -292,13 +289,13 @@
             if (product != null) {
                 // find the tax categories associated with the product and filter by those, with an IN clause or some such
                 // question: get all categories, or just a special type? for now let's do all categories...
-                Set productCategoryIdSet = FastSet.newInstance();
-                List pcmList = delegator.findByAndCache("ProductCategoryMember", UtilMisc.toMap("productId", product.get("productId")));
+                Set<String> productCategoryIdSet = FastSet.newInstance();
+                List<GenericValue> pcmList = delegator.findByAndCache("ProductCategoryMember", UtilMisc.toMap("productId", product.get("productId")));
                 pcmList = EntityUtil.filterByDate(pcmList, true);
-                Iterator pcmIter = pcmList.iterator();
+                Iterator<GenericValue> pcmIter = pcmList.iterator();
                 while (pcmIter.hasNext()) {
-                    GenericValue pcm = (GenericValue) pcmIter.next();
-                    productCategoryIdSet.add(pcm.get("productCategoryId"));
+                    GenericValue pcm = pcmIter.next();
+                    productCategoryIdSet.add((String) pcm.get("productCategoryId"));
                 }
 
                 if (productCategoryIdSet.size() == 0) {
@@ -314,17 +311,17 @@
             }
 
             // build the main condition clause
-            List mainExprs = UtilMisc.toList(storeCond, taxAuthoritiesCond, productCategoryCond);
+            List<EntityCondition> mainExprs = UtilMisc.toList(storeCond, taxAuthoritiesCond, productCategoryCond);
             mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minItemPrice", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minItemPrice", EntityOperator.LESS_THAN_EQUAL_TO, itemPrice)));
             mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minPurchase", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minPurchase", EntityOperator.LESS_THAN_EQUAL_TO, itemAmount)));
             EntityCondition mainCondition = EntityCondition.makeCondition(mainExprs, EntityOperator.AND);
     
             // create the orderby clause
-            List orderList = UtilMisc.toList("minItemPrice", "minPurchase", "fromDate");
+            List<String> orderList = UtilMisc.toList("minItemPrice", "minPurchase", "fromDate");
 
             // finally ready... do the rate query
-            List lookupList = delegator.findList("TaxAuthorityRateProduct", mainCondition, null, orderList, null, false);
-            List filteredList = EntityUtil.filterByDate(lookupList, true);
+            List<GenericValue> lookupList = delegator.findList("TaxAuthorityRateProduct", mainCondition, null, orderList, null, false);
+            List<GenericValue> filteredList = EntityUtil.filterByDate(lookupList, true);
            
             if (filteredList.size() == 0) {
                 Debug.logWarning("In TaxAuthority Product Rate no records were found for condition:" + mainCondition.toString(), module);
@@ -332,9 +329,9 @@
             }
 
             // find the right entry(s) based on purchase amount
-            Iterator flIt = filteredList.iterator();
+            Iterator<GenericValue> flIt = filteredList.iterator();
             while (flIt.hasNext()) {
-                GenericValue taxAuthorityRateProduct = (GenericValue) flIt.next();
+                GenericValue taxAuthorityRateProduct = flIt.next();
                 BigDecimal taxRate = taxAuthorityRateProduct.get("taxPercentage") != null ? taxAuthorityRateProduct.getBigDecimal("taxPercentage") : ZERO_BASE;
                 BigDecimal taxable = ZERO_BASE;
 
@@ -384,13 +381,13 @@
                 if (UtilValidate.isNotEmpty(billToPartyId) && UtilValidate.isNotEmpty(taxAuthGeoId)) {
                     // see if partyId is a member of any groups, if so honor their tax exemptions
                     // look for PartyRelationship with partyRelationshipTypeId=GROUP_ROLLUP, the partyIdTo is the group member, so the partyIdFrom is the groupPartyId
-                    Set billToPartyIdSet = FastSet.newInstance();
+                    Set<String> billToPartyIdSet = FastSet.newInstance();
                     billToPartyIdSet.add(billToPartyId);
-                    List partyRelationshipList = EntityUtil.filterByDate(delegator.findByAndCache("PartyRelationship", UtilMisc.toMap("partyIdTo", billToPartyId, "partyRelationshipTypeId", "GROUP_ROLLUP")), true);
-                    Iterator partyRelationshipIter = partyRelationshipList.iterator();
+                    List<GenericValue> partyRelationshipList = EntityUtil.filterByDate(delegator.findByAndCache("PartyRelationship", UtilMisc.toMap("partyIdTo", billToPartyId, "partyRelationshipTypeId", "GROUP_ROLLUP")), true);
+                    Iterator<GenericValue> partyRelationshipIter = partyRelationshipList.iterator();
                     while (partyRelationshipIter.hasNext()) {
-                        GenericValue partyRelationship = (GenericValue) partyRelationshipIter.next();
-                        billToPartyIdSet.add(partyRelationship.get("partyIdFrom"));
+                        GenericValue partyRelationship = partyRelationshipIter.next();
+                        billToPartyIdSet.add((String) partyRelationship.get("partyIdFrom"));
                     }
                     handlePartyTaxExempt(adjValue, billToPartyIdSet, taxAuthGeoId, taxAuthPartyId, taxAmount, nowTimestamp, delegator);
                 } else {
@@ -401,23 +398,23 @@
             }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Problems looking up tax rates", module);
-            return new ArrayList();
+            return new ArrayList<GenericValue>();
         }
 
         return adjustments;
     }
 
-    private static void handlePartyTaxExempt(GenericValue adjValue, Set billToPartyIdSet, String taxAuthGeoId, String taxAuthPartyId, BigDecimal taxAmount, Timestamp nowTimestamp, Delegator delegator) throws GenericEntityException {
+    private static void handlePartyTaxExempt(GenericValue adjValue, Set<String> billToPartyIdSet, String taxAuthGeoId, String taxAuthPartyId, BigDecimal taxAmount, Timestamp nowTimestamp, Delegator delegator) throws GenericEntityException {
         Debug.logInfo("Checking for tax exemption : " + taxAuthGeoId + " / " + taxAuthPartyId, module);
-        List ptiConditionList = UtilMisc.toList(
-                EntityCondition.makeCondition("partyId", EntityOperator.IN, billToPartyIdSet),
+        List<EntityCondition> ptiConditionList = UtilMisc.toList(
+                (EntityCondition)EntityCondition.makeCondition("partyId", EntityOperator.IN, billToPartyIdSet),
                 EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, taxAuthGeoId),
                 EntityCondition.makeCondition("taxAuthPartyId", EntityOperator.EQUALS, taxAuthPartyId));
         ptiConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp));
         ptiConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, nowTimestamp)));
         EntityCondition ptiCondition = EntityCondition.makeCondition(ptiConditionList, EntityOperator.AND);
         // sort by -fromDate to get the newest (largest) first, just in case there is more than one, we only want the most recent valid one, should only be one per jurisdiction...
-        List partyTaxInfos = delegator.findList("PartyTaxAuthInfo", ptiCondition, null, UtilMisc.toList("-fromDate"), null, false);
+        List<GenericValue> partyTaxInfos = delegator.findList("PartyTaxAuthInfo", ptiCondition, null, UtilMisc.toList("-fromDate"), null, false);
 
         boolean foundExemption = false;
         if (partyTaxInfos.size() > 0) {
@@ -433,7 +430,7 @@
         // if no exceptions were found for the current; try the parent
         if (!foundExemption) {
             // try the "parent" TaxAuthority
-            List taxAuthorityAssocList = delegator.findByAndCache("TaxAuthorityAssoc",
+            List<GenericValue> taxAuthorityAssocList = delegator.findByAndCache("TaxAuthorityAssoc",
                     UtilMisc.toMap("toTaxAuthGeoId", taxAuthGeoId, "toTaxAuthPartyId", taxAuthPartyId, "taxAuthorityAssocTypeId", "EXEMPT_INHER"),
                     UtilMisc.toList("-fromDate"));
             taxAuthorityAssocList = EntityUtil.filterByDate(taxAuthorityAssocList, true);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java Thu Nov 19 17:26:03 2009
@@ -50,31 +50,31 @@
     }
 
     public void testCreateFinAccount() throws Exception {
-        Map ctx = FastMap.newInstance();
+        Map<String, Object> ctx = FastMap.newInstance();
         ctx.put("finAccountId", "TESTACCOUNT1");
         ctx.put("finAccountName", "Test Financial Account");
         ctx.put("finAccountTypeId", "BANK_ACCOUNT");
         ctx.put("userLogin", userLogin);
-        Map resp = dispatcher.runSync("createFinAccount", ctx);
+        Map<String, Object> resp = dispatcher.runSync("createFinAccount", ctx);
         assertEquals("Service result success", ModelService.RESPOND_SUCCESS, resp.get(ModelService.RESPONSE_MESSAGE));
     }
 
     public void testDeposit() throws Exception {
-        Map ctx = FastMap.newInstance();
+        Map<String, Object> ctx = FastMap.newInstance();
         ctx.put("finAccountId", "TESTACCOUNT1");
         ctx.put("amount", new BigDecimal("100.00"));
         ctx.put("userLogin", userLogin);
-        Map resp = dispatcher.runSync("finAccountDeposit", ctx);
+        Map<String, Object> resp = dispatcher.runSync("finAccountDeposit", ctx);
         BigDecimal balance = (BigDecimal) resp.get("balance");
         assertEquals(balance.toPlainString(), "100.00");
     }
 
     public void testWithdraw() throws Exception {
-        Map ctx = FastMap.newInstance();
+        Map<String, Object> ctx = FastMap.newInstance();
         ctx.put("finAccountId", "TESTACCOUNT1");
         ctx.put("amount", new BigDecimal("50.00"));
         ctx.put("userLogin", userLogin);
-        Map resp = dispatcher.runSync("finAccountWithdraw", ctx);
+        Map<String, Object> resp = dispatcher.runSync("finAccountWithdraw", ctx);
         BigDecimal previousBalance = (BigDecimal) resp.get("previousBalance");
         BigDecimal balance = ((BigDecimal) resp.get("balance"));
         assertEquals(balance.add(new BigDecimal("50.00")).toPlainString(), previousBalance.toPlainString());

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java Thu Nov 19 17:26:03 2009
@@ -19,27 +19,15 @@
 
 package org.ofbiz.accounting.thirdparty.clearcommerce;
 
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.lang.Thread;
 import java.math.BigDecimal;
+import java.util.Map;
 
 import junit.framework.TestCase;
 
 import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.GenericDispatcher;
-import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.testtools.OFBizTestCase;
 
@@ -53,7 +41,7 @@
     protected GenericValue creditCard = null;
     protected GenericValue billingAddress = null;
     protected GenericValue shippingAddress = null;
-    protected Map pbOrder = null;
+    protected Map<String, Object> pbOrder = null;
     protected BigDecimal creditAmount = null;
     protected String configFile = null;
 
@@ -87,7 +75,7 @@
                 "stateProvinceGeoId", "NLD",
                 "postalCode","12345"));
         pbOrder = UtilMisc.toMap(
-                "OrderFrequencyCycle", "M",
+                "OrderFrequencyCycle", (Object)"M",
                 "OrderFrequencyInterval", "3",
                 "TotalNumberPayments", "4");
     }
@@ -98,7 +86,7 @@
     public void testAuth() throws Exception{
         Debug.logInfo("=====[testAuth] starting....", module);
         try {
-            Map serviceInput = UtilMisc.toMap(
+            Map<String, Object> serviceInput = UtilMisc.toMap(
                     "paymentConfig", configFile,
                     "billToEmail", emailAddr,
                     "creditCard", creditCard,
@@ -109,7 +97,7 @@
             serviceInput.put("processAmount", new BigDecimal("200.00"));
 
             // run the service (make sure in payment
-            Map result = dispatcher.runSync("clearCommerceCCAuth",serviceInput);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCAuth",serviceInput);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -132,7 +120,7 @@
     public void testCredit() throws Exception{
         Debug.logInfo("=====[testCCredit] starting....", module);
         try {
-            Map serviceMap = UtilMisc.toMap(
+            Map<String, Object> serviceMap = UtilMisc.toMap(
                     "paymentConfig", configFile,
                     "orderId", orderId,
                     "creditAmount", creditAmount,
@@ -141,7 +129,7 @@
                     "creditAmount", new BigDecimal("200.00")
            );
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -164,7 +152,7 @@
         Debug.logInfo("=====[testPurchaseSubscription] starting....", module);
         try {
 
-            Map serviceMap = UtilMisc.toMap(
+            Map<String, Object> serviceMap = UtilMisc.toMap(
                     "paymentConfig", configFile,
                     "orderId", orderId,
                     "creditAmount", creditAmount,
@@ -175,7 +163,7 @@
             serviceMap.put("creditAmount", new BigDecimal("200.00"));
 
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -218,13 +206,13 @@
         Debug.logInfo("=====[testReport] starting....", module);
         try {
 
-            Map serviceMap = UtilMisc.toMap(
-                    "orderId", "4488668f-2db0-3002-002b-0003ba1d84d5",
+            Map<String, Object> serviceMap = UtilMisc.toMap(
+                    "orderId", (Object)"4488668f-2db0-3002-002b-0003ba1d84d5",
                     "paymentConfig", configFile
            );
 
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCReport",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCReport",serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java Thu Nov 19 17:26:03 2009
@@ -18,24 +18,23 @@
  *******************************************************************************/
 package org.ofbiz.accounting.thirdparty.gosoftware;
 
-import java.util.Map;
-import java.util.Properties;
-import java.util.List;
-import java.text.DecimalFormat;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.base.util.UtilNumber;
-import org.ofbiz.base.util.UtilProperties;
-import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.accounting.payment.PaymentGatewayServices;
 import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.StringUtil;
 import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.StringUtil;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilNumber;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.accounting.payment.PaymentGatewayServices;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
 
 
 public class PcChargeServices {
@@ -44,7 +43,7 @@
     private static int decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
     private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
 
-    public static Map ccAuth(DispatchContext dctx, Map context) {
+    public static Map<String, Object> ccAuth(DispatchContext dctx, Map<String, Object> context) {
         Properties props = buildPccProperties(context);
         PcChargeApi api = getApi(props);
         if (api == null) {
@@ -85,7 +84,7 @@
         }
 
         if (out != null) {
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             String resultCode = out.get(PcChargeApi.RESULT);
             boolean passed = false;
             if ("CAPTURED".equals(resultCode)) {
@@ -130,7 +129,7 @@
         }
     }
 
-    public static Map ccCapture(DispatchContext dctx, Map context) {
+    public static Map<String, Object> ccCapture(DispatchContext dctx, Map<String, Object> context) {
         GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
 
         //lets see if there is a auth transaction already in context
@@ -167,7 +166,7 @@
         }
 
         if (out != null) {
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             String resultCode = out.get(PcChargeApi.RESULT);
             if ("CAPTURED".equals(resultCode)) {
                 result.put("captureResult", Boolean.TRUE);
@@ -186,7 +185,7 @@
         }
     }
 
-    public static Map ccRelease(DispatchContext dctx, Map context) {
+    public static Map<String, Object> ccRelease(DispatchContext dctx, Map<String, Object> context) {
         GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
 
         //lets see if there is a auth transaction already in context
@@ -228,7 +227,7 @@
         }
 
         if (out != null) {
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             String resultCode = out.get(PcChargeApi.RESULT);
             if ("VOIDED".equals(resultCode)) {
                 result.put("releaseResult", Boolean.TRUE);
@@ -247,7 +246,7 @@
         }
     }
 
-    public static Map ccRefund(DispatchContext dctx, Map context) {
+    public static Map<String, Object> ccRefund(DispatchContext dctx, Map<String, Object> context) {
         GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
 
         //lets see if there is a auth transaction already in context
@@ -284,7 +283,7 @@
         }
 
         if (out != null) {
-            Map result = ServiceUtil.returnSuccess();
+            Map<String, Object> result = ServiceUtil.returnSuccess();
             String resultCode = out.get(PcChargeApi.RESULT);
             if ("CAPTURED".equals(resultCode)) {
                 result.put("refundResult", Boolean.TRUE);
@@ -303,11 +302,11 @@
         }
     }
 
-    private static void setCreditCardInfo(PcChargeApi api, Map context) throws GeneralException {
+    private static void setCreditCardInfo(PcChargeApi api, Map<String, Object> context) throws GeneralException {
         GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
         GenericValue creditCard = (GenericValue) context.get("creditCard");
         if (creditCard != null) {
-            List expDateList = StringUtil.split(creditCard.getString("expireDate"), "/");
+            List<String> expDateList = StringUtil.split(creditCard.getString("expireDate"), "/");
             String month = (String) expDateList.get(0);
             String year = (String) expDateList.get(1);
             String y2d = year.substring(2);
@@ -386,7 +385,7 @@
         return api;
     }
 
-    private static Properties buildPccProperties(Map context) {
+    private static Properties buildPccProperties(Map<String, Object> context) {
         String configString = (String) context.get("paymentConfig");
         if (configString == null) {
             configString = "payment.properties";
@@ -426,7 +425,7 @@
         return props;
     }
 
-    private static String getAmountString(Map context, String amountField) {
+    private static String getAmountString(Map<String, Object> context, String amountField) {
         BigDecimal processAmount = (BigDecimal) context.get(amountField);
         return processAmount.setScale(decimals, rounding).toPlainString();
     }

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java?rev=882210&r1=882209&r2=882210&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java Thu Nov 19 17:26:03 2009
@@ -92,19 +92,19 @@
     protected static final int MODE_IN = 10;
 
     // instance variables
-    protected LinkedHashMap document = null;
+    protected LinkedHashMap<String, String> document = null;
     protected String host = null;
     protected boolean ssl = false;
     protected int port = 0;
     protected int mode = 0;
 
-    public RitaApi(Map document) {
-        this.document = new LinkedHashMap(document);
+    public RitaApi(Map<String, String> document) {
+        this.document = new LinkedHashMap<String, String>(document);
         this.mode = MODE_OUT;
     }
 
     public RitaApi() {
-        this.document = new LinkedHashMap();
+        this.document = new LinkedHashMap<String, String>();
         this.mode = MODE_IN;
     }
 
@@ -151,9 +151,9 @@
     @Override
     public String toString() {
         StringBuilder buf = new StringBuilder();
-        Iterator i = document.entrySet().iterator();
+        Iterator<Map.Entry<String, String>> i = document.entrySet().iterator();
         while (i.hasNext()) {
-            Map.Entry entry = (Map.Entry) i.next();
+            Map.Entry<String, String> entry = i.next();
             String name = (String) entry.getKey();
             String value = (String) entry.getValue();
             buf.append(name);
@@ -165,7 +165,7 @@
         return buf.toString();
     }
 
-    public Map getDocument() {
+    public Map<String, String> getDocument() {
         return this.document;
     }
 
@@ -227,7 +227,7 @@
             br.close();
             */
 
-            LinkedHashMap docMap = new LinkedHashMap();
+            LinkedHashMap<String, String> docMap = new LinkedHashMap<String, String>();
             String resp = null;
             try {
                 resp = http.post(stream);



Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Scott Gray <sc...@hotwaxmedia.com>.
On 20/11/2009, at 9:54 AM, Adam Heath wrote:

>>>
>>> Also look at this:
>>> http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html
>>
>> Ah okay I see, so using Object doesn't modify the context but it does
>> allow the context to be modified whereas ? will block any attempts to
>> use put.
>>
>> BTW, <String, ? extends Object> is the same as using <String, ?>  
>> isn't it?
>
> No.  ? means you have no idea what kind of value is in the map.  None
> at all.  All you can do with such a map is take it's size, work with
> the keyset, or remove values.  You can't store values, can't do
> anything with values *returned* from methods.
>
> I't s a pure side-effect that all classes in java extend Object, but
> the generics markup above doesn't consider that.
>

Okay thanks Adam and thanks for the link, it looks like a great  
reference.

Regards
Scott

Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Adam Heath <do...@brainfood.com>.
>> ==
>> Map<String, Object> context:
>>
>> This means that the type of the values stored in the context need to
>> be of type Object.  Since all objects are this way, anything can be
>> stored into the context.
>>
>> Map<String, ? extends Object> context:
>>
>> This means that the *concrete* type of the value is *some unknown*
>> class, that extends Object.  Anyone can pull anything out of this
>> context, as it *will* extend Object.  However, since the actual type
>> of the values is not known, no one can put anything in, as it might
>> cause a ClassCastException somewhere.
>>
>> ==
>>
>> The former can be cast to the latter, but not vice versa.
>>
>> Plus, it's rather good form, to consider *all* incoming parameters on
>> *any* method(not just service implementations) to be read-only, and
>> only return results thru the method's return value.  This is called
>> having no side-effects.
>>
>> Also look at this:
>> http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html
> 
> Ah okay I see, so using Object doesn't modify the context but it does
> allow the context to be modified whereas ? will block any attempts to
> use put.
> 
> BTW, <String, ? extends Object> is the same as using <String, ?> isn't it?

No.  ? means you have no idea what kind of value is in the map.  None
at all.  All you can do with such a map is take it's size, work with
the keyset, or remove values.  You can't store values, can't do
anything with values *returned* from methods.

I't s a pure side-effect that all classes in java extend Object, but
the generics markup above doesn't consider that.


Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Scott Gray <sc...@hotwaxmedia.com>.
On 20/11/2009, at 9:36 AM, Adam Heath wrote:

> Scott Gray wrote:
>> On 20/11/2009, at 9:16 AM, Adam Heath wrote:
>>
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =================================================================
>>>>>>
>>>>>> ---
>>>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>>>>>> invoice/InvoiceServices.java
>>>>>>
>>>>>> (original)
>>>>>> +++
>>>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>>>>>> invoice/InvoiceServices.java
>>>>>>
>>>>>> Thu Nov 19 17:26:03 2009
>>>>>> @@ -1158,7 +1158,7 @@
>>>>>>       return serviceResult;
>>>>>>   }
>>>>>>
>>>>>> -    public static Map<String, Object>
>>>>>> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>>>>>> +    public static Map<String, Object>
>>>>>> createInvoicesFromShipments(DispatchContext dctx, Map<String,  
>>>>>> Object>
>>>>>> context) {
>>>>>>       Delegator delegator = dctx.getDelegator();
>>>>>>       LocalDispatcher dispatcher = dctx.getDispatcher();
>>>>>>       List<String> shipmentIds =
>>>>>> UtilGenerics.checkList(context.get("shipmentIds"));
>>>>>>
>>>>>
>>>>> Nope, this is wrong.
>>>>>
>>>>> Map<String, ? extends Object> context.
>>>>>
>>>>> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>>>>>
>>>>> The service engine *owns* the incoming context map.  Called  
>>>>> services
>>>>> are not allowed to change it *at all*.
>>>>>
>>>>> There are already plenty of existing examples.
>>>>>
>>>>> When I did similiar things to framework, I discovered several  
>>>>> services
>>>>> that modified the incoming context.  I then had to change their  
>>>>> code
>>>>> to deal with that problem.  This patch needs to have the same  
>>>>> thing
>>>>> done to it.
>>>>
>>>> Hi Adam,
>>>>
>>>> Could you explain a bit more?  When I look at the  
>>>> StandardJavaEngine
>>>> class the serviceInvoker method is specifically passing a  
>>>> Map<String,
>>>> Object> for the context.
>>>
>>> serviceInvoker adds/removes things to this context, yes, so it has  
>>> to
>>> have that generics markup.  However, the things it calls *must* keep
>>> it read-only, so that when several services in a chain are
>>> called(think secas, service groups), once service can't affect  
>>> another
>>> in the set.
>>>
>>
>> Thanks for the explanation, I won't pretend that I understand how  
>> using
>> the same markup as the invoking method modifies the context  
>> though :-)
>> I'll just flag this piece of generics as something I need to study  
>> up on.
>
> ==
> Map<String, Object> context:
>
> This means that the type of the values stored in the context need to
> be of type Object.  Since all objects are this way, anything can be
> stored into the context.
>
> Map<String, ? extends Object> context:
>
> This means that the *concrete* type of the value is *some unknown*
> class, that extends Object.  Anyone can pull anything out of this
> context, as it *will* extend Object.  However, since the actual type
> of the values is not known, no one can put anything in, as it might
> cause a ClassCastException somewhere.
>
> ==
>
> The former can be cast to the latter, but not vice versa.
>
> Plus, it's rather good form, to consider *all* incoming parameters on
> *any* method(not just service implementations) to be read-only, and
> only return results thru the method's return value.  This is called
> having no side-effects.
>
> Also look at this:
> http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html

Ah okay I see, so using Object doesn't modify the context but it does  
allow the context to be modified whereas ? will block any attempts to  
use put.

BTW, <String, ? extends Object> is the same as using <String, ?> isn't  
it?

Thanks
Scott


Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Adam Heath <do...@brainfood.com>.
Scott Gray wrote:
> On 20/11/2009, at 9:16 AM, Adam Heath wrote:
> 
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> ===================================================================
>>>>>
>>>>> ---
>>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>>>>>
>>>>> (original)
>>>>> +++
>>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>>>>>
>>>>> Thu Nov 19 17:26:03 2009
>>>>> @@ -1158,7 +1158,7 @@
>>>>>        return serviceResult;
>>>>>    }
>>>>>
>>>>> -    public static Map<String, Object>
>>>>> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>>>>> +    public static Map<String, Object>
>>>>> createInvoicesFromShipments(DispatchContext dctx, Map<String, Object>
>>>>> context) {
>>>>>        Delegator delegator = dctx.getDelegator();
>>>>>        LocalDispatcher dispatcher = dctx.getDispatcher();
>>>>>        List<String> shipmentIds =
>>>>> UtilGenerics.checkList(context.get("shipmentIds"));
>>>>>
>>>>
>>>> Nope, this is wrong.
>>>>
>>>> Map<String, ? extends Object> context.
>>>>
>>>> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>>>>
>>>> The service engine *owns* the incoming context map.  Called services
>>>> are not allowed to change it *at all*.
>>>>
>>>> There are already plenty of existing examples.
>>>>
>>>> When I did similiar things to framework, I discovered several services
>>>> that modified the incoming context.  I then had to change their code
>>>> to deal with that problem.  This patch needs to have the same thing
>>>> done to it.
>>>
>>> Hi Adam,
>>>
>>> Could you explain a bit more?  When I look at the StandardJavaEngine
>>> class the serviceInvoker method is specifically passing a Map<String,
>>> Object> for the context.
>>
>> serviceInvoker adds/removes things to this context, yes, so it has to
>> have that generics markup.  However, the things it calls *must* keep
>> it read-only, so that when several services in a chain are
>> called(think secas, service groups), once service can't affect another
>> in the set.
>>
> 
> Thanks for the explanation, I won't pretend that I understand how using
> the same markup as the invoking method modifies the context though :-)
> I'll just flag this piece of generics as something I need to study up on.

==
Map<String, Object> context:

This means that the type of the values stored in the context need to
be of type Object.  Since all objects are this way, anything can be
stored into the context.

Map<String, ? extends Object> context:

This means that the *concrete* type of the value is *some unknown*
class, that extends Object.  Anyone can pull anything out of this
context, as it *will* extend Object.  However, since the actual type
of the values is not known, no one can put anything in, as it might
cause a ClassCastException somewhere.

==

The former can be cast to the latter, but not vice versa.

Plus, it's rather good form, to consider *all* incoming parameters on
*any* method(not just service implementations) to be read-only, and
only return results thru the method's return value.  This is called
having no side-effects.

Also look at this:
http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html

Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Scott Gray <sc...@hotwaxmedia.com>.
On 20/11/2009, at 9:16 AM, Adam Heath wrote:

>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>>>> invoice/InvoiceServices.java
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>>>> invoice/InvoiceServices.java
>>>> Thu Nov 19 17:26:03 2009
>>>> @@ -1158,7 +1158,7 @@
>>>>        return serviceResult;
>>>>    }
>>>>
>>>> -    public static Map<String, Object>
>>>> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>>>> +    public static Map<String, Object>
>>>> createInvoicesFromShipments(DispatchContext dctx, Map<String,  
>>>> Object>
>>>> context) {
>>>>        Delegator delegator = dctx.getDelegator();
>>>>        LocalDispatcher dispatcher = dctx.getDispatcher();
>>>>        List<String> shipmentIds =
>>>> UtilGenerics.checkList(context.get("shipmentIds"));
>>>>
>>>
>>> Nope, this is wrong.
>>>
>>> Map<String, ? extends Object> context.
>>>
>>> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>>>
>>> The service engine *owns* the incoming context map.  Called services
>>> are not allowed to change it *at all*.
>>>
>>> There are already plenty of existing examples.
>>>
>>> When I did similiar things to framework, I discovered several  
>>> services
>>> that modified the incoming context.  I then had to change their code
>>> to deal with that problem.  This patch needs to have the same thing
>>> done to it.
>>
>> Hi Adam,
>>
>> Could you explain a bit more?  When I look at the StandardJavaEngine
>> class the serviceInvoker method is specifically passing a Map<String,
>> Object> for the context.
>
> serviceInvoker adds/removes things to this context, yes, so it has to
> have that generics markup.  However, the things it calls *must* keep
> it read-only, so that when several services in a chain are
> called(think secas, service groups), once service can't affect another
> in the set.
>

Thanks for the explanation, I won't pretend that I understand how  
using the same markup as the invoking method modifies the context  
though :-)
I'll just flag this piece of generics as something I need to study up  
on.

Regards
Scott


Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Adam Heath <do...@brainfood.com>.
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>>> Thu Nov 19 17:26:03 2009
>>> @@ -1158,7 +1158,7 @@
>>>         return serviceResult;
>>>     }
>>>
>>> -    public static Map<String, Object>
>>> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>>> +    public static Map<String, Object>
>>> createInvoicesFromShipments(DispatchContext dctx, Map<String, Object>
>>> context) {
>>>         Delegator delegator = dctx.getDelegator();
>>>         LocalDispatcher dispatcher = dctx.getDispatcher();
>>>         List<String> shipmentIds =
>>> UtilGenerics.checkList(context.get("shipmentIds"));
>>>
>>
>> Nope, this is wrong.
>>
>> Map<String, ? extends Object> context.
>>
>> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>>
>> The service engine *owns* the incoming context map.  Called services
>> are not allowed to change it *at all*.
>>
>> There are already plenty of existing examples.
>>
>> When I did similiar things to framework, I discovered several services
>> that modified the incoming context.  I then had to change their code
>> to deal with that problem.  This patch needs to have the same thing
>> done to it.
> 
> Hi Adam,
> 
> Could you explain a bit more?  When I look at the StandardJavaEngine
> class the serviceInvoker method is specifically passing a Map<String,
> Object> for the context.

serviceInvoker adds/removes things to this context, yes, so it has to
have that generics markup.  However, the things it calls *must* keep
it read-only, so that when several services in a chain are
called(think secas, service groups), once service can't affect another
in the set.


Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Scott Gray <sc...@hotwaxmedia.com>.
On 20/11/2009, at 6:50 AM, Adam Heath wrote:

> jleroux@apache.org wrote:
>> Author: jleroux
>> Date: Thu Nov 19 17:26:03 2009
>> New Revision: 882210
>>
>> URL: http://svn.apache.org/viewvc?rev=882210&view=rev
>> Log:
>> A patch from Marc Morin "Resolve java warnings exposed in  
>> Eclipse :  application - accounting" (https://issues.apache.org/jira/browse/OFBIZ-3157 
>> ) - OFBIZ-3157¨
>> Patch for generic's warnings for accounting application
>>
>> I will soon commit InvoiceWorker.java (got a conflict) and some  
>> other changes I want to do, mostly enhanced for loops
>>
>> Modified:
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> GlEvents.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> invoice/InvoiceServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> payment/BillingAccountWorker.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> payment/GiftCertificateServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> payment/PaymentGatewayServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> payment/PaymentMethodServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> period/PeriodServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/ 
>> TaxAuthorityServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> test/FinAccountTests.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/clearcommerce/CCServicesTest.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/gosoftware/PcChargeServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/gosoftware/RitaApi.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/gosoftware/RitaServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/valuelink/ValueLinkApi.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> thirdparty/valuelink/ValueLinkServices.java
>>    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> util/UtilAccounting.java
>>
>> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/ 
>> accounting/GlEvents.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java?rev=882210&r1=882209&r2=882210&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> GlEvents.java (original)
>> +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/ 
>> GlEvents.java Thu Nov 19 17:26:03 2009
>> @@ -19,7 +19,6 @@
>> package org.ofbiz.accounting;
>>
>> import java.math.BigDecimal;
>> -import java.util.List;
>> import java.util.Map;
>>
>> import javax.servlet.http.HttpServletRequest;
>>
>> 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=882210&r1=882209&r2=882210&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 Thu Nov 19 17:26:03 2009
>> @@ -1158,7 +1158,7 @@
>>         return serviceResult;
>>     }
>>
>> -    public static Map<String, Object>  
>> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>> +    public static Map<String, Object>  
>> createInvoicesFromShipments(DispatchContext dctx, Map<String,  
>> Object> context) {
>>         Delegator delegator = dctx.getDelegator();
>>         LocalDispatcher dispatcher = dctx.getDispatcher();
>>         List<String> shipmentIds =  
>> UtilGenerics.checkList(context.get("shipmentIds"));
>>
>
> Nope, this is wrong.
>
> Map<String, ? extends Object> context.
>
> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>
> The service engine *owns* the incoming context map.  Called services
> are not allowed to change it *at all*.
>
> There are already plenty of existing examples.
>
> When I did similiar things to framework, I discovered several services
> that modified the incoming context.  I then had to change their code
> to deal with that problem.  This patch needs to have the same thing
> done to it.

Hi Adam,

Could you explain a bit more?  When I look at the StandardJavaEngine  
class the serviceInvoker method is specifically passing a Map<String,  
Object> for the context.

Thanks
Scott


Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks for you detailled explanation Adam,

I was not aware of this issue.

Reverted at r882342

Jacques

From: "Adam Heath" <do...@brainfood.com>
> jleroux@apache.org wrote:
>> Author: jleroux
>> Date: Thu Nov 19 17:26:03 2009
>> New Revision: 882210
>>
>> URL: http://svn.apache.org/viewvc?rev=882210&view=rev
>> Log:
>> A patch from Marc Morin "Resolve java warnings exposed in Eclipse :  application - accounting" 
>> (https://issues.apache.org/jira/browse/OFBIZ-3157) - OFBIZ-3157¨
>> Patch for generic's warnings for accounting application
>>
>> I will soon commit InvoiceWorker.java (got a conflict) and some other changes I want to do, mostly enhanced for loops
>>
>> Modified:
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
>>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
>>
>> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java?rev=882210&r1=882209&r2=882210&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java (original)
>> +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java Thu Nov 19 17:26:03 2009
>> @@ -19,7 +19,6 @@
>>  package org.ofbiz.accounting;
>>
>>  import java.math.BigDecimal;
>> -import java.util.List;
>>  import java.util.Map;
>>
>>  import javax.servlet.http.HttpServletRequest;
>>
>> 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=882210&r1=882209&r2=882210&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 Thu Nov 19 17:26:03 2009
>> @@ -1158,7 +1158,7 @@
>>          return serviceResult;
>>      }
>>
>> -    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map context) {
>> +    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map<String, Object> context) {
>>          Delegator delegator = dctx.getDelegator();
>>          LocalDispatcher dispatcher = dctx.getDispatcher();
>>          List<String> shipmentIds = UtilGenerics.checkList(context.get("shipmentIds"));
>>
>
> Nope, this is wrong.
>
> Map<String, ? extends Object> context.
>
> THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.
>
> The service engine *owns* the incoming context map.  Called services
> are not allowed to change it *at all*.
>
> There are already plenty of existing examples.
>
> When I did similiar things to framework, I discovered several services
> that modified the incoming context.  I then had to change their code
> to deal with that problem.  This patch needs to have the same thing
> done to it.
> 



Re: svn commit: r882210 [1/2] - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ invoice/ payment/ period/ tax/ test/ thirdparty/clearcommerce/ thirdparty/gosoftware/ thirdparty/valuelink/ util/

Posted by Adam Heath <do...@brainfood.com>.
jleroux@apache.org wrote:
> Author: jleroux
> Date: Thu Nov 19 17:26:03 2009
> New Revision: 882210
> 
> URL: http://svn.apache.org/viewvc?rev=882210&view=rev
> Log:
> A patch from Marc Morin "Resolve java warnings exposed in Eclipse :  application - accounting" (https://issues.apache.org/jira/browse/OFBIZ-3157) - OFBIZ-3157¨
> Patch for generic's warnings for accounting application 
> 
> I will soon commit InvoiceWorker.java (got a conflict) and some other changes I want to do, mostly enhanced for loops
> 
> Modified:
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/PcChargeServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
>     ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
> 
> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java?rev=882210&r1=882209&r2=882210&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java (original)
> +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java Thu Nov 19 17:26:03 2009
> @@ -19,7 +19,6 @@
>  package org.ofbiz.accounting;
>  
>  import java.math.BigDecimal;
> -import java.util.List;
>  import java.util.Map;
>  
>  import javax.servlet.http.HttpServletRequest;
> 
> 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=882210&r1=882209&r2=882210&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 Thu Nov 19 17:26:03 2009
> @@ -1158,7 +1158,7 @@
>          return serviceResult;
>      }
>  
> -    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map context) {
> +    public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map<String, Object> context) {
>          Delegator delegator = dctx.getDelegator();
>          LocalDispatcher dispatcher = dctx.getDispatcher();
>          List<String> shipmentIds = UtilGenerics.checkList(context.get("shipmentIds"));
> 

Nope, this is wrong.

Map<String, ? extends Object> context.

THIS IS A BUG.  PLEASE REVERT UNTIL IT IS FIXED.

The service engine *owns* the incoming context map.  Called services
are not allowed to change it *at all*.

There are already plenty of existing examples.

When I did similiar things to framework, I discovered several services
that modified the incoming context.  I then had to change their code
to deal with that problem.  This patch needs to have the same thing
done to it.