You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/11/15 15:06:50 UTC

svn commit: r1639887 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Author: jleroux
Date: Sat Nov 15 14:06:50 2014
New Revision: 1639887

URL: http://svn.apache.org/r1639887
Log:
OFBIZ-5822 - Uses a tempTemplateContext instead of templateContext which is used later in the method, thanks to Scott's post on dev ML

I will wait to commit the last changes for the Poodle vulnerability in release branches (for running tests with Java 1.7) before backporting, because I used the "new" diamond operator here (1st in OFBiz it seems)

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1639887&r1=1639886&r2=1639887&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Sat Nov 15 14:06:50 2014
@@ -23,6 +23,7 @@ import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.sql.Timestamp;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -190,8 +191,11 @@ public class ContentWorker implements or
             ModelService service = dctx.getModelService(serviceName);
             if (service != null) {
                 //put all requestParameters into templateContext to use them as IN service parameters
-                templateContext.putAll((Map<String, Object>)templateContext.get("requestParameters"));
-                Map<String,Object> serviceCtx = service.makeValid(templateContext, ModelService.IN_PARAM);
+                Map<String,Object> tempTemplateContext = new HashMap<>();
+                @SuppressWarnings("unchecked")
+                Map<String,Object> temp = (Map<String, Object>) templateContext.get("requestParameters");
+                tempTemplateContext.putAll(temp);
+                Map<String,Object> serviceCtx = service.makeValid(tempTemplateContext, ModelService.IN_PARAM);
                 Map<String,Object> serviceRes;
                 try {
                     serviceRes = dispatcher.runSync(serviceName, serviceCtx);