[jira] [Reopened] (OFBIZ-9254) Inconsistent String Comparisons
[ https://issues.apache.org/jira/browse/OFBIZ-9254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reopened OFBIZ-9254: Assignee: (was: Jacques Le Roux) Thanks Guys, Missed that, patches looks good to me. Just one point: why not handling number the same, as in {{if (("" != facilityId) && (intAtp != 0)) {}} that would then be: {{if (("" != facilityId) && (0 != intAtp)) {}} ? :) Pawan could please handle it, i mean the commit+push? > 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 > Fix For: 18.12.01, 17.12.05 > > Attachments: OFBIZ-9251_ftl_accounting.patch, > OFBIZ-9251_ftl_framework.patch, OFBIZ-9251_ftl_manuf_workeffrt.patch, > OFBIZ-9251_ftl_order.patch, OFBIZ-9251_ftl_party_content.patch, > OFBIZ-9251_ftl_plugins_ebay_ebaystore.patch, > OFBIZ-9251_ftl_plugins_ecommerce.patch, > OFBIZ-9251_ftl_plugins_pricat_projmgr.patch, OFBIZ-9251_ftl_product.patch, > OFBIZ-9251_ftl_themes.patch, OFBIZ-9254.patch, OFBIZ-9254_FTL-I.patch, > OFBIZ-9254_groovy_applications.patch, OFBIZ-9254_groovy_framework.patch, > OFBIZ-9254_java_Party_WE_MFC.patch, OFBIZ-9254_java_accounting.patch, > OFBIZ-9254_java_base.patch, OFBIZ-9254_java_content.patch, > OFBIZ-9254_java_entity.patch, OFBIZ-9254_java_order.patch, > OFBIZ-9254_java_product.patch, OFBIZ-9254_java_service.patch, > OFBIZ-9254_java_test_entityext_common_cattalina_datafile.patch, > OFBIZ-9254_java_webapp.patch, OFBIZ-9254_java_webtools.patch, > OFBIZ-9254_java_widget.patch, OFBIZ-9254_plugins.patch, > OFBIZ-9254_plugins_groovy.patch, OFBIZ-9254_plugins_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 (v8.3.4#803005)
[jira] [Reopened] (OFBIZ-9254) Inconsistent String Comparisons
[ https://issues.apache.org/jira/browse/OFBIZ-9254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Devanshu Vyas reopened OFBIZ-9254: -- I found various occurrences where the intended fix was not applied, especially where constant string is compared to a variable with !=(not equals to) operator, e.g. {code:java} if (root != "ewayResponse") { throw new Exception("Bad root element in response: " + root); } {code} So, I am reopening this ticket, to continue the remaining effort. > 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 >Assignee: Deepak Dixit >Priority: Minor > Fix For: Upcoming Release > > Attachments: OFBIZ-9251_ftl_accounting.patch, > OFBIZ-9251_ftl_framework.patch, OFBIZ-9251_ftl_manuf_workeffrt.patch, > OFBIZ-9251_ftl_order.patch, OFBIZ-9251_ftl_party_content.patch, > OFBIZ-9251_ftl_plugins_ebay_ebaystore.patch, > OFBIZ-9251_ftl_plugins_ecommerce.patch, > OFBIZ-9251_ftl_plugins_pricat_projmgr.patch, OFBIZ-9251_ftl_product.patch, > OFBIZ-9251_ftl_themes.patch, OFBIZ-9254_FTL-I.patch, > OFBIZ-9254_groovy_applications.patch, OFBIZ-9254_groovy_framework.patch, > OFBIZ-9254_java_Party_WE_MFC.patch, OFBIZ-9254_java_accounting.patch, > OFBIZ-9254_java_base.patch, OFBIZ-9254_java_content.patch, > OFBIZ-9254_java_entity.patch, OFBIZ-9254_java_order.patch, > OFBIZ-9254_java_product.patch, OFBIZ-9254_java_service.patch, > OFBIZ-9254_java_test_entityext_common_cattalina_datafile.patch, > OFBIZ-9254_java_webapp.patch, OFBIZ-9254_java_webtools.patch, > OFBIZ-9254_java_widget.patch, OFBIZ-9254_plugins_groovy.patch, > OFBIZ-9254_plugins_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.4.14#64029)