[ https://issues.apache.org/jira/browse/OFBIZ-10724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16727342#comment-16727342 ]
Aditya Sharma commented on OFBIZ-10724: --------------------------------------- Done for trunk at r1849536. > Refactor ServiceUtil.isSuccess(), isError() and isFailure() methods > ------------------------------------------------------------------- > > Key: OFBIZ-10724 > URL: https://issues.apache.org/jira/browse/OFBIZ-10724 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: Trunk > Reporter: Aditya Sharma > Assignee: Aditya Sharma > Priority: Minor > Attachments: OFBIZ-10724.patch, OFBIZ-10724.patch > > > Following lines for isSuccess(): > {code:java} > if (ServiceUtil.isError(results) || ServiceUtil.isFailure(results)) { > return false; > } > return true; > {code} > can be changed to > {code:java} > return !(ServiceUtil.isError(results) || ServiceUtil.isFailure(results)); > {code} > Following lines for isFailure(): > {code:java} > if (results == null || results.get(ModelService.RESPONSE_MESSAGE) == null) { > return false; > } > return > ModelService.RESPOND_FAIL.equals(results.get(ModelService.RESPONSE_MESSAGE)); > {code} > can be changed to > {code:java} > return !(results == null || results.get(ModelService.RESPONSE_MESSAGE) == > null) && > > ModelService.RESPOND_FAIL.equals(results.get(ModelService.RESPONSE_MESSAGE));{code} > Following lines for isError(): > > {code:java} > if (results == null || results.get(ModelService.RESPONSE_MESSAGE) == null) { > return false; > } > return > ModelService.RESPOND_ERROR.equals(results.get(ModelService.RESPONSE_MESSAGE)); > {code} > can be changed to > {code:java} > return !(results == null || results.get(ModelService.RESPONSE_MESSAGE) == > null) && > > ModelService.RESPOND_ERROR.equals(results.get(ModelService.RESPONSE_MESSAGE)); > {code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)