Re: Inconsistent String Comparisons

2017-04-21 Thread Devanshu Vyas
Thanks Jacques. Even I was more reluctant to use the b) option. Now I will start my work for Freemarker files with the b) option i.e. '==' operator. Thanks & Regards, Devanshu Vyas. On Fri, Apr 21, 2017 at 1:40 PM, Jacques Le Roux < jacques.le.r...@les7arts.com> wrote: > Hi Devanshu , > > I

Re: Inconsistent String Comparisons

2017-04-21 Thread Jacques Le Roux
Hi Devanshu , I like to keep things simple (KISS way), reading http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_comparison I suggest we always use b) version. I see no reasons why a) was used, even historically. There are 2968 occurences of b) vs 77 of a) in OFBiz Thanks

Re: Inconsistent String Comparisons

2017-04-03 Thread Devanshu Vyas
Hello Devs, I have completed working on this task OFBIZ-9254 for JAVA files, GROOVY files and uploaded the patches also. Now, I am working on the same for FTL files and found that there are two patterns used in OFBiz for string comparisons:

Re: Inconsistent String Comparisons

2017-02-18 Thread Michael Brohl
+1, thanks, Devanshu! Regards, Michael Am 09.01.17 um 10:22 schrieb Devanshu Vyas: Hello Devs, 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

Re: Inconsistent String Comparisons

2017-02-18 Thread Jacques Le Roux
+1, I suggest a Jira to handle all cases like that Jacques Le 09/01/2017 à 10:22, Devanshu Vyas a écrit : Hello Devs, 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

Re: Inconsistent String Comparisons

2017-02-17 Thread Taher Alkhateeb
+1 On Feb 18, 2017 8:16 AM, "Ratnesh Upadhyay" wrote: +1 for the initiation, also we can enforce it as best practice for future implementations and patches. Thanks!! Regards, Ratnesh Upadhyay HotWax Systems www.hotwaxsystems.com On Mon, Jan 9, 2017 at 2:52 PM,

Re: Inconsistent String Comparisons

2017-02-17 Thread Ratnesh Upadhyay
+1 for the initiation, also we can enforce it as best practice for future implementations and patches. Thanks!! Regards, Ratnesh Upadhyay HotWax Systems www.hotwaxsystems.com On Mon, Jan 9, 2017 at 2:52 PM, Devanshu Vyas wrote: > Hello Devs, > > I found an

Re: Inconsistent String Comparisons

2017-01-09 Thread Pranay Pandey
+1 Devanshu. Best regards, Pranay Pandey HotWax Systems http://www.hotwaxsystems.com/ On Mon, Jan 9, 2017 at 2:52 PM, Devanshu Vyas wrote: > Hello Devs, > > I found an inconsistency in the code for string comparison > *statusId.equals("PRUN_COMPLETED")* whereas it

Re: Inconsistent String Comparisons

2017-01-09 Thread Swapnil Mane
+1 Devanshu. - Best Regards, Swapnil M Mane On Mon, Jan 9, 2017 at 2:52 PM, Devanshu Vyas wrote: > Hello Devs, > > I found an inconsistency in the code for string comparison > *statusId.equals("PRUN_COMPLETED")* whereas it should be written as >

Re: Inconsistent String Comparisons

2017-01-09 Thread Michael Brohl
+1 Regards, Michael Am 09.01.17 um 10:27 schrieb Nicolas Malin: Hello Devanshu, Yes your welcome to submit a patch :) Nicolas Le 09/01/2017 à 10:22, Devanshu Vyas a écrit : Hello Devs, I found an inconsistency in the code for string comparison *statusId.equals("PRUN_COMPLETED")* whereas

Re: Inconsistent String Comparisons

2017-01-09 Thread Nicolas Malin
Hello Devanshu, Yes your welcome to submit a patch :) Nicolas Le 09/01/2017 à 10:22, Devanshu Vyas a écrit : Hello Devs, 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

Inconsistent String Comparisons

2017-01-09 Thread Devanshu Vyas
Hello Devs, 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 code pattern can be found at