Nicholas Hardy created COLLECTIONS-846:
------------------------------------------
Summary: Miscellaneous minor bug fixes and associated test
refactoring
Key: COLLECTIONS-846
URL: https://issues.apache.org/jira/browse/COLLECTIONS-846
Project: Commons Collections
Issue Type: Bug
Reporter: Nicholas Hardy
Tried to do this as some smaller patches but as part of producing test cases I
got more tests running under @Nested annotations and that raised a few more
test failures which I also wanted to include fixes for, so this ended up bigger
than I'd have preferred. Hard to otherwise go from green to green while passing
all tests for intervening patches. But can have another go at breaking it up if
you prefer.
Tried to find a JUnit5 friendly approach for handling the @Override BulkTest
pattern. I tried some different approaches but for this PR went back to just
using standard @Nested inner classes where overriding instances need to have
colliding names that shadow their superclass's own nested class. However I
can't find that behaviour well documented as an intended part of the @Nested
contract. Have some other versions in git history which can go back to if would
like to discuss.
Intended bug fixes:
* DualBidiMaps using reference equality where Object.equals is appropriate
* TreeBidiMap and PatriciaTrie implementations of OrderedMapIterator misbehave
when switching between next and previous
* AbstractSortedMapDecorator.nextKey throws exception on absent/null key
* CompositeMap.values.remove throws error for missing mutator unlike other
CompositeMap remove operations
* FixedSizeSortedMap.putAll has inverted condition for IllegalArgumentException
* UnmodifiableTrie.entrySet uses wrong set wrapper
Enabling tests changes:
* use @Nested for mapIterator, listIterator, map view tests where relevant,
replacing BulkTest overrides
* refactoring as a result of previous
* assertThrowsEither, cloneObject util functions
* refactored Map.putAll tests into additional cases
* create yet another intermediate abstract in AbstractIterableSortedMapTest to
combine tests from AbstractSortedMapTest and AbstractOrderedMapTest
--
This message was sent by Atlassian Jira
(v8.20.10#820010)