Skip to content
Permalink
Browse files

Improved: Inline ‘UtilGenerics#checkList’

(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863501 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jul 20, 2019
1 parent 83fd206 commit e9a56a78e572ff3d228e724b4fb25e293927f244
Showing with 268 additions and 276 deletions.
  1. +10 −10 applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java
  2. +1 −1 applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/BillingAccountWorker.java
  3. +1 −1 ...ications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
  4. +5 −5 applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
  5. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
  6. +6 −6 applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
  7. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
  8. +3 −3 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
  9. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java
  10. +5 −5 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
  11. +4 −4 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
  12. +12 −12 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
  13. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java
  14. +6 −6 applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java
  15. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
  16. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java
  17. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutWorker.java
  18. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/output/OutputServices.java
  19. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
  20. +1 −1 ...content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
  21. +1 −1 ...ations/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
  22. +4 −4 ...ns/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java
  23. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
  24. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java
  25. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentAsText.java
  26. +2 −2 ...ons/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
  27. +4 −4 ...s/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
  28. +3 −3 ...ations/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
  29. +1 −1 ...tions/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
  30. +1 −1 applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
  31. +9 −9 applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java
  32. +4 −4 .../manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
  33. +2 −2 applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
  34. +2 −2 applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
  35. +7 −7 applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java
  36. +32 −32 applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
  37. +6 −6 applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
  38. +1 −1 applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
  39. +3 −3 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
  40. +6 −6 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
  41. +3 −3 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
  42. +6 −6 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
  43. +5 −5 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
  44. +1 −1 applications/order/src/main/java/org/apache/ofbiz/order/test/OrderTestServices.java
  45. +3 −3 applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/zipsales/ZipSalesServices.java
  46. +1 −1 applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java
  47. +2 −2 applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
  48. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryWorker.java
  49. +6 −6 applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java
  50. +2 −2 applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java
  51. +4 −4 applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
  52. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
  53. +4 −4 applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
  54. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java
  55. +2 −2 applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
  56. +2 −2 applications/product/src/main/java/org/apache/ofbiz/shipment/picklist/PickListServices.java
  57. +1 −1 applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
  58. +2 −2 applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
  59. +2 −2 applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java
  60. +1 −1 applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServicesTests.java
  61. +1 −1 ...ions/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortSearchSession.java
  62. +4 −4 applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
  63. +0 −5 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java
  64. +1 −1 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
  65. +2 −2 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
  66. +2 −4 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilPlist.java
  67. +8 −8 framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleServletAccessor.java
  68. +3 −3 framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
  69. +2 −2 framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
  70. +4 −4 framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
  71. +2 −2 framework/common/src/main/java/org/apache/ofbiz/common/scripting/ContextHelper.java
  72. +3 −3 framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java
  73. +1 −1 framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java
  74. +2 −3 framework/entityext/src/main/java/org/apache/ofbiz/entityext/permission/EntityPermissionChecker.java
  75. +4 −4 framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java
  76. +1 −1 framework/minilang/src/main/java/org/apache/ofbiz/minilang/method/callops/CallService.java
  77. +5 −5 framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java
  78. +3 −3 framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaAction.java
  79. +1 −1 framework/testtools/src/main/java/org/apache/ofbiz/testtools/ServiceTest.java
  80. +2 −2 framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
  81. +1 −1 framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceMultiEventHandler.java
  82. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
  83. +2 −2 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java
  84. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java
  85. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
@@ -161,7 +161,7 @@
}

String orderId = (String) context.get("orderId");
List<GenericValue> billItems = UtilGenerics.checkList(context.get("billItems"));
List<GenericValue> billItems = UtilGenerics.cast(context.get("billItems"));
String invoiceId = (String) context.get("invoiceId");

if (UtilValidate.isEmpty(billItems)) {
@@ -916,11 +916,11 @@
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
List<String> salesInvoiceIds = UtilGenerics.checkList(context.get("invoiceIds"));
List<String> salesInvoiceIds = UtilGenerics.cast(context.get("invoiceIds"));
List<Map<String, String>> invoicesCreated = new LinkedList<>();
Map<String, List<Map<String, Object>>> commissionParties = new HashMap<>();
for (String salesInvoiceId : salesInvoiceIds) {
List<String> salesRepPartyIds = UtilGenerics.checkList(context.get("partyIds"));
List<String> salesRepPartyIds = UtilGenerics.cast(context.get("partyIds"));
BigDecimal amountTotal = InvoiceWorker.getInvoiceTotal(delegator, salesInvoiceId);
if (amountTotal.signum() == 0) {
Debug.logWarning("Invoice [" + salesInvoiceId + "] has an amount total of [" + amountTotal + "], so no commission invoice will be created", module);
@@ -952,7 +952,7 @@
} else {
List<String> salesInvoiceRolePartyIds = EntityUtil.getFieldListFromEntityList(roleQuery.where(invoiceRoleConds).queryList(), "partyId", true);
if (UtilValidate.isNotEmpty(salesInvoiceRolePartyIds)) {
salesRepPartyIds = UtilGenerics.checkList(CollectionUtils.intersection(salesRepPartyIds, salesInvoiceRolePartyIds));
salesRepPartyIds = UtilGenerics.cast(CollectionUtils.intersection(salesRepPartyIds, salesInvoiceRolePartyIds));
}
}
invoice = EntityQuery.use(delegator).from("Invoice").where("invoiceId", salesInvoiceId).queryOne();
@@ -998,7 +998,7 @@
}
// build a Map of partyIds (both to and from) in a commission and the amounts
// Note that getCommissionForProduct returns a List of Maps with a lot values. See services.xml definition for reference.
List<Map<String, Object>> itemCommissions = UtilGenerics.checkList(resultMap.get("commissions"));
List<Map<String, Object>> itemCommissions = UtilGenerics.cast(resultMap.get("commissions"));
if (UtilValidate.isNotEmpty(itemCommissions)) {
for (Map<String, Object> commissionMap : itemCommissions) {
commissionMap.put("invoice", invoice);
@@ -1150,7 +1150,7 @@
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
// Get invoices to make ready
List<String> invoicesCreated = UtilGenerics.checkList(context.get("invoicesCreated"));
List<String> invoicesCreated = UtilGenerics.cast(context.get("invoicesCreated"));
String nextStatusId = "INVOICE_READY";
try {
for (String invoiceId : invoicesCreated) {
@@ -1211,7 +1211,7 @@
"AccountingTroubleCallingCreateInvoicesFromShipmentService",
UtilMisc.toMap("shipmentId", shipmentId), locale));
}
invoicesCreated = UtilGenerics.checkList(result.get("invoicesCreated"));
invoicesCreated = UtilGenerics.cast(result.get("invoicesCreated"));
} catch (GenericServiceException e) {
Debug.logError(e, "Trouble calling createInvoicesFromShipment service; invoice not created for shipment [" + shipmentId + "]", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
@@ -1344,7 +1344,7 @@
public static Map<String, Object> createInvoicesFromShipments(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
List<String> shipmentIds = UtilGenerics.checkList(context.get("shipmentIds"));
List<String> shipmentIds = UtilGenerics.cast(context.get("shipmentIds"));
Locale locale = (Locale) context.get("locale");
Boolean createSalesInvoicesForDropShipments = (Boolean) context.get("createSalesInvoicesForDropShipments");
if (UtilValidate.isEmpty(createSalesInvoicesForDropShipments)) {
@@ -1717,7 +1717,7 @@
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"AccountingTroubleCallingCalcTaxService", locale));
}
List<GenericValue> orderAdjustments = UtilGenerics.checkList(calcTaxResult.get("orderAdjustments"));
List<GenericValue> orderAdjustments = UtilGenerics.cast(calcTaxResult.get("orderAdjustments"));

// If we have any OrderAdjustments due to tax on shipping, store them and add them to the total
if (orderAdjustments != null) {
@@ -2006,7 +2006,7 @@ private static String getInvoiceItemType(Delegator delegator, String key1, Strin
Locale locale = (Locale) context.get("locale");

String returnId= (String) context.get("returnId");
List<GenericValue> billItems = UtilGenerics.checkList(context.get("billItems"));
List<GenericValue> billItems = UtilGenerics.cast(context.get("billItems"));
String errorMsg = UtilProperties.getMessage(resource, "AccountingErrorCreatingInvoiceForReturn",UtilMisc.toMap("returnId",returnId),locale);
// List invoicesCreated = new ArrayList();
try {
@@ -66,7 +66,7 @@
if (ServiceUtil.isError(agentResult)) {
throw new GeneralException("Error while finding party BillingAccounts when getting Customers that this party is an agent of: " + ServiceUtil.getErrorMessage(agentResult));
}
List<String> relatedPartyIdList = UtilGenerics.checkList(agentResult.get("relatedPartyIdList"));
List<String> relatedPartyIdList = UtilGenerics.cast(agentResult.get("relatedPartyIdList"));

List<GenericValue> billingAccountRoleList = EntityQuery.use(delegator).from("BillingAccountRole")
.where(EntityCondition.makeCondition("partyId", EntityOperator.IN, relatedPartyIdList),
@@ -407,7 +407,7 @@
hadError += 1;
}
if (results.get("messages") != null) {
List<String> message = UtilGenerics.checkList(results.get("messages"));
List<String> message = UtilGenerics.cast(results.get("messages"));
messages.addAll(message);
}
if (results.get("processAmount") != null) {
@@ -169,11 +169,11 @@
String facilityId = (String) context.get("facilityId");
String payToPartyId = (String) context.get("payToPartyId");
String billToPartyId = (String) context.get("billToPartyId");
List<GenericValue> itemProductList = UtilGenerics.checkList(context.get("itemProductList"));
List<BigDecimal> itemAmountList = UtilGenerics.checkList(context.get("itemAmountList"));
List<BigDecimal> itemPriceList = UtilGenerics.checkList(context.get("itemPriceList"));
List<BigDecimal> itemQuantityList = UtilGenerics.checkList(context.get("itemQuantityList"));
List<BigDecimal> itemShippingList = UtilGenerics.checkList(context.get("itemShippingList"));
List<GenericValue> itemProductList = UtilGenerics.cast(context.get("itemProductList"));
List<BigDecimal> itemAmountList = UtilGenerics.cast(context.get("itemAmountList"));
List<BigDecimal> itemPriceList = UtilGenerics.cast(context.get("itemPriceList"));
List<BigDecimal> itemQuantityList = UtilGenerics.cast(context.get("itemQuantityList"));
List<BigDecimal> itemShippingList = UtilGenerics.cast(context.get("itemShippingList"));
BigDecimal orderShippingAmount = (BigDecimal) context.get("orderShippingAmount");
BigDecimal orderPromotionsAmount = (BigDecimal) context.get("orderPromotionsAmount");
GenericValue shippingAddress = (GenericValue) context.get("shippingAddress");
@@ -218,7 +218,7 @@ public static String updatePublishLinks(HttpServletRequest request, HttpServletR
for (Object [] arr : origPublishedLinkList) {
String contentId = (String)arr[0]; // main (2nd level) site id
String origSubContentId = null;
List<Object []> origSubList = UtilGenerics.checkList(arr[1]);
List<Object []> origSubList = UtilGenerics.cast(arr[1]);
Timestamp origFromDate = null;
for (Object [] pubArr : origSubList) {
Timestamp fromDate = (Timestamp)pubArr[2];
@@ -77,7 +77,7 @@
String mapKey = (String) context.get("mapKey");
GenericValue userLogin = (GenericValue)context.get("userLogin");
Timestamp fromDate = (Timestamp)context.get("fromDate");
List<String> assocTypes = UtilGenerics.checkList(context.get("assocTypes"));
List<String> assocTypes = UtilGenerics.cast(context.get("assocTypes"));
String assocTypesString = (String)context.get("assocTypesString");
if (UtilValidate.isNotEmpty(assocTypesString)) {
List<String> lst = StringUtil.split(assocTypesString, "|");
@@ -155,7 +155,7 @@
if (Debug.infoOn()) Debug.logInfo("in persist... mapKey(0):" + mapKey, module);

// ContentPurposes can get passed in as a delimited string or a list. Combine.
List<String> contentPurposeList = UtilGenerics.checkList(context.get("contentPurposeList"));
List<String> contentPurposeList = UtilGenerics.cast(context.get("contentPurposeList"));
if (contentPurposeList == null) {
contentPurposeList = new LinkedList<>();
}
@@ -829,7 +829,7 @@ public static void addRoleToUser(Delegator delegator, LocalDispatcher dispatcher
seqInc = 100;
}
int seqIncrement = seqInc;
List<String> typeList = UtilGenerics.checkList(context.get("typeList"));
List<String> typeList = UtilGenerics.cast(context.get("typeList"));
if (typeList == null) {
typeList = new LinkedList<>();
}
@@ -961,7 +961,7 @@ public static void addRoleToUser(Delegator delegator, LocalDispatcher dispatcher
public static Map<String, Object> updateLeafCount(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = new HashMap<>();
Delegator delegator = dctx.getDelegator();
List<String> typeList = UtilGenerics.checkList(context.get("typeList"));
List<String> typeList = UtilGenerics.cast(context.get("typeList"));
if (typeList == null) {
typeList = UtilMisc.toList("PUBLISH_LINK", "SUB_CONTENT");
}
@@ -1518,7 +1518,7 @@ public static String updateTypeAndFile(GenericValue dataResource, Map<String, Ob
public static Map<String, Object> followNodeChildrenMethod(GenericValue content, LocalDispatcher dispatcher, String serviceName, Map<String, Object> context) throws GenericEntityException, GenericServiceException {
Map<String, Object> result = null;
String contentId = content.getString("contentId");
List<String> contentAssocTypeIdList = UtilGenerics.checkList(context.get("contentAssocTypeIdList"));
List<String> contentAssocTypeIdList = UtilGenerics.cast(context.get("contentAssocTypeIdList"));
Locale locale = (Locale) context.get("locale");
Set<String> visitedSet = UtilGenerics.cast(context.get("visitedSet"));
if (visitedSet == null) {
@@ -1587,7 +1587,7 @@ public static String updateTypeAndFile(GenericValue dataResource, Map<String, Ob
if (ServiceUtil.isError(traversResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(traversResult));
}
parentList = UtilGenerics.checkList(traversResult.get("parentList"));
parentList = UtilGenerics.cast(traversResult.get("parentList"));
} else {
parentList.add(masterRevisionContentId);
}
@@ -507,7 +507,7 @@ public static GenericValue getStaticValue(Delegator delegator, String parentPlac
subArr[3] = contentAssoc.get("fromDate");
} else {
if (subArr != null) {
List<Object []> subPointList = UtilGenerics.checkList(subArr[1]);
List<Object []> subPointList = UtilGenerics.cast(subArr[1]);
Iterator<Object []> it5 = subPointList.iterator();
Object [] subArr2 = null;
while (it5.hasNext()) {
@@ -537,7 +537,7 @@ public static GenericValue getAuthorContent(Delegator delegator, String contentI
// TODO check if we want contentTypes to be filled/used, else this should be removed
List<String> contentTypes = null;
Map<String, Object> results = ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator, contentId, null, "To", null, null, assocTypes, contentTypes, Boolean.TRUE, null, null);
List<GenericValue> valueList = UtilGenerics.checkList(results.get("entityList"));
List<GenericValue> valueList = UtilGenerics.cast(results.get("entityList"));
if (valueList.size() > 0) {
GenericValue value = valueList.get(0);
authorContent = delegator.makeValue("Content");
@@ -140,7 +140,7 @@ public ContentPermissionServices() {}
// I realized, belatedly, that I wanted to be able to pass parameters in as
// strings so this service could be used in an action event directly,
// so I had to write this code to handle both list and strings
List<String> passedPurposes = UtilGenerics.checkList(context.get("contentPurposeList"));
List<String> passedPurposes = UtilGenerics.cast(context.get("contentPurposeList"));
String contentPurposeString = (String) context.get("contentPurposeString");
if (UtilValidate.isNotEmpty(contentPurposeString)) {
List<String> purposesFromString = StringUtil.split(contentPurposeString, "|");
@@ -154,7 +154,7 @@ public ContentPermissionServices() {}
// Sometimes permissions need to be checked before an entity is created, so
// there needs to be a method for setting a purpose list
auxGetter.setList(passedPurposes);
List<String> targetOperations = UtilGenerics.checkList(context.get("targetOperationList"));
List<String> targetOperations = UtilGenerics.cast(context.get("targetOperationList"));
String targetOperationString = (String) context.get("targetOperationString");
if (UtilValidate.isNotEmpty(targetOperationString)) {
List<String> operationsFromString = StringUtil.split(targetOperationString, "|");
@@ -167,7 +167,7 @@ public ContentPermissionServices() {}
permCondGetter.setOperationList(targetOperations);

EntityPermissionChecker.StdRelatedRoleGetter roleGetter = new EntityPermissionChecker.StdRelatedRoleGetter("Content", "roleTypeId", "contentId", "partyId", "ownerContentId", "ContentRole");
List<String> passedRoles = UtilGenerics.checkList(context.get("roleTypeList"));
List<String> passedRoles = UtilGenerics.cast(context.get("roleTypeList"));
if (passedRoles == null) passedRoles = new LinkedList<>();
String roleTypeString = (String) context.get("roleTypeString");
if (UtilValidate.isNotEmpty(roleTypeString)) {
@@ -265,7 +265,7 @@ public static void searchSetSortOrder(ResultSortOrder resultSortOrder, HttpSessi
ContentSearchOptions.setResultSortOrder(resultSortOrder, session);
}
public static List<ContentSearchOptions> getSearchOptionsHistoryList(HttpSession session) {
List<ContentSearchOptions> optionsHistoryList = UtilGenerics.checkList(session.getAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_"));
List<ContentSearchOptions> optionsHistoryList = UtilGenerics.cast(session.getAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_"));
if (optionsHistoryList == null) {
optionsHistoryList = new LinkedList<>();
session.setAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_", optionsHistoryList);
@@ -77,9 +77,9 @@
toFrom = toFrom.toUpperCase(Locale.getDefault());
}

List<String> assocTypes = UtilGenerics.checkList(context.get("contentAssocTypeList"));
List<String> targetOperations = UtilGenerics.checkList(context.get("targetOperationList"));
List<String> contentTypes = UtilGenerics.checkList(context.get("contentTypeList"));
List<String> assocTypes = UtilGenerics.cast(context.get("contentAssocTypeList"));
List<String> targetOperations = UtilGenerics.cast(context.get("targetOperationList"));
List<String> contentTypes = UtilGenerics.cast(context.get("contentTypeList"));
List<GenericValue> contentList = null;

try {
@@ -154,7 +154,7 @@
}

private static void walkParentTree(Map<String, Object> nodeMap, List<Object> parentList) {
List<Map<String, Object>> kids = UtilGenerics.checkList(nodeMap.get("kids"));
List<Map<String, Object>> kids = UtilGenerics.cast(nodeMap.get("kids"));
if (UtilValidate.isEmpty(kids)) {
parentList.add(nodeMap.get("contentId"));
} else {
@@ -591,7 +591,7 @@ private static void walkParentTree(Map<String, Object> nodeMap, List<Object> par
Map<String, Object> result = new HashMap<>();
String outputString = null;
String delimiter = UtilFormatOut.checkEmpty((String)context.get("delimiter"), "|");
List<String> inputList = UtilGenerics.checkList(context.get("inputList"));
List<String> inputList = UtilGenerics.cast(context.get("inputList"));
if (inputList != null) {
outputString = StringUtil.join(inputList, delimiter);
}
@@ -65,8 +65,8 @@
*/
public static Map<String, Object> getAssocAndContentAndDataResource(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
List<String> assocTypes = UtilGenerics.checkList(context.get("assocTypes"));
List<String> contentTypes = UtilGenerics.checkList(context.get("contentTypes"));
List<String> assocTypes = UtilGenerics.cast(context.get("assocTypes"));
List<String> contentTypes = UtilGenerics.cast(context.get("contentTypes"));
Timestamp fromDate = (Timestamp)context.get("fromDate");
Timestamp thruDate = (Timestamp)context.get("thruDate");
String fromDateStr = (String)context.get("fromDateStr");
@@ -157,7 +157,7 @@
*/
public static Map<String, Object> getAssocAndContentAndDataResourceCache(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
List<String> assocTypes = UtilGenerics.checkList(context.get("assocTypes"));
List<String> assocTypes = UtilGenerics.cast(context.get("assocTypes"));
String assocTypesString = (String)context.get("assocTypesString");
if (UtilValidate.isNotEmpty(assocTypesString)) {
List<String> lst = StringUtil.split(assocTypesString, "|");
@@ -166,7 +166,7 @@
}
assocTypes.addAll(lst);
}
List<String> contentTypes = UtilGenerics.checkList(context.get("contentTypes"));
List<String> contentTypes = UtilGenerics.cast(context.get("contentTypes"));
String contentTypesString = (String)context.get("contentTypesString");
if (UtilValidate.isNotEmpty(contentTypesString)) {
List<String> lst = StringUtil.split(contentTypesString, "|");

0 comments on commit e9a56a7

Please sign in to comment.
You can’t perform that action at this time.