You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2011/01/16 18:25:00 UTC

svn commit: r1059618 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java

Author: mrisaliti
Date: Sun Jan 16 17:25:00 2011
New Revision: 1059618

URL: http://svn.apache.org/viewvc?rev=1059618&view=rev
Log:
Remove most of the java compilation warning (generics markup, unused code/import) (OFBIZ-4102)

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java

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=1059618&r1=1059617&r2=1059618&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 Sun Jan 16 17:25:00 2011
@@ -20,13 +20,14 @@ package org.ofbiz.accounting.payment;
 
 import java.math.BigDecimal;
 import java.sql.Timestamp;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 
+import javolution.util.FastMap;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilDateTime;
@@ -59,7 +60,7 @@ public class GiftCertificateServices {
     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, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         Locale locale = (Locale) context.get("locale");
@@ -85,7 +86,7 @@ public class GiftCertificateServices {
             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
@@ -104,7 +105,7 @@ public class GiftCertificateServices {
                 finAccountId = cardNumber;
 
                 // create the FinAccount
-                Map acctCtx = UtilMisc.toMap("finAccountId", finAccountId);
+                Map<String, Object> acctCtx = UtilMisc.<String, Object>toMap("finAccountId", finAccountId);
                 acctCtx.put("finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId);
                 acctCtx.put("finAccountName", accountName);
                 acctCtx.put("finAccountCode", pinNumber);
@@ -145,7 +146,7 @@ public class GiftCertificateServices {
             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);
@@ -156,7 +157,7 @@ public class GiftCertificateServices {
         return result;
     }
 
-    public static Map addFundsToGiftCertificate(DispatchContext dctx, Map context) {
+    public static Map<String, Object> addFundsToGiftCertificate(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         Locale locale = (Locale) context.get("locale");
@@ -234,7 +235,7 @@ public class GiftCertificateServices {
             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);
@@ -245,7 +246,7 @@ public class GiftCertificateServices {
         return result;
     }
 
-    public static Map redeemGiftCertificate(DispatchContext dctx, Map context) {
+    public static Map<String, Object> redeemGiftCertificate(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         final String withdrawl = "WITHDRAWAL";
@@ -317,7 +318,7 @@ public class GiftCertificateServices {
             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);
@@ -328,7 +329,7 @@ public class GiftCertificateServices {
         return result;
     }
 
-    public static Map checkGiftCertificateBalance(DispatchContext dctx, Map context) {
+    public static Map<String, Object> checkGiftCertificateBalance(DispatchContext dctx, Map<String, ? extends Object> context) {
         Delegator delegator = dctx.getDelegator();
         String cardNumber = (String) context.get("cardNumber");
         String pinNumber = (String) context.get("pinNumber");
@@ -353,14 +354,14 @@ public class GiftCertificateServices {
         // 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, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -406,7 +407,7 @@ public class GiftCertificateServices {
             // obtain the order information
             OrderReadHelper orh = new OrderReadHelper(delegator, orderPaymentPreference.getString("orderId"));
 
-            Map redeemCtx = new HashMap();
+            Map<String, Object> redeemCtx = FastMap.newInstance();
             redeemCtx.put("userLogin", userLogin);
             redeemCtx.put("productStoreId", orh.getProductStoreId());
             redeemCtx.put("cardNumber", giftCard.get("finAccountId"));
@@ -418,20 +419,21 @@ public class GiftCertificateServices {
             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);
@@ -455,7 +457,7 @@ public class GiftCertificateServices {
 }
 
 
-    public static Map giftCertificateAuthorize(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateAuthorize(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -517,7 +519,7 @@ public class GiftCertificateServices {
             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);
@@ -528,8 +530,10 @@ public class GiftCertificateServices {
                 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,
-                        "thruDate", thruDate, "userLogin", userLogin));
+                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;
                 } else {
@@ -564,7 +568,7 @@ public class GiftCertificateServices {
         }
     }
 
-    public static Map giftCertificateRefund(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateRefund(DispatchContext dctx, Map<String, ? extends Object> context) {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference");
         String currency = (String) context.get("currency");
@@ -573,7 +577,7 @@ public class GiftCertificateServices {
         return giftCertificateRestore(dctx, userLogin, paymentPref, amount, currency, "refund", locale);
     }
 
-    public static Map giftCertificateRelease(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateRelease(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference");
@@ -588,10 +592,11 @@ public class GiftCertificateServices {
                 return ServiceUtil.returnError(err + UtilProperties.getMessage(resourceError, 
                         "AccountingFinAccountCannotFindAuthorization", locale));
             }
-            Map input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum"));
-            Map serviceResults = dispatcher.runSync("expireFinAccountAuth", input);
+            Map<String, Object> input = UtilMisc.<String, Object>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);
@@ -608,7 +613,7 @@ public class GiftCertificateServices {
         }
     }
 
-    private static Map giftCertificateRestore(DispatchContext dctx, GenericValue userLogin, GenericValue paymentPref, 
+    private static Map<String, Object> giftCertificateRestore(DispatchContext dctx, GenericValue userLogin, GenericValue paymentPref, 
             BigDecimal amount, String currency, String resultPrefix, Locale locale) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
@@ -645,7 +650,7 @@ public class GiftCertificateServices {
             currency = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD");
         }
 
-        Map refundCtx = new HashMap();
+        Map<String, Object> refundCtx = FastMap.newInstance();
         refundCtx.put("productStoreId", productStoreId);
         refundCtx.put("currency", currency);
         refundCtx.put("partyId", partyId);
@@ -655,7 +660,7 @@ public class GiftCertificateServices {
         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) {
@@ -667,7 +672,7 @@ public class GiftCertificateServices {
             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);
@@ -680,7 +685,7 @@ public class GiftCertificateServices {
         return result;
     }
 
-    public static Map giftCertificatePurchase(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificatePurchase(DispatchContext dctx, Map<String, ? extends Object> context) {
         // this service should always be called via FULFILLMENT_EXTASYNC
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
@@ -764,9 +769,10 @@ public class GiftCertificateServices {
         // 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.<String, Object>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) {
@@ -780,7 +786,7 @@ public class GiftCertificateServices {
         }
 
         // get the response answers
-        List responseAnswers = null;
+        List<GenericValue> responseAnswers = null;
         try {
             responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
         } catch (GenericEntityException e) {
@@ -790,9 +796,9 @@ public class GiftCertificateServices {
         }
 
         // make a map of answer info
-        Map answerMap = new HashMap();
+        Map<String, Object> answerMap = FastMap.newInstance();
         if (responseAnswers != null) {
-            Iterator rai = responseAnswers.iterator();
+            Iterator<GenericValue> rai = responseAnswers.iterator();
             while (rai.hasNext()) {
                 GenericValue answer = (GenericValue) rai.next();
                 GenericValue question = null;
@@ -825,7 +831,7 @@ public class GiftCertificateServices {
         int qtyLoop = quantity.intValue();
         for (int i = 0; i < qtyLoop; i++) {
             // create a gift certificate
-            Map createGcCtx = new HashMap();
+            Map<String, Object> createGcCtx = FastMap.newInstance();
             //createGcCtx.put("paymentConfig", paymentConfig);
             createGcCtx.put("productStoreId", productStoreId);
             createGcCtx.put("currency", currency);
@@ -834,7 +840,7 @@ public class GiftCertificateServices {
             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) {
@@ -849,7 +855,7 @@ public class GiftCertificateServices {
             }
 
             // create the fulfillment record
-            Map gcFulFill = new HashMap();
+            Map<String, Object> gcFulFill = FastMap.newInstance();
             gcFulFill.put("typeEnumId", "GC_ACTIVATE");
             gcFulFill.put("partyId", partyId);
             gcFulFill.put("orderId", orderId);
@@ -879,7 +885,8 @@ public class GiftCertificateServices {
             GenericValue productStoreEmail = null;
             String emailType = "PRDS_GC_PURCHASE";
             try {
-                productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
+                productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", 
+                        UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType));
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get product store email setting for gift card purchase", module);
             }
@@ -902,7 +909,7 @@ public class GiftCertificateServices {
                     }
                 }
 
-                Map emailCtx = new HashMap();
+                Map<String, Object> emailCtx = FastMap.newInstance();
                 String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
                 if (UtilValidate.isEmpty(bodyScreenLocation)) {
                     bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -935,7 +942,7 @@ public class GiftCertificateServices {
         return ServiceUtil.returnSuccess();
     }
 
-    public static Map giftCertificateReload(DispatchContext dctx, Map context) {
+    public static Map<String, Object> giftCertificateReload(DispatchContext dctx, Map<String, ? extends Object> context) {
         // this service should always be called via FULFILLMENT_EXTSYNC
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
@@ -1004,9 +1011,10 @@ public class GiftCertificateServices {
         // 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) {
@@ -1016,7 +1024,7 @@ public class GiftCertificateServices {
         }
 
         // get the response answers
-        List responseAnswers = null;
+        List<GenericValue> responseAnswers = null;
         try {
             responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
         } catch (GenericEntityException e) {
@@ -1026,9 +1034,9 @@ public class GiftCertificateServices {
         }
 
         // make a map of answer info
-        Map answerMap = new HashMap();
+        Map<String, Object> answerMap = FastMap.newInstance();
         if (responseAnswers != null) {
-            Iterator rai = responseAnswers.iterator();
+            Iterator<GenericValue> rai = responseAnswers.iterator();
             while (rai.hasNext()) {
                 GenericValue answer = (GenericValue) rai.next();
                 GenericValue question = null;
@@ -1053,7 +1061,7 @@ public class GiftCertificateServices {
         String pinNumber = (String) answerMap.get(pinNumberKey);
 
         // reload the gift card
-        Map reloadCtx = new HashMap();
+        Map<String, Object> reloadCtx = FastMap.newInstance();
         reloadCtx.put("productStoreId", productStoreId);
         reloadCtx.put("currency", currency);
         reloadCtx.put("partyId", partyId);
@@ -1064,7 +1072,7 @@ public class GiftCertificateServices {
         reloadCtx.put("userLogin", userLogin);
 
         String errorMessage = null;
-        Map reloadGcResult = null;
+        Map<String, Object> reloadGcResult = null;
         try {
             reloadGcResult = dispatcher.runSync("addFundsToGiftCertificate", reloadCtx);
         } catch (GenericServiceException e) {
@@ -1076,7 +1084,7 @@ public class GiftCertificateServices {
         }
 
         // create the fulfillment record
-        Map gcFulFill = new HashMap();
+        Map<String, Object> gcFulFill = FastMap.newInstance();
         gcFulFill.put("typeEnumId", "GC_RELOAD");
         gcFulFill.put("userLogin", userLogin);
         gcFulFill.put("partyId", partyId);
@@ -1105,7 +1113,8 @@ public class GiftCertificateServices {
 
             // 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);
@@ -1137,7 +1146,7 @@ public class GiftCertificateServices {
             answerMap.put("uiLabelMap", uiLabelMap);
             answerMap.put("locale", locale);
 
-            Map emailCtx = new HashMap();
+            Map<String, Object> emailCtx = FastMap.newInstance();
             String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
             if (UtilValidate.isEmpty(bodyScreenLocation)) {
                 bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -1168,7 +1177,7 @@ public class GiftCertificateServices {
     }
 
     // Tracking Service
-    public static Map createFulfillmentRecord(DispatchContext dctx, Map context) {
+    public static Map<String, Object> createFulfillmentRecord(DispatchContext dctx, Map<String, ? extends Object> context) {
         Delegator delegator = dctx.getDelegator();
         Locale locale = (Locale) context.get("locale");
 
@@ -1200,7 +1209,7 @@ public class GiftCertificateServices {
     }
 
     // Refund Service
-    public static Map refundGcPurchase(DispatchContext dctx, Map context) {
+    public static Map<String, Object> refundGcPurchase(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -1215,9 +1224,10 @@ public class GiftCertificateServices {
             Debug.logError(e, module);
         }
 
-        Map returnableInfo = null;
+        Map<String, Object> returnableInfo = null;
         try {
-            returnableInfo = dispatcher.runSync("getReturnableQuantity", UtilMisc.toMap("orderItem", orderItem, "userLogin", userLogin));
+            returnableInfo = dispatcher.runSync("getReturnableQuantity", UtilMisc.toMap("orderItem", orderItem, 
+                    "userLogin", userLogin));
         } catch (GenericServiceException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, 
@@ -1230,10 +1240,10 @@ public class GiftCertificateServices {
             Debug.logInfo("Returnable INFO : " + returnableQuantity + " @ " + returnablePrice + " :: " + orderItem, module);
 
             // create the return header
-            Map returnHeaderInfo = new HashMap();
+            Map<String, Object> returnHeaderInfo = FastMap.newInstance();
             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) {
@@ -1260,7 +1270,7 @@ public class GiftCertificateServices {
             }
 
             // create the return item
-            Map returnItemInfo = new HashMap();
+            Map<String, Object> returnItemInfo = FastMap.newInstance();
             returnItemInfo.put("returnId", returnId);
             returnItemInfo.put("returnReasonId", "RTN_DIG_FILL_FAIL");
             returnItemInfo.put("returnTypeId", "RTN_REFUND");
@@ -1271,7 +1281,7 @@ public class GiftCertificateServices {
             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) {
@@ -1310,12 +1320,12 @@ public class GiftCertificateServices {
             }
 
             // update the status to received so it can process
-            Map updateReturnInfo = new HashMap();
+            Map<String, Object> updateReturnInfo = FastMap.newInstance();
             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) {
@@ -1382,7 +1392,7 @@ public class GiftCertificateServices {
         }
 
         // create the payment for the transaction
-        Map paymentCtx = UtilMisc.toMap("paymentTypeId", paymentType);
+        Map<String, Object> paymentCtx = UtilMisc.<String, Object>toMap("paymentTypeId", paymentType);
         paymentCtx.put("paymentMethodTypeId", paymentMethodType);
         //paymentCtx.put("paymentMethodId", "");
         //paymentCtx.put("paymentGatewayResponseId", "");
@@ -1396,7 +1406,7 @@ public class GiftCertificateServices {
         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) {
@@ -1412,14 +1422,14 @@ public class GiftCertificateServices {
         }
 
         // create the initial transaction
-        Map transCtx = UtilMisc.toMap("finAccountTransTypeId", txType);
+        Map<String, Object> transCtx = UtilMisc.<String, Object>toMap("finAccountTransTypeId", 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);