Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035821Retail ModulesStoreServerpublic2017-04-20 10:192017-06-09 21:09
mtaal 
mtaal 
normalminorhave not tried
closedno change required 
5
 
RR17Q2.1 
No
0035821: MobileServerUtils: Incorrectly comparing string values using != instead of equals method
See the code here [1] it does this:
 if (p.getClient().getId() != "0" || p.getOrganization().getId() != "0") {

However comparing strings like this is wrong, equals should be used:
if (!"0".equals(p.getClient().getId()) || !"0".equals(p.getOrganization().getId())) {

Bug was introduced by this commit [2]

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/44e8f0f349dc/src/org/openbravo/mobile/core/servercontroller/MobileServerUtils.java#l116 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/44e8f0f349dc#l1.43 [^]
Check the code
use equals, as proposed in the description
No tags attached.
blocks defect 0035804RR17Q3 closed mtaal MobileServerUtils: Incorrectly comparing string values using != instead of equals method 
Issue History
2017-04-24 17:30mtaalTypedefect => backport
2017-04-24 17:30mtaalTarget VersionRR17Q3 => RR17Q2.1
2017-06-09 21:09mtaalNote Added: 0097295
2017-06-09 21:09mtaalStatusscheduled => closed
2017-06-09 21:09mtaalResolutionopen => no change required

Notes
(0097295)
mtaal   
2017-06-09 21:09   
No change, individual backport to BUT