Author: mthl
Date: Sat Jul 20 16:22:24 2019 New Revision: 1863492 URL: http://svn.apache.org/viewvc?rev=1863492&view=rev Log: Improved: Inline ‘UtilGenerics#checkList’ (OFBIZ-11141) Modified: ofbiz/ofbiz-plugins/trunk/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java ofbiz/ofbiz-plugins/trunk/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java ofbiz/ofbiz-plugins/trunk/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.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=1863492&r1=1863491&r2=1863492&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:22:24 2019 @@ -242,7 +242,7 @@ public class BirtMasterReportServices { String productCategoryId = (String) parameters.get("productCategoryId"); productCategoryList.add(productCategoryId); } else if (parameters.get("productStoreId") instanceof String) { - productCategoryList = UtilGenerics.checkList(parameters.get("productCategoryId")); + productCategoryList = UtilGenerics.cast(parameters.get("productCategoryId")); } // getting productIds in these categories EntityExpr conditionProductCategory = EntityCondition.makeCondition("primaryProductCategoryId", EntityOperator.IN, productCategoryList); @@ -266,7 +266,7 @@ public class BirtMasterReportServices { String productStoreId = (String) parameters.get("productStoreId"); productStoreList.add(productStoreId); } else if (parameters.get("productStoreId") instanceof List) { - productStoreList = UtilGenerics.checkList(parameters.get("productStoreId")); + productStoreList = UtilGenerics.cast(parameters.get("productStoreId")); } // getting list of invoice Ids linked to these productStore EntityExpr conditionProductStoreId = EntityCondition.makeCondition("productStoreId", EntityOperator.IN, productStoreList); 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=1863492&r1=1863491&r2=1863492&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:22:24 2019 @@ -125,7 +125,7 @@ public class EbayOrderServices { Locale locale = (Locale) context.get("locale"); Map<String, Object> result = new HashMap<>(); String externalId = (String) context.get("externalId"); - List<Map<String, Object>> orderList = UtilGenerics.checkList(context.get("orderList")); + List<Map<String, Object>> orderList = UtilGenerics.cast(context.get("orderList")); try { if (UtilValidate.isNotEmpty(orderList)) { Iterator<Map<String, Object>> orderListIter = orderList.iterator(); @@ -1047,7 +1047,7 @@ public class EbayOrderServices { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.paymentIsStillNotReceived", locale)); } - List<Map<String, Object>> orderItemList = UtilGenerics.checkList(context.get("orderItemList")); + List<Map<String, Object>> orderItemList = UtilGenerics.cast(context.get("orderItemList")); Iterator<Map<String, Object>> orderItemIter = orderItemList.iterator(); while (orderItemIter.hasNext()) { Map<String, Object> orderItem = orderItemIter.next(); Modified: ofbiz/ofbiz-plugins/trunk/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java?rev=1863492&r1=1863491&r2=1863492&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java (original) +++ ofbiz/ofbiz-plugins/trunk/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java Sat Jul 20 16:22:24 2019 @@ -41,7 +41,7 @@ public class Msg91Services { Delegator delegator = ctx.getDelegator(); Map<String, Object> result = ServiceUtil.returnSuccess(); - List<String> numbers = UtilGenerics.checkList(context.get("numbers")); + List<String> numbers = UtilGenerics.cast(context.get("numbers")); String message = (String) context.get("message"); try { Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java?rev=1863492&r1=1863491&r2=1863492&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java (original) +++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java Sat Jul 20 16:22:24 2019 @@ -155,7 +155,7 @@ public class PricatParseExcelHtmlThread try { getReport().print(UtilProperties.getMessage(resource, "StartStoreExcel", getLocale()), InterfaceReport.FORMAT_HEADLINE); ServletFileUpload dfu = new ServletFileUpload(new DiskFileItemFactory(10240, userFolder)); - fileItems = UtilGenerics.checkList(dfu.parseRequest(request)); + fileItems = UtilGenerics.cast(dfu.parseRequest(request)); } catch (FileUploadException e) { getReport().addError(e); } Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java?rev=1863492&r1=1863491&r2=1863492&view=diff ============================================================================== --- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java (original) +++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java Sat Jul 20 16:22:24 2019 @@ -209,7 +209,7 @@ public abstract class SolrProductSearch Collection<SolrInputDocument> docs = new ArrayList<>(); // Construct Documents - List<Map<String, Object>> fieldList = UtilGenerics.<Map<String, Object>> checkList(context.get("fieldList")); + List<Map<String, Object>> fieldList = UtilGenerics.cast(context.get("fieldList")); Debug.logInfo("Solr: Generating and adding " + fieldList.size() + " documents to solr index", module); 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=1863492&r1=1863491&r2=1863492&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:22:24 2019 @@ -169,7 +169,7 @@ public final class SolrUtil { // add catalog if (context.get("catalog") != null) { - List<String> catalog = UtilGenerics.<String>checkList(context.get("catalog")); + List<String> catalog = UtilGenerics.cast(context.get("catalog")); for (String c : catalog) { doc1.addField("catalog", c); } @@ -177,7 +177,7 @@ public final class SolrUtil { // add categories if (context.get("category") != null) { - List<String> category = UtilGenerics.<String>checkList(context.get("category")); + List<String> category = UtilGenerics.cast(context.get("category")); Iterator<String> catIter = category.iterator(); while (catIter.hasNext()) { String cat = catIter.next(); @@ -197,7 +197,7 @@ public final class SolrUtil { // add attributes if (context.get("attributes") != null) { - List<String> attributes = UtilGenerics.<String>checkList(context.get("attributes")); + List<String> attributes = UtilGenerics.cast(context.get("attributes")); Iterator<String> attrIter = attributes.iterator(); while (attrIter.hasNext()) { String attr = attrIter.next(); |
Free forum by Nabble | Edit this page |