Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035996Retail ModulesStoreServerpublic2017-05-12 09:522017-06-05 16:40
AugustoMauch 
mtaal 
normalmajorhave not tried
closedno change required 
5
 
RR17Q2.1 
mtaal
No
0035996: getMobileServersForOrganization and getNodeIdsForOrganization methods should return copies, not original sets
The MobileServerProvider has two methods that return the list of mobile servers / mobile server keys that have access to a given organization, called getMobileServersForOrganization and getNodeIdsForOrganization respectively.

These methods returns a set given an organization ID. The problem is that if the invokers then modify the set, then the original structure maintained in MobileServerProvider will be modified too.

Those methods should return copies of the original sets, to prevent having those sets modified.
It has been very difficult to reproduce, and only managed to do it in an environment of the BUT's development team when they were testing the Copy Store functionality.

In any case, the change makes a lot of sense, and should be done even if it cannot be reproduced deterministically.

Return a copy of the sets instead of the original ones.

I tested the performance impact of making a copy of a set instead of returning the original one. With a set composed of 300 objects:
- Copying it once took 1ms
- Copying it 100 times took 2 ms
- Copying it 1000 times took 12 ms.
No tags attached.
blocks defect 0035982 closed AugustoMauch getMobileServersForOrganization and getNodeIdsForOrganization methods should return copies, not original sets 
Issue History
2017-05-15 16:20mtaalTypedefect => backport
2017-05-15 16:20mtaalTarget Version => RR17Q2.1
2017-05-15 16:21mtaalAssigned ToAugustoMauch => mtaal
2017-06-05 16:40mtaalNote Added: 0097139
2017-06-05 16:40mtaalStatusscheduled => closed
2017-06-05 16:40mtaalResolutionopen => no change required

Notes
(0097139)
mtaal   
2017-06-05 16:40   
we will not deliver Q2.1 version