Skip to content
Permalink
Browse files
Improved: Use ‘forEach’ in ‘RequestHandler’ for conciseness
No functional changes.
  • Loading branch information
mthl committed Jan 3, 2020
1 parent f9607c0 commit 20e0bbe55c1c0c0d55fccc82afd7789cc22cb538
Showing with 1 addition and 3 deletions.
  1. +1 −3 framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
@@ -459,9 +459,7 @@ public void doRequest(HttpServletRequest request, HttpServletResponse response,
// 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_");

0 comments on commit 20e0bbe

Please sign in to comment.