You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Devanshu Vyas (JIRA)" <ji...@apache.org> on 2017/03/30 05:12:42 UTC

[jira] [Updated] (OFBIZ-9254) Inconsistent String Comparisons

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

Devanshu Vyas updated OFBIZ-9254:
---------------------------------
    Attachment: OFBIZ-9254_groovy.patch

This is a patch file for fixing the string comparisons(equals() and equalsIgnoreCase()) in groovy files.

> Inconsistent String Comparisons
> -------------------------------
>
>                 Key: OFBIZ-9254
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9254
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Devanshu Vyas
>            Priority: Minor
>         Attachments: OFBIZ-9254_groovy.patch
>
>
> I found an inconsistency in the code for string comparison statusId.equals("PRUN_COMPLETED") whereas it should be written as "PRUN_COMPLETED".equals(statusId) 
> cause the former can throw NullPointerException if the variable found to be NULL.
> This pattern should be applied to 
> - Java Files
> - Groovy Files
> - FTL Files
> Here is the reference for the discussion done on the dev list.
> http://markmail.org/message/iqfaab3fl3ukxchy



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)