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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-9254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15978318#comment-15978318 ]

Jacques Le Roux commented on OFBIZ-9254:
----------------------------------------

Hi Devanshu,

I agree it needs to be done by hand. I did not digg much but I clearly see that side effects are possible. So this will wait a bit on my side. I'm sorry about that because I know by experience than, starting in 1 to 3 months, your patch will begin to deprecate :/ Maybe someone courageous will help...

> 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, OFBIZ-9254_java.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)