rootvector2 commented on PR #728:
URL:
https://github.com/apache/commons-collections/pull/728#issuecomment-5463260018
Pushed the requested changes:
- `DualTreeBidiMapTest#testNextKeyAbsentKey` covers an absent key between
existing keys ("b" in {a, c, e}) plus one past the end, and
`UnmodifiableSortedMapTest#testNextKey` exercises the inherited decorator fix
directly.
- Switched both implementations to `NavigableMap.higherKey` when the
underlying map supports it. The `containsKey` guard has to stay though:
`higherKey` returns the least key strictly greater than the argument whether or
not it's present, so an absent in-range key would still get the successor
instead of null. It only handles the past-the-end case automatically.
- Hoisted the guard in `DualTreeBidiMap.nextKey` above the `OrderedMap`
delegation so both branches agree on absent keys.
- `previousKey` has the same absent-key inconsistency: it returns the
predecessor instead of null (no throw, since `headMap` already excludes the
key). I'll send that in a separate PR as you suggested.
Full default `mvn` goal is green.
--
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]