Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035804Retail ModulesStoreServerpublic2017-04-20 10:192017-05-18 10:49
mtaal 
mtaal 
normalminorhave not tried
closedfixed 
5
 
RR17Q3 
AugustoMauch
No
0035804: 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.
depends on backport 0035821RR17Q2.1 closed mtaal MobileServerUtils: Incorrectly comparing string values using != instead of equals method 
caused by design defect 0035541RR17Q2 closed mtaal Add a check that the multi-server preference is defined as system and without visibility filters 
has duplicate defect 0036470 closed StoreServer The org.openbravo.retail.storeserver.synchronization module defines OBMOBC_MultiServerArchitecture preference in client 0 
Issue History
2017-04-20 10:19mtaalNew Issue
2017-04-20 10:19mtaalAssigned To => mtaal
2017-04-20 10:19mtaalTriggers an Emergency Pack => No
2017-04-20 10:19mtaalRelationship addedcaused by 0035541
2017-04-24 17:30mtaalStatusnew => scheduled
2017-04-27 13:04hgbotCheckin
2017-04-27 13:04hgbotNote Added: 0096228
2017-04-27 13:04hgbotStatusscheduled => resolved
2017-04-27 13:04hgbotResolutionopen => fixed
2017-04-27 13:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8c56e46b0bd3fac322bf9bc1e07a367f04bd88bd [^]
2017-05-01 16:39mtaalReview Assigned To => AugustoMauch
2017-05-18 10:49AugustoMauchNote Added: 0096658
2017-05-18 10:49AugustoMauchStatusresolved => closed
2017-07-12 11:15AugustoMauchRelationship addedhas duplicate 0036470

Notes
(0096228)
hgbot   
2017-04-27 13:04   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 8c56e46b0bd3fac322bf9bc1e07a367f04bd88bd
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Apr 27 13:04:08 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8c56e46b0bd3fac322bf9bc1e07a367f04bd88bd [^]

fixes issue 35804: MobileServerUtils: Incorrectly comparing string values using != instead of equals method
Check against "0" using equals

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerUtils.java
---
(0096658)
AugustoMauch   
2017-05-18 10:49   
Code reviewed and verified