rootvector2 opened a new pull request, #702: URL: https://github.com/apache/commons-collections/pull/702
`OrderedProperties` keeps a parallel `orderedKeys` set that backs `keys()`, `keySet()`, `entrySet()` and `toString()`, but `compute()` and `merge()` only ever add to it. both operations remove the mapping from the backing `Hashtable` when the remapping function returns `null`, so after `compute(key, (k, v) -> null)` on a present key the mapping is gone yet the key still shows up in `keySet()`, `size()` disagrees with the key view, and `toString()` throws `NullPointerException` on the stale key's null value. remove the key from `orderedKeys` when the result is `null`. a `Hashtable` never stores null values, so a null result means the mapping was removed, which is what the existing `remove()` overrides already do. found while auditing the ordered-view bookkeeping against the `Properties` contract; `SortedProperties` derives its keys live from `super.keySet()` and needs no change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
