For every UUID (Unique Universal Identifier) assigned to an IdentifiedObject, SIS automatically keeps the association using weak references in an internal map. This allow to retrieve the object by UUID if the object is still alive in the JVM. The rational was that if UUID are truly unique, then there is few risk of ID clash even if we use a system-wide map. However this cause a number of risks:
- The "truly unique" hypothesis may not hold in practice. Consider for example the case were the user reloads many times the same ISO 19139 document. If the document contains an object with gco:uuid attribute, then the same UUID will be assigned many times - admitely to equivalent objects, but the user could have edited a previously loaded instance.
- In order to be truly effective, developers need to provide their own "UUID to object" mapping anyway, because the universe of UUIDs is large and the developers probably have some database for them. Our own management of "UUID assigned in the current JVM" is likely to overlap with the developer's database.
Applying the prudential rule "in case of doubt, leave it out", the proposal is to remove the automatic "UUIDs to objects" mapping, but keep this JIRA task in the archive in order to make easier to find the Subversion revision number to revert if this functionality is considered useful in a future SIS version.
As a minor side effect, the putIfAbsent method from WeakValueHashMap should also be removed. It was added for supporting the feature documented in this JIRA task at the cost of slight complication of implementation. Given that WeakValueHashMap is not real concurrent map, we may be better to avoid any ConcurrentMap method.