Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
Description
See pasted code below from ShellBasedIdMapping#updateMapInternal, LineA could return null value when the entry is not in the static mapping. Since map allows null key, so it's possible that lineB would add entry <null, value> to the map. This is not the desired behavior.
final Integer key = staticMapping.get(parseId(nameId[1])); <====lineA final String value = nameId[0]; if (map.containsKey(key)) { final String prevValue = map.get(key); if (value.equals(prevValue)) { // silently ignore equivalent entries continue; } reportDuplicateEntry( "Got multiple names associated with the same id: ", key, value, key, prevValue); continue; } if (map.containsValue(value)) { final Integer prevKey = map.inverse().get(value); reportDuplicateEntry( "Got multiple ids associated with the same name: ", key, value, prevKey, value); continue; } map.put(key, value); <==== lineB