Skip to content
Permalink
Browse files

Improved: Inline ‘UtilGenerics#checkMap’

(OFBIZ-11141)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863500 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jul 20, 2019
1 parent 17da80d commit 83fd20607bc41a8775468e945d4c7a861dadaf46
Showing with 207 additions and 211 deletions.
  1. +1 −1 applications/accounting/src/main/java/org/apache/ofbiz/accounting/ledger/GeneralLedgerServices.java
  2. +1 −1 ...ounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
  3. +3 −3 applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
  4. +5 −5 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
  5. +4 −4 applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
  6. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
  7. +1 −1 applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
  8. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java
  9. +2 −2 applications/content/src/main/java/org/apache/ofbiz/content/output/OutputServices.java
  10. +5 −5 applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java
  11. +1 −1 ...content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
  12. +1 −1 ...ns/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java
  13. +1 −1 ...ons/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
  14. +2 −2 ...s/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
  15. +1 −1 ...ations/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
  16. +1 −1 ...tions/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
  17. +1 −1 applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java
  18. +4 −4 applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMServices.java
  19. +6 −6 .../manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
  20. +1 −1 applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
  21. +29 −29 applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
  22. +4 −4 applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
  23. +3 −3 ...cations/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
  24. +1 −1 applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java
  25. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlDirective.java
  26. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java
  27. +3 −3 applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
  28. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
  29. +2 −2 applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
  30. +1 −1 applications/product/src/main/java/org/apache/ofbiz/product/test/StockMovesTest.java
  31. +10 −10 applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingServices.java
  32. +5 −5 applications/product/src/main/java/org/apache/ofbiz/shipment/verify/VerifyPickServices.java
  33. +3 −3 applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortServices.java
  34. +1 −1 framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentLoaderConfig.java
  35. +1 −1 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
  36. +1 −5 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java
  37. +2 −2 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
  38. +2 −2 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
  39. +4 −5 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilPlist.java
  40. +2 −2 framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleServletAccessor.java
  41. +2 −2 framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapComparator.java
  42. +3 −3 framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
  43. +1 −1 framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
  44. +2 −2 framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
  45. +1 −1 framework/common/src/main/java/org/apache/ofbiz/common/email/NotificationServices.java
  46. +2 −2 framework/common/src/main/java/org/apache/ofbiz/common/scripting/ContextHelper.java
  47. +1 −1 framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java
  48. +1 −1 framework/entity/src/main/java/org/apache/ofbiz/entity/condition/EntityConditionBuilder.java
  49. +1 −1 framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java
  50. +1 −1 framework/service/src/main/java/org/apache/ofbiz/service/ModelNotification.java
  51. +4 −4 framework/service/src/main/java/org/apache/ofbiz/service/ServiceUtil.java
  52. +3 −3 framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaAction.java
  53. +2 −2 framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java
  54. +1 −1 framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaSetField.java
  55. +2 −2 framework/service/src/main/java/org/apache/ofbiz/service/engine/HttpEngine.java
  56. +1 −1 framework/service/src/main/java/org/apache/ofbiz/service/engine/StandardJavaEngine.java
  57. +1 −1 framework/service/src/main/java/org/apache/ofbiz/service/jms/AbstractJmsListener.java
  58. +4 −4 framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
  59. +2 −1 framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java
  60. +1 −1 framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/ServiceEventHandler.java
  61. +6 −6 framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
  62. +1 −1 .../webtools/src/main/java/org/apache/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java
  63. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java
  64. +2 −2 framework/widget/src/main/java/org/apache/ofbiz/widget/cache/WidgetContextCacheKey.java
  65. +2 −2 framework/widget/src/main/java/org/apache/ofbiz/widget/model/AbstractModelAction.java
  66. +2 −2 framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java
  67. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormAction.java
  68. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
  69. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuAction.java
  70. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
  71. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTree.java
  72. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelTreeAction.java
  73. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java
  74. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/FormRenderer.java
  75. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/MenuWrapTransform.java
  76. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/Paginator.java
  77. +13 −13 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
  78. +3 −3 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
  79. +1 −1 framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java
@@ -40,7 +40,7 @@
Map<String, Object> createGlAcctCatMemFromCostCentersMap = null;
String glAccountId = (String) context.get("glAccountId");
GenericValue userLogin = (GenericValue) context.get("userLogin");
Map<String, String> amountPercentageMap = UtilGenerics.checkMap(context.get("amountPercentageMap"));
Map<String, String> amountPercentageMap = UtilGenerics.cast(context.get("amountPercentageMap"));
BigDecimal totalAmountPercentage = GeneralLedgerServices.calculateCostCenterTotal(amountPercentageMap);
Map<String, Object> result = ServiceUtil.returnSuccess();
for (Map.Entry<String, String> rowEntry : amountPercentageMap.entrySet()) {
@@ -706,7 +706,7 @@ private static Document buildPrimaryTxRequest(Map<String, Object> context, Strin

// TODO: determine if adding OrderItemList is worthwhile - JFE 2004.02.14

Map<String, Object> pbOrder = UtilGenerics.checkMap(context.get("pbOrder"));
Map<String, Object> pbOrder = UtilGenerics.cast(context.get("pbOrder"));
if (pbOrder != null) {
if (Debug.verboseOn()) {
Debug.logVerbose("pbOrder Map not empty:" + pbOrder.toString(), module);
@@ -81,7 +81,7 @@ public static void mruAdd(HttpSession session, GenericEntity pk) {
return;
}

Map<String, LifoSet<Object>> lookupCaches = UtilGenerics.checkMap(session.getAttribute("lookupCaches"));
Map<String, LifoSet<Object>> lookupCaches = UtilGenerics.cast(session.getAttribute("lookupCaches"));
if (lookupCaches == null) {
lookupCaches = new HashMap<>();
session.setAttribute("lookupCaches", lookupCaches);
@@ -154,7 +154,7 @@ public static void setCurrentEntityMap(HttpServletRequest request, GenericEntity

public static void setCurrentEntityMap(HttpServletRequest request, String entityName, GenericEntity ent) {
HttpSession session = request.getSession();
Map<String, GenericEntity> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap"));
Map<String, GenericEntity> currentEntityMap = UtilGenerics.cast(session.getAttribute("currentEntityMap"));
if (currentEntityMap == null) {
currentEntityMap = new HashMap<>();
session.setAttribute("currentEntityMap", currentEntityMap);
@@ -183,7 +183,7 @@ public static String getFromSomewhere(String name, Map<String, Object> paramMap,

public static void getCurrentValue(HttpServletRequest request, Delegator delegator) {
HttpSession session = request.getSession();
Map<String, GenericPK> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap"));
Map<String, GenericPK> currentEntityMap = UtilGenerics.cast(session.getAttribute("currentEntityMap"));
if (currentEntityMap == null) {
currentEntityMap = new HashMap<>();
session.setAttribute("currentEntityMap", currentEntityMap);
@@ -145,7 +145,7 @@
if (ServiceUtil.isError(thisResults)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(thisResults));
}
Map<String, Object> nodeMap = UtilGenerics.checkMap(thisResults.get("nodeMap"));
Map<String, Object> nodeMap = UtilGenerics.cast(thisResults.get("nodeMap"));
walkParentTree(nodeMap, parentList);
} catch (GenericServiceException e) {
return ServiceUtil.returnFailure(e.getMessage());
@@ -385,7 +385,7 @@ private static void walkParentTree(Map<String, Object> nodeMap, List<Object> par
Map<String, Object> results = new HashMap<>();
LocalDispatcher dispatcher = dctx.getDispatcher();

Map<String,Object> templateContext = UtilGenerics.checkMap(context.get("templateContext"));
Map<String,Object> templateContext = UtilGenerics.cast(context.get("templateContext"));
String contentId = (String) context.get("contentId");

if (templateContext != null && UtilValidate.isEmpty(contentId)) {
@@ -436,7 +436,7 @@ private static void walkParentTree(Map<String, Object> nodeMap, List<Object> par
LocalDispatcher dispatcher = dctx.getDispatcher();
Writer out = (Writer) context.get("outWriter");

Map<String,Object> templateContext = UtilGenerics.checkMap(context.get("templateContext"));
Map<String,Object> templateContext = UtilGenerics.cast(context.get("templateContext"));
String contentId = (String) context.get("contentId");
if (templateContext != null && UtilValidate.isEmpty(contentId)) {
contentId = (String) templateContext.get("contentId");
@@ -558,7 +558,7 @@ private static void walkParentTree(Map<String, Object> nodeMap, List<Object> par

public static Map<String, Object> getPrefixedMembers(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = new HashMap<>();
Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn"));
Map<String, Object> mapIn = UtilGenerics.cast(context.get("mapIn"));
String prefix = (String)context.get("prefix");
Map<String, Object> mapOut = new HashMap<>();
result.put("mapOut", mapOut);
@@ -602,7 +602,7 @@ private static void walkParentTree(Map<String, Object> nodeMap, List<Object> par
public static Map<String, Object> urlEncodeArgs(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = new HashMap<>();
Map<String, Object> mapFiltered = new HashMap<>();
Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn"));
Map<String, Object> mapIn = UtilGenerics.cast(context.get("mapIn"));
if (mapIn != null) {
Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet();
for (Map.Entry<String, Object> entry : entrySet) {
@@ -201,7 +201,7 @@ public static void renderContentAsText(LocalDispatcher dispatcher, GenericValue
if (service != null) {
//put all requestParameters into templateContext to use them as IN service parameters
Map<String,Object> tempTemplateContext = new HashMap<>();
tempTemplateContext.putAll(UtilGenerics.<String,Object>checkMap(templateContext.get("requestParameters")));
tempTemplateContext.putAll(UtilGenerics.cast(templateContext.get("requestParameters")));
tempTemplateContext.putAll(templateContext);
Map<String,Object> serviceCtx = service.makeValid(tempTemplateContext, ModelService.IN_PARAM);
Map<String,Object> serviceRes;
@@ -702,7 +702,7 @@ public static void selectKids(Map<String, Object> currentNode, Map<String, Objec
String contentTypeId = (String) ctx.get("contentTypeId");
String mapKey = (String) ctx.get("mapKey");
String parentContentId = (String) parentContent.get("contentId");
Map<String, Object> whenMap = UtilGenerics.checkMap(ctx.get("whenMap"));
Map<String, Object> whenMap = UtilGenerics.cast(ctx.get("whenMap"));
List<Map<String, Object>> kids = new LinkedList<>();
currentNode.put("kids", kids);
String direction = (String) ctx.get("direction");
@@ -1595,7 +1595,7 @@ public static StringBuilder logMap(StringBuilder s, String lbl, Map<String, Obje
indent.setLength(indent.length() - 1);
} else if (obj instanceof Map<?, ?>) {
indent.append(' ');
logMap(s, "MAP[" + key + "]", UtilGenerics.<String, Object>checkMap(obj), indent);
logMap(s, "MAP[" + key + "]", UtilGenerics.cast(obj), indent);
indent.setLength(indent.length() - 1);
} else if (obj != null) {
s.append(obj).append(sep).append(obj.getClass()).append(eol);
@@ -1639,7 +1639,7 @@ public static StringBuilder logList(StringBuilder s, String lbl, List<Object> ls
indent.setLength(indent.length() - 1);
} else if (obj instanceof Map<?, ?>) {
indent.append(' ');
logMap(s, "MAP[]", UtilGenerics.<String, Object>checkMap(obj), indent);
logMap(s, "MAP[]", UtilGenerics.cast(obj), indent);
indent.setLength(indent.length() - 1);
} else if (obj != null) {
s.append(obj).append(sep).append(obj.getClass()).append(eol);
@@ -793,7 +793,7 @@ public static void renderDataResourceAsText(LocalDispatcher dispatcher, Delegato
}
} else if ("FORM_COMBINED".equals(dataTemplateTypeId)){
try {
Map<String, Object> context = UtilGenerics.checkMap(templateContext.get("globalContext"));
Map<String, Object> context = UtilGenerics.cast(templateContext.get("globalContext"));
context.put("locale", locale);
context.put("simpleEncoder", UtilCodec.getEncoder(modelTheme.getEncoder("screen")));
HttpServletRequest request = (HttpServletRequest) context.get("request");
@@ -838,7 +838,7 @@ public static String getDataResourceText(GenericValue dataResource, String mimeT

public static void writeDataResourceText(GenericValue dataResource, String mimeTypeId, Locale locale, Map<String, Object> templateContext,
Delegator delegator, Appendable out, boolean cache) throws IOException, GeneralException {
Map<String, Object> context = UtilGenerics.checkMap(templateContext.get("context"));
Map<String, Object> context = UtilGenerics.cast(templateContext.get("context"));
if (context == null) {
context = new HashMap<>();
}
@@ -469,7 +469,7 @@
Map<String, Object> results = new HashMap<>();
//LocalDispatcher dispatcher = dctx.getDispatcher();
Writer out = (Writer) context.get("outWriter");
Map<String, Object> templateContext = UtilGenerics.checkMap(context.get("templateContext"));
Map<String, Object> templateContext = UtilGenerics.cast(context.get("templateContext"));
//GenericValue userLogin = (GenericValue) context.get("userLogin");
String dataResourceId = (String) context.get("dataResourceId");
if (templateContext != null && UtilValidate.isEmpty(dataResourceId)) {
@@ -66,7 +66,7 @@ public static String createLayoutImage(HttpServletRequest request, HttpServletRe
LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
HttpSession session = request.getSession();
Map<String, Object> uploadResults = LayoutWorker.uploadImageAndParameters(request, "imageData");
Map<String, Object> formInput = UtilGenerics.checkMap(uploadResults.get("formInput"));
Map<String, Object> formInput = UtilGenerics.cast(uploadResults.get("formInput"));
Map<String, Object> context = new HashMap<>();
ByteBuffer byteWrap = (ByteBuffer) uploadResults.get("imageData");
if (byteWrap == null) {
@@ -177,7 +177,7 @@ public static String updateLayoutImage(HttpServletRequest request, HttpServletRe
Delegator delegator = (Delegator) request.getAttribute("delegator");
HttpSession session = request.getSession();
Map<String, Object> uploadResults = LayoutWorker.uploadImageAndParameters(request, "imageData");
Map<String, Object> context = UtilGenerics.checkMap(uploadResults.get("formInput"));
Map<String, Object> context = UtilGenerics.cast(uploadResults.get("formInput"));
ByteBuffer byteWrap = (ByteBuffer) uploadResults.get("imageData");
if (byteWrap == null) {
String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.image_data_null", locale);
@@ -94,7 +94,7 @@
visualTheme = ThemeFactory.resolveVisualTheme(null);
}
String screenLocation = (String) serviceContext.remove("screenLocation");
Map<String, Object> screenContext = UtilGenerics.checkMap(serviceContext.remove("screenContext"));
Map<String, Object> screenContext = UtilGenerics.cast(serviceContext.remove("screenContext"));
String contentType = (String) serviceContext.remove("contentType");
String printerContentType = (String) serviceContext.remove("printerContentType");

@@ -212,7 +212,7 @@
visualTheme = ThemeFactory.resolveVisualTheme(null);
}
String screenLocation = (String) serviceContext.remove("screenLocation");
Map<String, Object> screenContext = UtilGenerics.checkMap(serviceContext.remove("screenContext"));
Map<String, Object> screenContext = UtilGenerics.cast(serviceContext.remove("screenContext"));
String contentType = (String) serviceContext.remove("contentType");
String filePath = (String) serviceContext.remove("filePath");
String fileName = (String) serviceContext.remove("fileName");
@@ -89,7 +89,7 @@
PdfReader pdfReader = new PdfReader(byteBuffer.array());
PdfStamper pdfStamper = new PdfStamper(pdfReader, os);
AcroFields acroFields = pdfStamper.getAcroFields();
Map<String, Object> acroFieldMap = UtilGenerics.checkMap(acroFields.getFields());
Map<String, Object> acroFieldMap = UtilGenerics.cast(acroFields.getFields());

String contentId = (String) context.get("contentId");
GenericValue survey = null;
@@ -246,7 +246,7 @@
PdfReader r = new PdfReader(byteBuffer.array());
PdfStamper s = new PdfStamper(r,os);
AcroFields fs = s.getAcroFields();
Map<String, Object> hm = UtilGenerics.checkMap(fs.getFields());
Map<String, Object> hm = UtilGenerics.cast(fs.getFields());
s.setFormFlattening(true);
for (String fieldName : hm.keySet()) {
//AcroFields.Item item = fs.getFieldItem(fieldName);
@@ -291,7 +291,7 @@
PdfReader r = new PdfReader(byteBuffer.array());
PdfStamper s = new PdfStamper(r,os);
AcroFields fs = s.getAcroFields();
Map<String, Object> map = UtilGenerics.checkMap(fs.getFields());
Map<String, Object> map = UtilGenerics.cast(fs.getFields());
s.setFormFlattening(true);

for (String fieldName : map.keySet()) {
@@ -315,13 +315,13 @@
Map<String, Object> results = ServiceUtil.returnSuccess();
Delegator delegator = dctx.getDelegator();
try {
Map<String, Object> acroFieldMap = UtilGenerics.checkMap(context.get("acroFieldMap"));
Map<String, Object> acroFieldMap = UtilGenerics.cast(context.get("acroFieldMap"));
ByteBuffer byteBuffer = getInputByteBuffer(context, delegator);
PdfReader r = new PdfReader(byteBuffer.array());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfStamper s = new PdfStamper(r, baos);
AcroFields fs = s.getAcroFields();
Map<String, Object> map = UtilGenerics.checkMap(fs.getFields());
Map<String, Object> map = UtilGenerics.cast(fs.getFields());
s.setFormFlattening(true);

for (String fieldName : map.keySet()) {
@@ -150,7 +150,7 @@ public void close() throws IOException {
if (UtilValidate.isNotEmpty(wrapTemplateId)) {
templateCtx.put("wrappedContent", wrappedContent);
Map<String, Object> templateRoot = null;
Map<String, Object> templateRootTemplate = UtilGenerics.checkMap(templateCtx.get("templateRootTemplate"));
Map<String, Object> templateRootTemplate = UtilGenerics.cast(templateCtx.get("templateRootTemplate"));
if (templateRootTemplate == null) {
Map<String, Object> templateRootTmp = FreeMarkerWorker.createEnvironmentMap(env);
templateRoot = UtilMisc.makeMapWritable(templateRootTmp);
@@ -220,7 +220,7 @@ public boolean prepCtx(Delegator delegator, Map<String, Object> ctx, Environment

String mimeTypeId = ContentWorker.getMimeTypeId(delegator, view, ctx);
Map<String, Object> trailNode = ContentWorker.makeNode(view);
Map<String, Object> whenMap = UtilGenerics.checkMap(ctx.get("whenMap"));
Map<String, Object> whenMap = UtilGenerics.cast(ctx.get("whenMap"));
ContentWorker.checkConditions(delegator, trailNode, null, whenMap);
Boolean isReturnBeforeObj = (Boolean) trailNode.get("isReturnBefore");
Boolean isPickObj = (Boolean) trailNode.get("isPick");
@@ -140,7 +140,7 @@ public void renderSubContent() throws IOException {
if (view != null) {
thisView = view;
} else if (passedGlobalNodeTrail.size() > 0) {
Map<String, ? extends Object> map = UtilGenerics.checkMap(passedGlobalNodeTrail.get(passedGlobalNodeTrail.size() - 1));
Map<String, ? extends Object> map = UtilGenerics.cast(passedGlobalNodeTrail.get(passedGlobalNodeTrail.size() - 1));
if (Debug.infoOn()) {
Debug.logInfo("in Render(3), map ." + map , module);
}
@@ -153,9 +153,9 @@ public int onStart() throws TemplateModelException, IOException {
if (globalNodeTrail.size() > 0) {
int sz = globalNodeTrail.size() ;
nodeTrail = new LinkedList<>();
node = UtilGenerics.checkMap(globalNodeTrail.get(sz - 1));
node = UtilGenerics.cast(globalNodeTrail.get(sz - 1));
Boolean checkedObj = (Boolean)node.get("checked");
Map<String, Object> whenMap = UtilGenerics.checkMap(templateRoot.get("whenMap"));
Map<String, Object> whenMap = UtilGenerics.cast(templateRoot.get("whenMap"));
if (checkedObj == null || !checkedObj) {
ContentWorker.checkConditions(delegator, node, null, whenMap);
}
@@ -248,7 +248,7 @@ private boolean checkWhen (GenericValue thisContent, String contentAssocTypeId)
return false;
}
assocContext.put("typeAncestry", contentTypeAncestry);
Map<String, Object> whenMap = UtilGenerics.checkMap(traverseContext.get("whenMap"));
Map<String, Object> whenMap = UtilGenerics.cast(traverseContext.get("whenMap"));
List<Map<String, ? extends Object>> nodeTrail = UtilGenerics.checkList(traverseContext.get("nodeTrail"));
int indentSz = indent + nodeTrail.size();
assocContext.put("indentObj", indentSz);
@@ -160,7 +160,7 @@ public void close() throws IOException {
if (UtilValidate.isNotEmpty(wrapTemplateId)) {
templateCtx.put("wrappedContent", wrappedContent);
Map<String, Object> templateRoot = null;
Map<String, Object> templateRootTemplate = UtilGenerics.checkMap(templateCtx.get("templateRootTemplate"));
Map<String, Object> templateRootTemplate = UtilGenerics.cast(templateCtx.get("templateRootTemplate"));
if (templateRootTemplate == null) {
Map<String, Object> templateRootTmp = FreeMarkerWorker.createEnvironmentMap(env);
templateRoot = UtilMisc.makeMapWritable(templateRootTmp);

0 comments on commit 83fd206

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