[
https://issues.apache.org/jira/browse/OFBIZ-9287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux closed OFBIZ-9287.
----------------------------------
Resolution: Implemented
Fix Version/s: Upcoming Release
Implemented at r1789737
This also removes the swallowed exception that we had in ModelFormAction and ModelTreeAction, but not in ModelActionUtil from where I extracted the method.
It's now consistent and if ever, for a very unlikely reason, the exception is thrown, people will know about it and will take appropriate measures.
> Refactor the runAction method in AbstractModelAction, ModelFormAction and ModelTreeAction classes
> -------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-9287
> URL:
https://issues.apache.org/jira/browse/OFBIZ-9287> Project: OFBiz
> Issue Type: Improvement
> Reporter: Jacques Le Roux
> Assignee: Jacques Le Roux
> Priority: Minor
> Labels: refactoring
> Fix For: Upcoming Release
>
>
> This 3 methods share a pattern which should be refactored in a common protected method. The pattern is
> {code}
> if (!this.resultMapNameAcsr.isEmpty()) {
> this.resultMapNameAcsr.put(context, result);
> String queryString = (String) result.get("queryString");
> context.put("queryString", queryString);
> context.put("queryStringMap", result.get("queryStringMap"));
> if (UtilValidate.isNotEmpty(queryString)) {
> try {
> String queryStringEncoded = queryString.replaceAll("&", "%26");
> context.put("queryStringEncoded", queryStringEncoded);
> } catch (PatternSyntaxException e) {
> // obviously a PatternSyntaxException should not occur here
> }
> }
> } else {
> context.putAll(result);
> }
> {code}
> Enough for a refactor I'd say.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)