[ofbiz-framework] branch trunk updated: Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness

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

[ofbiz-framework] branch trunk updated: Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness

mthl
This is an automated email from the ASF dual-hosted git repository.

mthl pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 20e0bbe  Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness
20e0bbe is described below

commit 20e0bbe55c1c0c0d55fccc82afd7789cc22cb538
Author: Mathieu Lirzin <[hidden email]>
AuthorDate: Thu Jan 2 18:13:20 2020 +0100

    Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness
   
    No functional changes.
---
 .../src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
index 965d0d1..18b6dae 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
@@ -459,9 +459,7 @@ public class RequestHandler {
         // we know this is the case if the _PREVIOUS_PARAM_MAP_ attribute is there, but the _PREVIOUS_REQUEST_ attribute has already been removed
         if (request.getSession().getAttribute("_PREVIOUS_PARAM_MAP_FORM_") != null && request.getSession().getAttribute("_PREVIOUS_REQUEST_") == null) {
             Map<String, Object> previousParamMap = UtilGenerics.checkMap(request.getSession().getAttribute("_PREVIOUS_PARAM_MAP_FORM_"), String.class, Object.class);
-            for (Map.Entry<String, Object> previousParamEntry: previousParamMap.entrySet()) {
-                request.setAttribute(previousParamEntry.getKey(), previousParamEntry.getValue());
-            }
+            previousParamMap.forEach(request::setAttribute);
 
             // to avoid this data being included again, now remove the _PREVIOUS_PARAM_MAP_ attribute
             request.getSession().removeAttribute("_PREVIOUS_PARAM_MAP_FORM_");