Project

General

Profile

Actions

bug #6389

closed

Returning a Map in cdmlib leads to data loss

Added by Patrick Plitzner about 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Highest
Assignee:
Patrick Plitzner
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
critical
Found in Version:

Description

I added the following method to IService/ServiceBase. I then invoked it on the taxeditor side in different places. The returned map on the taxeditor side never has the expected size of i but only contains the first half of the entries. On the cdmlib side it is completely filled.

    public Map returnMap() {
        Map map = new HashMap<>();
        for(int i=0;i<10;i++){
            map.put(i, i);
        }
        return map;
    }

In a quick search in the service methods I only found save methods also returning maps but I am not sure if the return values are used on the taxeditor side.

In Campanula production DB search for "India, Sikkim*" in the specimen editor. The type icon for the DerivedUnits seem to be placed randomly every time you search.
After a little investigation I found out that it was due to IOccurrenceService.listTypeDesignations(Collection specimens). The returned collection of SpecimenTypeDesignation is not equal to the one that you could create by iterating through all DerivedUnits and adding the result of DerivedUnit.getSpecimenTypeDesignations().
As this is nevertheless a very resource intensive call just for showing icons I replaced it.
But anyway this should be analyzed.

Actions

Also available in: Atom PDF