ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (OFBIZ-9287) Refactor the runAction method in AbstractModelAction, ModelFormAction and ModelTreeAction classes
Date Fri, 31 Mar 2017 19:25:41 GMT

     [ https://issues.apache.org/jira/browse/OFBIZ-9287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jacques Le Roux reassigned OFBIZ-9287:
--------------------------------------

    Assignee: Jacques Le Roux

> 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
>
> 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)

Mime
View raw message