svn commit: r1863491 - in /ofbiz/ofbiz-plugins/trunk: birt/src/main/java/org/apache/ofbiz/birt/flexible/ ebay/src/main/java/org/apache/ofbiz/ebay/ solr/src/main/java/org/apache/ofbiz/solr/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1863491 - in /ofbiz/ofbiz-plugins/trunk: birt/src/main/java/org/apache/ofbiz/birt/flexible/ ebay/src/main/java/org/apache/ofbiz/ebay/ solr/src/main/java/org/apache/ofbiz/solr/

mthl
Author: mthl
Date: Sat Jul 20 16:21:23 2019
New Revision: 1863491

URL: http://svn.apache.org/viewvc?rev=1863491&view=rev
Log:
Improved: Inline ‘UtilGenerics#checkMap’
(OFBIZ-11141)

Modified:
    ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java
    ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java
    ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java
    ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java
    ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java

Modified: ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java?rev=1863491&r1=1863490&r2=1863491&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java (original)
+++ ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java Sat Jul 20 16:21:23 2019
@@ -89,7 +89,7 @@ public class BirtMasterReportServices {
     public static Map<String, Object> workEffortPerPerson(DispatchContext dctx, Map<String, Object> context) {
         Delegator delegator = dctx.getDelegator();
         IReportContext reportContext = (IReportContext) context.get("reportContext");
-        Map<String, Object> parameters = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
+        Map<String, Object> parameters = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
         List<GenericValue> listWorkEffortTime = null;
 
         if (UtilValidate.isEmpty(parameters.get("firstName")) && UtilValidate.isEmpty(parameters.get("lastName"))) {
@@ -211,7 +211,7 @@ public class BirtMasterReportServices {
         Delegator delegator = dctx.getDelegator();
         Locale locale = (Locale) context.get("locale");
         IReportContext reportContext = (IReportContext) context.get("reportContext");
-        Map<String, Object> parameters = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
+        Map<String, Object> parameters = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
 
         List<GenericValue> listTurnOver = null;
         List<Map<String, Object>> listInvoiceEditable = new ArrayList<>();
@@ -328,7 +328,7 @@ public class BirtMasterReportServices {
 
             // adding missing fields
             for (GenericValue invoice : listTurnOver) {
-                Map<String, Object> invoiceEditableTemp = UtilGenerics.checkMap(invoice.clone());
+                Map<String, Object> invoiceEditableTemp = UtilGenerics.cast(invoice.clone());
                 invoiceEditableTemp.remove("GenericEntity");
                 Map<String, Object> invoiceEditable = new HashMap<>();
                 invoiceEditable.putAll(invoiceEditableTemp);

Modified: ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java?rev=1863491&r1=1863490&r2=1863491&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java (original)
+++ ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java Sat Jul 20 16:21:23 2019
@@ -170,7 +170,7 @@ public class BirtServices {
         Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String entityViewName = (String) reportContext.getParameterValue("modelElementName");
-        Map<String, Object> inputFields = UtilGenerics.checkMap(reportContext.getParameterValue("parameters"));
+        Map<String, Object> inputFields = UtilGenerics.cast(reportContext.getParameterValue("parameters"));
         Map<String, Object> resultPerformFind = new HashMap<>();
         Map<String, Object> resultToBirt = null;
         List<GenericValue> list = null;
@@ -353,18 +353,18 @@ public class BirtServices {
             if (ServiceUtil.isError(resultMapsForGeneration)) {
                 return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultMapsForGeneration));
             }
-            Map<String, String> dataMap = UtilGenerics.checkMap(resultMapsForGeneration.get("dataMap"));
+            Map<String, String> dataMap = UtilGenerics.cast(resultMapsForGeneration.get("dataMap"));
             Map<String, String> fieldDisplayLabels = null;
             if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("fieldDisplayLabels"))) {
-                fieldDisplayLabels = UtilGenerics.checkMap(resultMapsForGeneration.get("fieldDisplayLabels"));
+                fieldDisplayLabels = UtilGenerics.cast(resultMapsForGeneration.get("fieldDisplayLabels"));
             }
             Map<String, String> filterMap = null;
             if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("filterMap"))) {
-                filterMap = UtilGenerics.checkMap(resultMapsForGeneration.get("filterMap"));
+                filterMap = UtilGenerics.cast(resultMapsForGeneration.get("filterMap"));
             }
             Map<String, String> filterDisplayLabels = null;
             if (UtilValidate.isNotEmpty(resultMapsForGeneration.get("filterDisplayLabels"))) {
-                filterDisplayLabels = UtilGenerics.checkMap(resultMapsForGeneration.get("filterDisplayLabels"));
+                filterDisplayLabels = UtilGenerics.cast(resultMapsForGeneration.get("filterDisplayLabels"));
             }
             contentId = BirtWorker.recordReportContent(delegator, dispatcher, context);
             // callPerformFindFromBirt is the customMethod for Entity workflow
@@ -438,10 +438,10 @@ public class BirtServices {
             if (ServiceUtil.isError(serviceResult)) {
                 return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
             }
-            Map<String, String> dataMap = UtilGenerics.checkMap(serviceResult.get("dataMap"));
-            Map<String, String> filterMap = UtilGenerics.checkMap(serviceResult.get("filterMap"));
-            Map<String, String> fieldDisplayLabels = UtilGenerics.checkMap(serviceResult.get("fieldDisplayLabels"));
-            Map<String, String> filterDisplayLabels = UtilGenerics.checkMap(serviceResult.get("filterDisplayLabels"));
+            Map<String, String> dataMap = UtilGenerics.cast(serviceResult.get("dataMap"));
+            Map<String, String> filterMap = UtilGenerics.cast(serviceResult.get("filterMap"));
+            Map<String, String> fieldDisplayLabels = UtilGenerics.cast(serviceResult.get("fieldDisplayLabels"));
+            Map<String, String> filterDisplayLabels = UtilGenerics.cast(serviceResult.get("filterDisplayLabels"));
             Map<String, Object> resultGeneration = dispatcher.runSync("createFlexibleReport", UtilMisc.toMap(
                     "locale", locale,
                     "dataMap", dataMap,

Modified: ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java?rev=1863491&r1=1863490&r2=1863491&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java (original)
+++ ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java Sat Jul 20 16:21:23 2019
@@ -85,10 +85,10 @@ public class ReportDesignGenerator {
 
     public ReportDesignGenerator(Map<String, Object> context, DispatchContext dctx) throws GeneralException, SemanticException {
         locale = (Locale) context.get("locale");
-        dataMap = UtilGenerics.checkMap(context.get("dataMap"));
+        dataMap = UtilGenerics.cast(context.get("dataMap"));
         filterMap = UtilGenerics.cast(context.get("filterMap"));
         serviceName = (String) context.get("serviceName");
-        fieldDisplayLabels = UtilGenerics.checkMap(context.get("fieldDisplayLabels"));
+        fieldDisplayLabels = UtilGenerics.cast(context.get("fieldDisplayLabels"));
         filterDisplayLabels = UtilGenerics.cast(context.get("filterDisplayLabels"));
         rptDesignName = (String) context.get("rptDesignName");
         String writeFilters = (String) context.get("writeFilters");

Modified: ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java?rev=1863491&r1=1863490&r2=1863491&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java (original)
+++ ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java Sat Jul 20 16:21:23 2019
@@ -1059,7 +1059,7 @@ public class EbayOrderServices {
                 cart.setBillFromVendorPartyId(payToPartyId);
             }
             // Apply shipping costs as order adjustment
-            Map<String, Object> shippingServiceSelectedCtx =  UtilGenerics.checkMap(context.get("shippingServiceSelectedCtx"));
+            Map<String, Object> shippingServiceSelectedCtx =  UtilGenerics.cast(context.get("shippingServiceSelectedCtx"));
 
             String shippingCost = (String) shippingServiceSelectedCtx.get("shippingServiceCost");
             if (UtilValidate.isNotEmpty(shippingCost)) {
@@ -1083,7 +1083,7 @@ public class EbayOrderServices {
                 }
             }
             // Apply sales tax as order adjustment
-            Map<String, Object> shippingDetailsCtx = UtilGenerics.checkMap(context.get("shippingDetailsCtx"));
+            Map<String, Object> shippingDetailsCtx = UtilGenerics.cast(context.get("shippingDetailsCtx"));
             String salesTaxAmount = (String) shippingDetailsCtx.get("salesTaxAmount");
             String salesTaxPercent = (String) shippingDetailsCtx.get("salesTaxPercent");
             if (UtilValidate.isNotEmpty(salesTaxAmount)) {
@@ -1106,7 +1106,7 @@ public class EbayOrderServices {
                 String partyId = null;
                 String contactMechId = null;
 
-                Map<String, Object> shippingAddressCtx = UtilGenerics.checkMap(context.get("shippingAddressCtx"));
+                Map<String, Object> shippingAddressCtx = UtilGenerics.cast(context.get("shippingAddressCtx"));
                 if (UtilValidate.isNotEmpty(shippingAddressCtx)) {
                     String buyerName = (String) shippingAddressCtx.get("buyerName");
                     String firstName = buyerName.substring(0, buyerName.indexOf(" "));
@@ -1171,7 +1171,7 @@ public class EbayOrderServices {
 
                 // create new party's contact information
                 if (UtilValidate.isEmpty(contactMechId)) {
-                    Map<String, Object> buyerCtx = UtilGenerics.checkMap(context.get("buyerCtx"));
+                    Map<String, Object> buyerCtx = UtilGenerics.cast(context.get("buyerCtx"));
                     String eiasTokenBuyer = null;
                     if (UtilValidate.isNotEmpty(buyerCtx)) {
                         eiasTokenBuyer = (String) buyerCtx.get("eiasTokenBuyer");

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java?rev=1863491&r1=1863490&r2=1863491&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java Sat Jul 20 16:21:23 2019
@@ -207,7 +207,7 @@ public final class SolrUtil {
 
         // add title
         if (context.get("title") != null) {
-            Map<String, String> title = UtilGenerics.<String, String>checkMap(context.get("title"));
+            Map<String, String> title = UtilGenerics.cast(context.get("title"));
             for (Map.Entry<String, String> entry : title.entrySet()) {
                 doc1.addField("title_i18n_" + entry.getKey(), entry.getValue());
             }
@@ -215,7 +215,7 @@ public final class SolrUtil {
 
         // add short_description
         if (context.get("description") != null) {
-            Map<String, String> description = UtilGenerics.<String, String>checkMap(context.get("description"));
+            Map<String, String> description = UtilGenerics.cast(context.get("description"));
             for (Map.Entry<String, String> entry : description.entrySet()) {
                 doc1.addField("description_i18n_" + entry.getKey(), entry.getValue());
             }
@@ -223,7 +223,7 @@ public final class SolrUtil {
 
         // add short_description
         if (context.get("longDescription") != null) {
-            Map<String, String> longDescription = UtilGenerics.<String, String>checkMap(context.get("longDescription"));
+            Map<String, String> longDescription = UtilGenerics.cast(context.get("longDescription"));
             for (Map.Entry<String, String> entry : longDescription.entrySet()) {
                 doc1.addField("longdescription_i18n_" + entry.getKey(), entry.getValue());
             }