Author: mrisaliti
Date: Sun Jan 30 07:50:20 2011
New Revision: 1065211

URL: http://svn.apache.org/viewvc?rev=1065211&view=rev
Log:
Remove java compilation warnings of OrderChangeHelper (OFBIZ-4102)

Modified:
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java

Modified: 
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java?rev=1065211&r1=1065210&r2=1065211&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java 
(original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java 
Sun Jan 30 07:50:20 2011
@@ -152,18 +152,18 @@ public class OrderChangeHelper {
 
     public static void orderStatusChanges(LocalDispatcher dispatcher, 
GenericValue userLogin, String orderId, String orderStatus, String 
fromItemStatus, String toItemStatus, String digitalItemStatus) throws 
GenericServiceException {
         // set the status on the order header
-        Map statusFields = UtilMisc.toMap("orderId", orderId, "statusId", 
orderStatus, "userLogin", userLogin);
-        Map statusResult = dispatcher.runSync("changeOrderStatus", 
statusFields);
+        Map<String, Object> statusFields = UtilMisc.<String, 
Object>toMap("orderId", orderId, "statusId", orderStatus, "userLogin", 
userLogin);
+        Map<String, Object> statusResult = 
dispatcher.runSync("changeOrderStatus", statusFields);
         if (statusResult.containsKey(ModelService.ERROR_MESSAGE)) {
             Debug.logError("Problems adjusting order header status for order 
#" + orderId, module);
         }
 
         // set the status on the order item(s)
-        Map itemStatusFields = UtilMisc.toMap("orderId", orderId, "statusId", 
toItemStatus, "userLogin", userLogin);
+        Map<String, Object> itemStatusFields = UtilMisc.<String, 
Object>toMap("orderId", orderId, "statusId", toItemStatus, "userLogin", 
userLogin);
         if (fromItemStatus != null) {
             itemStatusFields.put("fromStatusId", fromItemStatus);
         }
-        Map itemStatusResult = dispatcher.runSync("changeOrderItemStatus", 
itemStatusFields);
+        Map<String, Object> itemStatusResult = 
dispatcher.runSync("changeOrderItemStatus", itemStatusFields);
         if (itemStatusResult.containsKey(ModelService.ERROR_MESSAGE)) {
             Debug.logError("Problems adjusting order item status for order #" 
+ orderId, module);
         }
@@ -178,16 +178,16 @@ public class OrderChangeHelper {
                 Debug.logError(e, "ERROR: Unable to get OrderHeader for 
OrderID : " + orderId, module);
             }
             if (orderHeader != null) {
-                List orderItems = null;
+                List<GenericValue> orderItems = null;
                 try {
                     orderItems = orderHeader.getRelated("OrderItem");
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "ERROR: Unable to get OrderItem records 
for OrderHeader : " + orderId, module);
                 }
                 if (UtilValidate.isNotEmpty(orderItems)) {
-                    Iterator oii = orderItems.iterator();
+                    Iterator<GenericValue> oii = orderItems.iterator();
                     while (oii.hasNext()) {
-                        GenericValue orderItem = (GenericValue) oii.next();
+                        GenericValue orderItem = oii.next();
                         String orderItemSeqId = 
orderItem.getString("orderItemSeqId");
                         GenericValue product = null;
 
@@ -207,8 +207,8 @@ public class OrderChangeHelper {
                                 String isDigital = 
productType.getString("isDigital");
                                 if (isDigital != null && 
"Y".equalsIgnoreCase(isDigital)) {
                                     // update the status
-                                    Map digitalStatusFields = 
UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, 
"statusId", digitalItemStatus, "userLogin", userLogin);
-                                    Map digitalStatusChange = 
dispatcher.runSync("changeOrderItemStatus", digitalStatusFields);
+                                    Map<String, Object> digitalStatusFields = 
UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", 
orderItemSeqId, "statusId", digitalItemStatus, "userLogin", userLogin);
+                                    Map<String, Object> digitalStatusChange = 
dispatcher.runSync("changeOrderItemStatus", digitalStatusFields);
                                     if 
(ModelService.RESPOND_ERROR.equals(digitalStatusChange.get(ModelService.RESPONSE_MESSAGE)))
 {
                                         Debug.logError("Problems with digital 
product status change : " + product, module);
                                     }
@@ -218,8 +218,8 @@ public class OrderChangeHelper {
                             String orderItemType = 
orderItem.getString("orderItemTypeId");
                             if (!"PRODUCT_ORDER_ITEM".equals(orderItemType)) {
                                 // non-product items don't ship; treat as a 
digital item
-                                Map digitalStatusFields = 
UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, 
"statusId", digitalItemStatus, "userLogin", userLogin);
-                                Map digitalStatusChange = 
dispatcher.runSync("changeOrderItemStatus", digitalStatusFields);
+                                Map<String, Object> digitalStatusFields = 
UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", 
orderItemSeqId, "statusId", digitalItemStatus, "userLogin", userLogin);
+                                Map<String, Object> digitalStatusChange = 
dispatcher.runSync("changeOrderItemStatus", digitalStatusFields);
                                 if 
(ModelService.RESPOND_ERROR.equals(digitalStatusChange.get(ModelService.RESPONSE_MESSAGE)))
 {
                                     Debug.logError("Problems with digital 
product status change : " + product, module);
                                 }
@@ -233,16 +233,16 @@ public class OrderChangeHelper {
 
     public static void cancelInventoryReservations(LocalDispatcher dispatcher, 
GenericValue userLogin, String orderId) throws GenericServiceException {
         // cancel the inventory reservations
-        Map cancelInvFields = UtilMisc.toMap("orderId", orderId, "userLogin", 
userLogin);
-        Map cancelInvResult = 
dispatcher.runSync("cancelOrderInventoryReservation", cancelInvFields);
+        Map<String, Object> cancelInvFields = UtilMisc.<String, 
Object>toMap("orderId", orderId, "userLogin", userLogin);
+        Map<String, Object> cancelInvResult = 
dispatcher.runSync("cancelOrderInventoryReservation", cancelInvFields);
         if 
(ModelService.RESPOND_ERROR.equals(cancelInvResult.get(ModelService.RESPONSE_MESSAGE)))
 {
             Debug.logError("Problems reversing inventory reservations for 
order #" + orderId, module);
         }
     }
 
     public static void releasePaymentAuthorizations(LocalDispatcher 
dispatcher, GenericValue userLogin, String orderId) throws 
GenericServiceException {
-        Map releaseFields = UtilMisc.toMap("orderId", orderId, "userLogin", 
userLogin);
-        Map releaseResult = dispatcher.runSync("releaseOrderPayments", 
releaseFields);
+        Map<String, Object> releaseFields = UtilMisc.<String, 
Object>toMap("orderId", orderId, "userLogin", userLogin);
+        Map<String, Object> releaseResult = 
dispatcher.runSync("releaseOrderPayments", releaseFields);
         if 
(ModelService.RESPOND_ERROR.equals(releaseResult.get(ModelService.RESPONSE_MESSAGE)))
 {
             Debug.logError("Problems releasing payment authorizations for 
order #" + orderId, module);
         }
@@ -263,15 +263,15 @@ public class OrderChangeHelper {
                 partyId = btparty.getString("partyId");
             }
 
-            List opps = orh.getPaymentPreferences();
-            Iterator oppi = opps.iterator();
+            List<GenericValue> opps = orh.getPaymentPreferences();
+            Iterator<GenericValue> oppi = opps.iterator();
             while (oppi.hasNext()) {
-                GenericValue opp = (GenericValue) oppi.next();
+                GenericValue opp = oppi.next();
                 if ("PAYMENT_RECEIVED".equals(opp.getString("statusId"))) {
-                    List payments = orh.getOrderPayments(opp);
+                    List<GenericValue> payments = orh.getOrderPayments(opp);
                     if (UtilValidate.isEmpty(payments)) {
                         // only do this one time; if we have payment already 
for this pref ignore.
-                        Map results = 
dispatcher.runSync("createPaymentFromPreference",
+                        Map<String, Object> results = 
dispatcher.runSync("createPaymentFromPreference",
                                 UtilMisc.<String, Object>toMap("userLogin", 
userLogin, "orderPaymentPreferenceId", 
opp.getString("orderPaymentPreferenceId"),
                                 "paymentRefNum",  
UtilDateTime.nowTimestamp().toString(), "paymentFromId", partyId));
                         if 
(results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) 
{
@@ -292,10 +292,10 @@ public class OrderChangeHelper {
         }
         if (orderHeader != null) {
             OrderReadHelper orh = new OrderReadHelper(orderHeader);
-            List items = orh.getOrderItems();
+            List<GenericValue> items = orh.getOrderItems();
 
-            Map serviceParam = UtilMisc.toMap("orderId", orderId, "billItems", 
items, "userLogin", userLogin);
-            Map serviceRes = dispatcher.runSync("createInvoiceForOrder", 
serviceParam);
+            Map<String, Object> serviceParam = UtilMisc.<String, 
Object>toMap("orderId", orderId, "billItems", items, "userLogin", userLogin);
+            Map<String, Object> serviceRes = 
dispatcher.runSync("createInvoiceForOrder", serviceParam);
             if (ServiceUtil.isError(serviceRes)) {
                 throw new 
GenericServiceException(ServiceUtil.getErrorMessage(serviceRes));
             }


Reply via email to