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/30 19:15:45 UTC
svn commit: r1065338 -
/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java
Author: mrisaliti
Date: Sun Jan 30 18:15:44 2011
New Revision: 1065338
URL: http://svn.apache.org/viewvc?rev=1065338&view=rev
Log:
Remove java compilation warnings of OrderManagerEvents (OFBIZ-4102)
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java?rev=1065338&r1=1065337&r2=1065338&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java Sun Jan 30 18:15:44 2011
@@ -20,7 +20,6 @@ package org.ofbiz.order;
import java.math.BigDecimal;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -29,6 +28,8 @@ import javax.servlet.http.HttpServletReq
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import javolution.util.FastList;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -68,12 +69,12 @@ public class OrderManagerEvents {
if (session.getAttribute("OFFLINE_PAYMENTS") != null) {
String orderId = (String) request.getAttribute("orderId");
- List toBeStored = new LinkedList();
- List paymentPrefs = null;
+ List<GenericValue> toBeStored = FastList.newInstance();
+ List<GenericValue> paymentPrefs = null;
GenericValue placingCustomer = null;
try {
paymentPrefs = delegator.findByAnd("OrderPaymentPreference", UtilMisc.toMap("orderId", orderId));
- List pRoles = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "PLACING_CUSTOMER"));
+ List<GenericValue> pRoles = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "PLACING_CUSTOMER"));
if (UtilValidate.isNotEmpty(pRoles))
placingCustomer = EntityUtil.getFirst(pRoles);
} catch (GenericEntityException e) {
@@ -82,17 +83,17 @@ public class OrderManagerEvents {
return "error";
}
if (paymentPrefs != null) {
- Iterator i = paymentPrefs.iterator();
+ Iterator<GenericValue> i = paymentPrefs.iterator();
while (i.hasNext()) {
// update the preference to received
// TODO: updating payment preferences should be done as a service
- GenericValue ppref = (GenericValue) i.next();
+ GenericValue ppref = i.next();
ppref.set("statusId", "PAYMENT_RECEIVED");
ppref.set("authDate", UtilDateTime.nowTimestamp());
toBeStored.add(ppref);
// create a payment record
- Map results = null;
+ Map<String, Object> results = null;
try {
results = dispatcher.runSync("createPaymentFromPreference", UtilMisc.toMap("orderPaymentPreferenceId", ppref.get("orderPaymentPreferenceId"),
"paymentFromId", placingCustomer.getString("partyId"), "comments", "Payment received offline and manually entered."));
@@ -150,7 +151,7 @@ public class OrderManagerEvents {
}
// get the payment types to receive
- List paymentMethodTypes = null;
+ List<GenericValue> paymentMethodTypes = null;
try {
EntityExpr ee = EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.NOT_EQUAL, "EXT_OFFLINE");
@@ -166,10 +167,10 @@ public class OrderManagerEvents {
return "error";
}
- List toBeStored = new LinkedList();
+ List<GenericValue> toBeStored = FastList.newInstance();
GenericValue placingCustomer = null;
try {
- List pRoles = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "PLACING_CUSTOMER"));
+ List<GenericValue> pRoles = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "PLACING_CUSTOMER"));
if (UtilValidate.isNotEmpty(pRoles))
placingCustomer = EntityUtil.getFirst(pRoles);
} catch (GenericEntityException e) {
@@ -178,9 +179,9 @@ public class OrderManagerEvents {
return "error";
}
- Iterator pmti = paymentMethodTypes.iterator();
+ Iterator<GenericValue> pmti = paymentMethodTypes.iterator();
while (pmti.hasNext()) {
- GenericValue paymentMethodType = (GenericValue) pmti.next();
+ GenericValue paymentMethodType = pmti.next();
String paymentMethodTypeId = paymentMethodType.getString("paymentMethodTypeId");
String amountStr = request.getParameter(paymentMethodTypeId + "_amount");
String paymentReference = request.getParameter(paymentMethodTypeId + "_reference");
@@ -196,7 +197,7 @@ public class OrderManagerEvents {
// create the OrderPaymentPreference
// TODO: this should be done with a service
- Map prefFields = UtilMisc.toMap("orderPaymentPreferenceId", delegator.getNextSeqId("OrderPaymentPreference"));
+ Map<String, String> prefFields = UtilMisc.<String, String>toMap("orderPaymentPreferenceId", delegator.getNextSeqId("OrderPaymentPreference"));
GenericValue paymentPreference = delegator.makeValue("OrderPaymentPreference", prefFields);
paymentPreference.set("paymentMethodTypeId", paymentMethodType.getString("paymentMethodTypeId"));
paymentPreference.set("maxAmount", paymentTypeAmount);
@@ -216,7 +217,7 @@ public class OrderManagerEvents {
}
// create a payment record
- Map results = null;
+ Map<String, Object> results = null;
try {
results = dispatcher.runSync("createPaymentFromPreference", UtilMisc.toMap("userLogin", userLogin,
"orderPaymentPreferenceId", paymentPreference.get("orderPaymentPreferenceId"), "paymentRefNum", paymentReference,
@@ -238,7 +239,7 @@ public class OrderManagerEvents {
// get the current payment prefs
GenericValue offlineValue = null;
- List currentPrefs = null;
+ List<GenericValue> currentPrefs = null;
BigDecimal paymentTally = BigDecimal.ZERO;
try {
EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
@@ -250,9 +251,9 @@ public class OrderManagerEvents {
Debug.logError(e, "ERROR: Unable to get existing payment preferences from order", module);
}
if (UtilValidate.isNotEmpty(currentPrefs)) {
- Iterator cpi = currentPrefs.iterator();
+ Iterator<GenericValue> cpi = currentPrefs.iterator();
while (cpi.hasNext()) {
- GenericValue cp = (GenericValue) cpi.next();
+ GenericValue cp = cpi.next();
String paymentMethodType = cp.getString("paymentMethodTypeId");
if ("EXT_OFFLINE".equals(paymentMethodType)) {
offlineValue = cp;