From 4797acefbaf24044f401868743c99362e67d4274 Mon Sep 17 00:00:00 2001 From: Alex Herbert Date: Tue, 18 Feb 2020 23:07:19 +0000 Subject: [PATCH] Fixed checkstyle. Add missing newlines at end of files. Remove redundant modifiers. Fix incorrect Apache license header. Fix whitespace around elements. Remove tab characters. Fix right-curly location. Correct modifier order. --- src/assembly/src.xml | 2 +- src/changes/changes.xml | 2180 ++++++++--------- src/conf/checkstyle-suppressions.xml | 2 +- src/conf/checkstyle.xml | 2 +- .../commons/collections4/CollectionUtils.java | 22 +- .../apache/commons/collections4/Equator.java | 22 +- .../commons/collections4/IterableUtils.java | 2 +- .../commons/collections4/IteratorUtils.java | 6 +- .../commons/collections4/ListUtils.java | 28 +- .../apache/commons/collections4/SetUtils.java | 2 +- .../collections4/bag/AbstractMapBag.java | 4 +- .../collections4/bag/CollectionBag.java | 2 +- .../collections4/bag/CollectionSortedBag.java | 2 +- .../commons/collections4/bag/TreeBag.java | 2 +- .../collections4/bag/UnmodifiableBag.java | 4 +- .../bidimap/AbstractDualBidiMap.java | 2 +- .../collections4/bidimap/TreeBidiMap.java | 8 +- .../bloomfilter/AbstractBloomFilter.java | 19 +- .../bloomfilter/BitSetBloomFilter.java | 23 +- .../collections4/bloomfilter/BloomFilter.java | 15 +- .../bloomfilter/CountingBloomFilter.java | 19 +- .../bloomfilter/HasherBloomFilter.java | 15 +- .../bloomfilter/SetOperations.java | 27 +- .../bloomfilter/hasher/DynamicHasher.java | 15 +- .../bloomfilter/hasher/HashFunction.java | 15 +- .../hasher/HashFunctionIdentity.java | 15 +- .../hasher/HashFunctionIdentityImpl.java | 15 +- .../hasher/HashFunctionValidator.java | 15 +- .../bloomfilter/hasher/Hasher.java | 15 +- .../bloomfilter/hasher/Shape.java | 19 +- .../bloomfilter/hasher/StaticHasher.java | 15 +- .../hasher/function/MD5Cyclic.java | 15 +- .../hasher/function/Murmur128x86Cyclic.java | 15 +- .../hasher/function/Murmur32x86Iterative.java | 15 +- .../hasher/function/ObjectsHashIterative.java | 15 +- .../hasher/function/package-info.java | 17 +- .../bloomfilter/hasher/package-info.java | 17 +- .../bloomfilter/package-info.java | 16 +- .../comparators/BooleanComparator.java | 2 +- .../comparators/ComparatorChain.java | 4 +- .../comparators/NullComparator.java | 25 +- .../collections4/functors/IfTransformer.java | 2 +- .../iterators/BoundedIterator.java | 23 +- .../collections4/iterators/IteratorChain.java | 2 +- .../iterators/IteratorIterable.java | 25 +- .../iterators/NodeListIterator.java | 11 +- .../iterators/PeekingIterator.java | 15 +- .../iterators/PushbackIterator.java | 15 +- .../iterators/SingletonListIterator.java | 2 +- .../iterators/SkippingIterator.java | 23 +- .../iterators/ZippingIterator.java | 2 +- .../collections4/keyvalue/MultiKey.java | 3 +- .../collections4/keyvalue/TiedMapEntry.java | 2 +- .../collections4/map/AbstractHashedMap.java | 6 +- .../collections4/map/AbstractLinkedMap.java | 2 +- .../map/AbstractReferenceMap.java | 10 +- .../commons/collections4/map/Flat3Map.java | 8 +- .../commons/collections4/map/LRUMap.java | 2 +- .../commons/collections4/map/LazyMap.java | 6 +- .../collections4/map/LazySortedMap.java | 22 +- .../collections4/map/ListOrderedMap.java | 2 +- .../collections4/map/MultiValueMap.java | 6 +- .../collections4/map/SingletonMap.java | 4 +- .../collections4/map/StaticBucketMap.java | 2 +- .../multimap/AbstractListValuedMap.java | 6 +- .../multimap/AbstractMultiValuedMap.java | 8 +- .../multimap/AbstractSetValuedMap.java | 3 +- .../multiset/AbstractMapMultiSet.java | 2 +- .../multiset/AbstractMultiSet.java | 4 +- .../multiset/UnmodifiableMultiSet.java | 2 +- .../apache/commons/collections4/overview.html | 28 +- .../properties/AbstractPropertiesFactory.java | 12 +- .../sequence/SequencesComparator.java | 4 +- .../trie/AbstractBitwiseTrie.java | 6 +- .../trie/AbstractPatriciaTrie.java | 86 +- .../trie/analyzer/StringKeyAnalyzer.java | 2 +- src/site/xdoc/bloomFilters.xml | 24 +- src/site/xdoc/history.xml | 12 +- src/site/xdoc/pick.xml | 10 +- src/site/xdoc/release_3_2_2.xml | 4 +- src/site/xdoc/release_4_0.xml | 70 +- src/site/xdoc/release_4_2.xml | 4 +- src/site/xdoc/security-reports.xml | 12 +- src/site/xdoc/userguide.xml | 20 +- .../commons/collections4/BagUtilsTest.java | 2 +- .../apache/commons/collections4/BulkTest.java | 6 +- .../collections4/CollectionUtilsTest.java | 22 +- .../collections4/IterableUtilsTest.java | 2 +- .../commons/collections4/ListUtilsTest.java | 4 +- .../commons/collections4/MapUtilsTest.java | 192 +- .../commons/collections4/SetUtilsTest.java | 9 +- .../collections4/SplitMapUtilsTest.java | 2 +- .../collections4/bag/CollectionBagTest.java | 2 +- .../bag/CollectionSortedBagTest.java | 2 +- .../collections4/bag/PredicatedBagTest.java | 2 +- .../AbstractOrderedBidiMapDecoratorTest.java | 4 +- .../bidimap/AbstractSortedBidiMapTest.java | 2 +- .../bidimap/DualTreeBidiMap2Test.java | 6 +- .../bloomfilter/AbstractBloomFilterTest.java | 15 +- .../bloomfilter/BitSetBloomFilterTest.java | 15 +- .../bloomfilter/CountingBloomFilterTest.java | 32 +- .../DefaultBloomFilterMethodsTest.java | 19 +- .../bloomfilter/HasherBloomFilterTest.java | 15 +- .../bloomfilter/SetOperationsTest.java | 15 +- .../hasher/DynamicHasherBuilderTest.java | 15 +- .../bloomfilter/hasher/DynamicHasherTest.java | 15 +- .../hasher/HashFuctionValidatorTest.java | 31 +- .../hasher/HashFunctionIdentityImplTest.java | 23 +- .../bloomfilter/hasher/ShapeTest.java | 17 +- .../bloomfilter/hasher/StaticHasherTest.java | 23 +- .../hasher/function/MD5CyclicTest.java | 16 +- .../function/Murmur128x86CyclicTest.java | 16 +- .../function/Murmur32x86IterativeTest.java | 16 +- .../function/ObjectsHashIterativeTest.java | 16 +- .../collection/AbstractCollectionTest.java | 14 +- .../comparators/BooleanComparatorTest.java | 2 +- .../comparators/FixedOrderComparatorTest.java | 2 +- .../AbstractAnyAllOnePredicateTest.java | 22 +- .../AbstractCompositePredicateTest.java | 4 +- .../functors/AbstractMockPredicateTest.java | 6 +- .../functors/AllPredicateTest.java | 2 +- .../iterators/BoundedIteratorTest.java | 23 +- .../iterators/CollatingIteratorTest.java | 2 +- .../iterators/FilterIteratorTest.java | 2 +- .../iterators/FilterListIteratorTest.java | 20 +- .../iterators/IteratorEnumerationTest.java | 15 +- .../iterators/IteratorIterableTest.java | 23 +- .../iterators/NodeListIteratorTest.java | 11 +- .../iterators/PeekingIteratorTest.java | 16 +- .../iterators/PermutationIteratorTest.java | 2 +- .../iterators/PushbackIteratorTest.java | 17 +- .../iterators/SkippingIteratorTest.java | 23 +- .../UnmodifiableMapIteratorTest.java | 6 +- .../UnmodifiableOrderedMapIteratorTest.java | 2 +- .../junit/ObjectToStringComparator.java | 2 +- .../collections4/keyvalue/MultiKeyTest.java | 25 +- .../collections4/list/AbstractListTest.java | 2 +- .../list/NodeCachingLinkedListTest.java | 4 +- .../collections4/list/SetUniqueListTest.java | 16 +- .../collections4/map/AbstractMapTest.java | 18 +- .../map/AbstractSortedMapTest.java | 4 +- .../collections4/map/EmptyMapMutator.java | 8 +- .../commons/collections4/map/LazyMapTest.java | 4 +- .../collections4/map/LazySortedMapTest.java | 20 +- .../collections4/map/MultiValueMapTest.java | 8 +- .../map/PredicatedSortedMapTest.java | 12 +- .../collections4/map/ReferenceMapTest.java | 6 +- .../collections4/map/TransformedMapTest.java | 2 +- .../map/UnmodifiableSortedMapTest.java | 2 +- .../multimap/AbstractMultiValuedMapTest.java | 2 +- .../multimap/ArrayListValuedHashMapTest.java | 2 +- .../TransformedMultiValuedMapTest.java | 2 +- .../UnmodifiableMultiValuedMapTest.java | 4 +- .../multiset/UnmodifiableMultiSetTest.java | 8 +- .../apache/commons/collections4/overview.html | 28 +- .../AbstractPropertiesFactoryTest.java | 4 +- .../properties/EmptyPropertiesTest.java | 2 +- .../collections4/queue/AbstractQueueTest.java | 2 +- .../queue/CircularFifoQueueTest.java | 2 +- .../queue/UnmodifiableQueueTest.java | 2 +- .../collections4/set/EmptySetMutator.java | 2 +- .../splitmap/TransformedSplitMapTest.java | 4 +- .../collections4/trie/PatriciaTrieTest.java | 2 +- 163 files changed, 2073 insertions(+), 2085 deletions(-) diff --git a/src/assembly/src.xml b/src/assembly/src.xml index 5b216ff20..963aced9b 100644 --- a/src/assembly/src.xml +++ b/src/assembly/src.xml @@ -38,7 +38,7 @@ src - **/*.cgi + **/*.cgi diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 578ed5a04..c575bff44 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -1,1090 +1,1090 @@ - - - - - Apache Commons Collections Release Notes - - - - - JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented - - - Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs. - - - Simplify two remove-if loops #77. - - - Add lambdas function to provide default values in MapUtils #81. - - - A potential misleading comment #82. - - - Using existing class in example given in Javadocs. #85. - - - Add test cases to IteratorUtilsTest #86. - - - Fix typos in release notes and Javadoc for AbstractHashedMap and AbstractHashedMapTest #88. - - - Update size to capacity for GrowthList #90. - - - Test subMap and tailMap #94. - - - Add junit for add, remove, setCount and entrySet in the UnmodifiableMultiSetTest #95. - - - Add two test cases in UnmodifiableQueueTest #96. - - - Update two test cases in AbstractMultiValuedMapTest testPutAll_map1 testPutAll_map2 #97. - - - TransformedSortedBagTest should work with TransformedSortedBag, not TransformedBag #98. - - - Add a test case for AbstractMultiValuedMapTest testToString() #100. - - - Update some map test cases #104. - - - Add three test cases in UnmodifiableQueueTest #105. - - - Add CollectionUtils removeRange, removeCount #91. - - - Add a test case AbstractMultiValuedMapTest#testMultiValuedMapIterator() #108. - - - Remove the parentheses in the error message in CircularFifoQueue #107. - - - Add junit for getWithNull and subList in LazyListTest; #103. - - - Add test cases to ArrayListValuedHashMapTest; #106. - - - Add test cases in UnmodifiableMultiValuedMapTest; #102. - - - [test] org.easymock:easymock 4.0.2 -> 4.1. - - - Encountered an IllegalStateException while traversing with Flat3Map.entrySet(). #115. - - - Fix inconsistent @throws comments in ListOrderedSet #125. - - - Add missing @throws comment for SwitchTransformer.switchTransformer. #124. - - - Fix inconsistent @throws comments in DefaultedMap #123. - - - Fix links to release notes and update contents for 4.4 #127. - - - Add org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration). - - - BloomFilter contribution. - - - [test] Update JUnit from 4.12 to 4.13. - - - [build] Update Apache commons-parent from 48 to 50. - - - Add org.apache.commons.collections4.properties.PropertiesFactory.EMPTY_PROPERTIES. - - - [build] Update Jacoco from 0.8.4 to 0.8.5. - - - [test] Update org.easymock:easymock 4.1 -> 4.2. - - - MultiKey.getKeys class cast exception. - - - Let org.apache.commons.collections4.properties.[Sorted]PropertiesFactory accept XML input. - - - - - NullPointerExceptions in CompositeCollection, CompositeSet, and CompositeMap. - - - Implement Collection's removeIf(). - - - Fix LRUMap exception message. - - - Create a PropertiesFactory and SortedPropertiesFactory. - - - Support Transformer for LazyList #52. - - - Make use of FunctionalInterface #48. - - - Don't include email address in Exception messages. - - - - - Use boolean operator for boolean result. - - - Update platform requirement from Java 7 to 8. - - - Link to Javadoc API broken. - - - Replace use of deprecated Class#newInstance() PR #49. - - - AbstractReferenceMap made easier for subclassing; PR #51. - - - StackOverflowError in SetUniqueList.add() when it receives itself. - - - The PassiveExpiringMap#put() method should return the previous record only if not expired. - - - Add SetUtils.unmodifiableSet(T... items) method. - - - MultiSet.Entry::getCount() isn't 0 after removing the last element. - - - - - Add test for MultiSetUtils - - - HashEntry array object naming data initialized with double the size during deserialization. - - - Unit tests MapUtilsTest and ListIteratorWrapperTest no longer fail on Java 9. - - - Intermittent test failures in Windows for HashSetValuedHashMap. - - - Uncomment test in AbstractMapTest regarding LRUMap equals. - - - Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility. - - - Fix site build on Java 8. - - - Update Javadoc to Build on Java 1.8. - - - Build status, Coverage status and Maven central weren't in README.md - - - Improve efficiency of DefaultedMap.get. - - - Small improvements for generics, conditional statements, and warnings suppressions. - - - Update platform from Java 6 to Java 7. - - - Web site spelling error: MultiValuedMapeList. - - - Correction of Javadoc for org.apache.commons.collections4.functors.CatchAndRethrowClosure. - - - Add null-safe MapUtils.size(Map<?, ?>) method. - - - PatriciaTrie prefixMap clear throws NullPointerException. - - - Add class SortedProperties to sort keys. - - - org.apache.commons.collections4.ListUtils.union(List, List) should pre-allocate result list. - - - Update org.apache.commons.collections4.CollectionUtils.addAll(Collection<C>, C[]) to addAll(Collection<C>, C...). - - - Add CollectionUtils containsAny method for primitive array: org.apache.commons.collections4.CollectionUtils.containsAny(Collection<?>, T...). - - - Synchronized queue wrapper in QueueUtils. - - - Add org.apache.commons.collections4.IteratorUtils.first(Iterator). - - - Add org.apache.commons.collections4.IterableUtils.first(Iterable). - - - The verification of unsupported iterator methods is not complete. - - - ListUtils.partition potential integer overflow. - - - - - Added new interfaces "MultiValuedMap", "ListValuedMap" and "SetValuedMap" - as a replacement for "MultiMap". Decorators and implementations reside in - the "multimap" package and a "MultiMapUtils" class has been added. - The existing interface "MultiMap" as well as the concrete implementation - "MultiValueMap" has been deprecated. - - - Deprecated various method in "CollectionUtils" in favor of similar - methods in the newly introduced "IterableUtils". - - - Serialization support for unsafe classes in the functor package - has been removed as this can be exploited for remote code execution - attacks. Classes considered to be unsafe are: CloneTransformer, - ForClosure, InstantiateFactory, InstantiateTransformer, InvokerTransformer, - PrototypeCloneFactory, PrototypeSerializationFactory, WhileClosure. - - - Added validation when de-serializing a "MultiValueMap#ReflectionFactory": - only Collection classes are allowed, otherwise an UnsupportedOperationException - will be thrown during de-serialization. - - - Added new MultiSet interface which is intended to be a replacement for - the Bag interface. The main difference is that a MultiSet is fully compatible - to the Collection contract. - - - Subclasses of MultiKey did not re-calculate their hashcode after de-serialization. - - - Added set operations to "SetUtils": union, difference, intersection and disjunction. - The operations return a view of the result that is backed by the input sets. - - - All constructors and static factory methods will now throw a "NullPointerException" if - a required input argument is null. Previously sometimes a "IllegalArgumentException" was used. - - - Deprecated methods "synchronizedCollection(Collection)" and "unmodifiableCollection(Collection)" - in class "CollectionUtils", the corresponding methods in "java.util.Collections" should be used instead. - - - "IteratorUtils#collate(...)" methods did not use natural ordering when a - null comparator was provided. - - - Added support to specify the initial size of a "LRUMap". - - - Added decorators for "NavigableSet" interface. - - - Added new class "FluentIterable" to support a fluent API for manipulating - Iterable instances. Additionally various supporting methods have been - added to "IterableUtils" and "IteratorUtils". - - - Added new "ZippingIterator" and factory methods "IteratorUtils#zippingIterator(...)". - - - Added new decorator "SkippingIterator" and factory methods "IteratorUtils#skippingIterator(...)". - - - Added method "SetUtils#newIdentityHashSet()" which returns a new identity HashSet - using reference-equality instead of object-equality. - - - Upgraded minimum java requirement to Java 6 (up from Java 5). - - - Added method "LRUMap#get(Object, boolean)" that allows to query the map - without affecting the least recently used order. - - - Changed return type of "ListOrderedSet#remove(int)" from Object to the generic type parameter. - - - Added clarification to javadoc of "TreeBag#add(Object)" wrt null arguments. - - - Added "toString(...)" methods to newly created "IterableUtils" and existing "IteratorUtils" - to get a string representation of an Iterable/Iterator instance similar to "Arrays#toString(...)". - - - Reverted performance improvement for "SetUniqueList#retainAll(Collection)" - introduced in 4.0. Added clarifying javadoc wrt runtime complexity instead. - - - Reverted performance improvement for "ListOrderedSet#retainAll(Collection)" - introduced in 4.0. Added clarifying javadoc wrt runtime complexity instead. - - - Added a Builder for "PredicatedCollection". Elements added to the builder - that fail the predicate will not throw an IllegalArgumentException. The builder - supports creating predicated lists, bags, sets and queues. - - - Documented runtime complexity of "CollectionUtils#removeAll(Collection, Collection). - - - "AbstractCollectionDecorator" doesn't forward equals and hashCode anymore. - - - Documented runtime complexity of "CollectionUtils#retainAll(Collection, Collection). - - - "AbstractHashedMap" still inherits from "AbstractMap", contrary to what - the class javadoc stated. The inheritance will now be removed in v5.0. - - - Changed scope of "CircularFifoQueue#isAtFullCapacity()" to public. - - - The map returned by "PatriciaTrie#prefixMap()" did not contain all keys - that are prefixed by the given search key in some rare cases. - - - Added new methods "IterableUtils#partition(...)" to partition an input collection - into separate output collections based on evaluation of one or more predicates. - - - Harmonized signature of factory methods for functor-related classes which take - a collection as input with their array counterparts. - - - Added overloaded method "CollectionUtils#get(Enumeration, int)" and simplified - code for "CollectionUtils#get(Object, int)". - - - Improved check for null input in "MapUtils#putAll(Map, Object[])". - - - Added clarifying javadoc wrt runtime complexity of "CollectionBag#retainAll". - - - Added methods "removeAll(...)" and "retainAll(...)" to "CollectionUtils" that perform - equality checks using the provided "Equator" object instead of "Object#equals()". - - - Use correct type bounds in - "CollectionUtils#isEqualCollection(Collection, Collection, Equator)" to - prevent a "ClassCastException" at runtime for invalid inputs. - - - Removed unneeded private method in "PassiveExpiringMap". - - - Added clarification to the javadoc of "MapUtils#toProperties(Map)" in case - of null keys/values. - - - "ListOrderedSet#listOrderedSet(List)" did not remove duplicates from the - input list as advertised in the javadoc. - - - "MultiKeyMap" was throwing a "NullPointerException" for various operations - if two key arguments have been used and the second was "null". - - - Updated code example for "PredicatedList". - - - "TransformingComparator" and "FixedOrderComparator" did not comply with - the contract of "Object#equals". - - - Fix compilation errors when using source level 1.8 and a recent java 8 compiler. - - - Clarified javadoc of "CollectionBag" wrt changes from the original Bag interface. - - - Removed wrong type bounds for "ComparatorUtils#chainedComparator(...)". - - - Added javadoc clarification to class "CollectionUtils" that input objects which - override "Object#equals(Object)" must also maintain the general contract of - "Object#hashCode()" as various utility methods take advantage of sets/maps/bags. - - - Added new transformer "IfTransformer" and factory methods "TransformerUtils#ifTransformer(...)" - which replace "TransformerUtils#switchTransformer(Predicate, Transformer, Transformer)". - - - Added new decorator "BoundedIterator" and factory methods "IteratorUtils#boundedIterator(...)". - - - - - Resolved generic parameter inconsistency for various static fields, e.g. BagUtils.EMPTY_BAG, - TruePredicate.INSTANCE and many others. All accessible static fields use raw types so that - they can be used directly without explicit casting. To avoid compiler warnings about unchecked - conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag(). - - - Renamed methods "V MultiKeyMap#remove(Object, Object, ...)" to - "V MultiKeyMap#removeMultiKey(Object, Object, ...)" to avoid future conflicts - with a default method of the Map interface in Java 8. - - - Renamed "V MultiMap#remove(K, V)" to "boolean MultiMap#removeMapping(K, V)" - to avoid future conflicts with a default method of the Map interface in Java 8. - - - Refactored the test framework for Bag implementations to extend from - "AbstractCollectionTest" by decorating the concrete Bag instance with - a CollectionBag or CollectionSortedBag. - - - "CollectionBag" will now also respect the contract of the decorated bag in case - a null argument is provided to either removeAll or retainAll. - - - Added bag decorator "CollectionSortedBag" which decorates a SortedBag to make it - comply with the Collection contract. - - - "UnmodifiableBoundedCollection" does now also implement the marker interface "Unmodifiable" - similar as all other unmodifiable decorators. - - - "UnmodifiableTrie#unmodifiableTrie(Trie)" will not decorate again an already - unmodifiable Trie. Also the return type has been changed to "Trie" to be consistent - with other Unmodifiable decorators. - - - Moved "Equator" interface to base package for consistency. - - - Added "CollectionsUtils#matchesAll(Iterable, Predicate)" to test if all elements - of a collection match a given predicate. - - - Accept wildcard input where possible, e.g. in copy-constructors, Unmodifiable* decorators - and iterators. - - - No collision detection/resolution was performed when calling "CompositeSet#addComposited(...)" - with more than one Set as argument. Additionally use varargs parameters instead of arrays - in CompositeSet and CompositeCollection constructor and addComposited method. - - - Narrow return type of "BidiMap#values()" to Set as the values are required to be unique. - - - Fixed conversion of timeout parameters in "PassiveExpiringMap". - - - Exception in "ListOrderedMap#putAll" if map contains null values. - - - Made field "collection" in class "AbstractCollectionDecorator" private and added - setter "setCollection(Collection)" with scope protected to set the decorated collection - during de-serialization. - - - Improved performance of "AbstractMapBag#containsAll(Collection)" by returning immediately - after a difference has been found. - - - Renamed class "TransformedMap" in package "splitmap" to "TransformedSplitMap" to avoid - name clash with similar class in package "map". - - - Added bag decorator "CollectionBag" which decorates a bag to make it comply with the - Collection contract. - - - Replaced "Collection" with "Iterable" for method arguments where applicable. - - - Added "PushbackIterator" decorator to support pushback of elements during iteration. - - - Added "PeekingIterator" decorator to support one-element lookahead during iteration. - - - Added additional clarification to javadoc of interface "Put" wrt return type of - "put(Object, Object)" method. - - - Changed "IteratorChain" to use internally a "Queue" instead of a "List". Iterators are - removed from the queue once used and can be garbage collected after being exhausted. - Additionally removed the methods "setIterator(Iterator)" and "getIterators()". - - - Removed method "setArray(Object)" in class ArrayIterator and method "setArray(Object[])" - in class ObjectArrayIterator and made fields array, startIndex and endIndex final. - - - Removed unused class "AbstractUntypedCollectionDecorator<E, D>". - - - Added methods "ListUtils#longestCommonSubsequence(...)" to get the longest common subsequence - of arbitrary lists or CharSequences. - - - Changed scope of fields to private where appropriate. - - - An iterator over a "Flat3Map#entrySet()" will now return - independent Map.Entry objects that will not change anymore when - the iterator progresses. - - - Several closure and transformer implementations in the functors package - will now copy an array as input to their constructor (e.g. ChainedClosure). - - - Change base package to org.apache.commons.collections4. - - - The constructors for all Utils classes are now private to prevent instantiation. - - - Added methods "forAllButLastDo(Collection, Closure)" and "forAllButLastDo(Iterator, Closure)" - to class "CollectionUtils". - - - Tree traversal with a TreeListIterator will not be affected anymore by - the removal of an element directly after a call to previous(). - - - Added method "CollectionUtils#isEqualCollection(Collection, Collection, Equator)". - - - Adapt and/or ignore several unit tests when run on a IBM J9 VM (specification version 1.6.0) - due to a faulty "java.util.TreeMap" implementation. - - - SetUniqueList.set(int, E) now works correctly if the object to be inserted - is already placed at the given position. - - - MultiKeyMap.clone() now correctly calls super.clone(). - - - Added "emptyIfNull" methods to classes "CollectionUtils", "ListUtils", "SetUtils" - and "MapUtils". - - - Improve performance of "TreeList#addAll" and "TreeList(Collection)" by converting - the input collection into an AVL tree and efficiently merge it into the existing tree. - - - Replaced "Buffer" interface with "java.util.Queue". Kept "CircularFifoQueue" - as well as "Predicated", "Transformed" and "Unmodifiable" decorators. - - - Added method "CollectionUtils#containsAll(Collection, Collection)" with guaranteed - runtime complexity of O(n + m) and space complexity of O(n). This method may yield much - better performance than "Collection#containsAll(Collection)" depending on the use-case and - type of collection used. - - - Fixed performance issue in "SetUniqueList#retainAll" method for large collections. - - - Fixed performance issue in "ListOrderedSet#retainAll" method for large collections. - - - Improved performance of "ListOrderedMap#remove(Object)" method. - - - "CompositeSet" does not inherit from "CompositeCollection" anymore. The inner class - "SetMutator" has been updated accordingly. - - - Added method "CollectionUtils#permutations(Collection)" and class "PermutationIterator" - to generate unordered permutations of a collection. - - - Update javadoc for "ListUtils#lazyList()" and "ListUtils#fixedSizeList()". - - - Added clarifying javadoc wrt runtime complexity of "AbstractDualBidiMap#retainAll". - - - Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#retainAll". - - - Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#removeAll". - - - Fixed several compilation issues with older Java 1.6 compilers. - - - Improved performance of "removeAll()" method for sets returned by "DualHashBidiMap#entrySet()". - - - Improved performance of "CollectionUtils#subtract" methods. - - - Fixed possible "IndexOutOfBoundsException" in "ListOrderedMap#putAll". - - - Improved performance of "SetUniqueList#addAll" method. - - - Improved performance of "ListOrderedSet#addAll" method. - - - Improved performance of "SetUniqueList#removeAll". - - - Improved performance of "ListOrderedSet#remove(Object)" in case the object is - not contained in the Set. - - - Improved performance of "ListUtils#subtract" method. - - - Added "ListUtils#select" and "ListUtils#selectRejected" methods. - - - Added an implementation of Eugene Myers difference algorithm in package - o.a.c.c.sequence. - - - Added missing null check in "CollectionUtils#addIgnoreNull(Collection, Object)". - - - Added new method "get(int)" to "CircularFifoQueue". - - - Added "LazyIteratorChain" iterator. - - - Added "ListUtils#partition" method to split a List into consecutive sublists. - - - Fixed javadoc for "MapUtils#toProperties(Map)". - - - Clarified javadoc for "TransformerUtils#mapTransformer" for null input. - - - Clarified javadoc for "FactoryUtils#prototypeFactory" for null input. - - - Fixed inconsistent javadoc for "MapUtils#synchronizedMap(Map)". - - - Added "CollectionUtils#forAllDo" implementation which takes an "Iterator" as input. - - - Change maven coordinates to "org.apache.commons.commons-collections4". - - - Move the project structure to a standard maven layout. - - - Fixed infinite loop when calling "UnmodifiableBoundedCollection#unmodifiableBoundedCollection()". - - - Fixed javadoc for several methods wrt expected NullPointerExceptions. - - - Added method "ListUtils#defaultIfNull(List, List)". - - - TransformingComparator now supports different types for its input/output values. - - - "DualTreeBidiMap" now uses the correct comparator for the reverse map during de-serialization. - - - "TransformedMap" in the package "splitmap" can now be serialized. - - - "CollectionUtils#filter(Iterable, Predicate)" will now return whether the collection - has been modified. - - - Add method "CollectionUtils#filterInverse(Iterable, Predicate)". - - - "FilterListIterator#hasNext" does not throw a NullPointerException anymore - to comply to the Java iterator specification. - - - "ListUtils#intersection(List, List)" will now also work correctly if there - are duplicate elements in the provided lists. - - - "AbstractCollectionDecorator" will now use internally "decorated()" to access - the decorated collection. - - - Removed features which are now supported by the JDK. - - - Removed debug output in "MapUtils#getNumber(Map)". - - - Fixed javadoc for all "transformedXXX(XXX)" methods in the respective Utils classes - to clarify that existing objects in the list are not transformed. - - - Singleton classes in package "functors" are now correctly de-serialized. - - - "NOPClosure" is now a final class. - - - Removed broken methods "equals(Object)" and "hashCode()" in class "NOPClosure". - - - Simplified exceptions as the cause is available from the parent. - - - Fixed cache assignment for "TreeBidiMap#entrySet". - - - Synchronized access to lock in "StaticBucketMap#size()". - - - Added clarification to javadoc of "ListOrderedMap" that "IdentityMap" and - "CaseInsensitiveMap" are not supported. - - - Improve javadoc of "CollatingIterator" wrt the used "Comparator" and throw a - NullPointerException in "CollatingIterator#least" if no comparator is set. - - - "LRUMap#keySet()#remove(Object)" will not throw a "ConcurrentModificationException" anymore. - - - Improved performance of "ListUtils#intersection(List, List)". - - - Added serialVersionUID fields for "CompositeCollection", "CompositeSet", - "EmptyMapMutator", "EmptySetMutator". - - - Fields transformer and decorated in class "TransformingComparator" are now final. - - - Changed behavior of "CaseInsensitiveMap" constructor to be compliant with "HashMap" - in case the initial capacity is set to zero. - - - Added NodeListIterator and convenience methods in IteratorUtils to iterate over - a org.w3c.dom.NodeList. - - - Improved performance of "StaticBucketMap#putAll(Map)" by iterating over the entry set. - - - Avoid redundant null check in "IteratorUtils#getIterator(Object)". - - - Use a private method to populate the object in "AbstractHashedMap(Map)". - - - Fixed javadoc of "LRUMap" wrt to the maxSize parameter of the constructor. - - - Added new abstract class "CatchAndRethrowClosure" that re-throws any checked exception - as unchecked "FunctorException". - - - Use of final keyword where applicable, minor performance improvements by properly - initializing the capacity of newly created collections when known in advance. - - - "SetUniqueList#subList()" will now return an unmodifiable list as changes to it - may invalidate the parent list. - - - "SetUniqueList#subList()#contains(Object)" will now correctly check the subList - rather than the parent list. - - - Added method "CollectionUtils#subtract(Iterable, Iterable, Predicate)". - - - "SetUniqueList#set(int, Object)" will now correctly enforce the uniqueness constraint. - - - Improved javadoc for "Unmodifiable*" classes wrt behavior when the users tries - to modify the collection. - - - Calling "CollectionUtils#sizeIsEmpty(null)" will now return true. - - - Added methods "CollectionUtils#collate(...)" to merge two sorted Collections - into a sorted List using the standard O(n) merge algorithm. - - - "CaseInsensitiveMap" will now convert input strings to lower-case in a - locale-independant manner. - - - Added support for using custom "Equator" objects in "EqualPredicate". - - - Added method "CollatingIterator#getIteratorIndex()". - - - Fixed javadoc for "ListUtils#transformedList(List)" to clarify that existing objects - in the list are not transformed. - - - Added method "CollectionUtils#extractSingleton(Collection)". - - - Added serialization support for "TreeBidiMap". - - - The predicate that rejected an object to be added to a "PredicatedCollection" - is now contained in the respective exception message. - - - Added "IndexedCollection" collection decorator which provides a map-like - view on an existing collection. - - - Added serialization support for "FixedOrderComparator" and "TransformingComparator". - - - "MultiKey" will now be correctly serialized/de-serialized. - - - "TreeBag" will now only accept "Comparable" objects as input when used with natural ordering. - - - Added methods "MapUtils#populateMap(MultiMap, ...)" to support also "MultiMap" instances - as input. - - - Fixed javadoc for methods "firstKey()" and "lastKey()" in class "AbstractLinkedMap". - - - "Flat3Map#remove(Object)" will now return the correct value mapped to the removed key - if the size of the map is less or equal 3. - - - Added constructor "TransformingComparator(Transformer)". - - - Added "DualLinkedHashBidiMap" bidi map implementation. - - - Removed unused variables in "TreeBidiMap". - - - The static factory methods have been renamed from "getInstance()" to a camel-case - version of the class name, e.g. "truePredicate()" for class "TruePredicate". - - - "SetUniqueList.addAll(int, Collection)" now correctly add the collection at the - provided index. - - - Added "Equator" interface. - - - Added "PassiveExpiringMap" map decorator. - - - "MultiValueMap" is now serializable. - - - Added method "MultiValueMap#iterator()" to return a flattened version of - "entrySet().iterator()". Clarified javadoc for "entrySet()" that the returned Entry - objects are unflattened, i.e. the Entry object for a given key contains all values - mapped to this key. - - - Added method "ListUtils#indexOf(List, Predicate)". - - - Fixed several unit tests which were using parameters to "assertEquals(...)" in wrong order. - - - Return concrete class in static factory methods instead of base class interface - (except for Unmodifiable decorators). - - - "CollectionUtils#size(Collection)" now returns 0 when called with null as input. - - - Removed deprecated classes and methods. - - - "MultiValueMap#put(Object, Object)" and "MultiValueMap#putAll(Object, Collection)" - now correctly return if the map has changed by this operation. - - - Added method "ListOrderedMap#putAll(int, Map)". - - - Added new "Trie" interface with a first concrete implementation "PatriciaTrie" - together with decorators "Unmodifiable" and "Synchronized". - - - "CollectionUtils#addAll(...)" methods now return if the collection has been changed - by this operation. - - - "CompositeCollection", "CompositeMap" and "CompositeSet" are now serializable. - - - "CollectionUtils#removeAll" wrongly called "ListUtils#retainAll". - - - The "CollectionUtils#select(Collection, Predicate, Collection)" method will now - return the output collection. - - - Calling "setValue(Object)" on any Entry returned by a "Flat3Map" will now - correctly set the value for the current entry. - - - "MultiKey#toString()" will now use "Arrays#toString(List)". - - - Added support for resettable iterators in "IteratorIterable". - - - Added methods "MapUtils#populateMap(Map, Iterable, Transformer, ...)". - - - "CollectionUtils#forAllDo(Collection, Closure)" now returns the provided closure. - - - Make generic versions of all classes in collections. - - - Added class "ComparatorPredicate". - - - - - Serialization support for unsafe classes in the functor package is disabled - by default as this can be exploited for remote code execution attacks. - To re-enable the feature the system property "org.apache.commons.collections.enableUnsafeSerialization" - needs to be set to "true". - Classes considered to be unsafe are: CloneTransformer, ForClosure, InstantiateFactory, - InstantiateTransformer, InvokerTransformer, PrototypeCloneFactory, - PrototypeSerializationFactory, WhileClosure. - - - "ExtendedProperties" will now use a privileged action to access the - "file.separator" system property. In case the class does not have - permission to read system properties, the "File#separator" field will - be used instead. - - - Tree traversal with a TreeListIterator will not be affected anymore by - the removal of an element directly after a call to previous(). - - - SetUniqueList.set(int, Object) now works correctly if the object to be inserted - is already placed at the given position. - - - Removed debug output in "MapUtils#getNumber(Map)". - - - Fixed cache assignment for "TreeBidiMap#entrySet". - - - Synchronized access to lock in "StaticBucketMap#size()". - - - "SetUniqueList#subList()#contains(Object)" will now correctly check the subList - rather than the parent list. - - - "SetUniqueList#set(int, Object)" will now correctly enforce the uniqueness constraint. - - - "CaseInsensitiveMap" will now convert input strings to lower-case in a - locale-independent manner. - - - "MultiKey" will now be correctly serialized/de-serialized. - - - "Flat3Map#remove(Object)" will now return the correct value mapped to the removed key - if the size of the map is less or equal 3. - - - "SetUniqueList.addAll(int, Collection)" now correctly add the collection at the - provided index. - - - "MultiValueMap#put(Object, Object)" and "MultiValueMap#putAll(Object, Collection)" - now correctly return if the map has changed by this operation. - - - "CollectionUtils#removeAll" wrongly called "ListUtils#retainAll". - - - Calling "setValue(Object)" on any Entry returned by a "Flat3Map" will now - correctly set the value for the current entry. - - - - + + + + + Apache Commons Collections Release Notes + + + + + JavaDoc for FixedSizeList should warn that modifying underlying list is still allowed and is not prevented + + + Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs. + + + Simplify two remove-if loops #77. + + + Add lambdas function to provide default values in MapUtils #81. + + + A potential misleading comment #82. + + + Using existing class in example given in Javadocs. #85. + + + Add test cases to IteratorUtilsTest #86. + + + Fix typos in release notes and Javadoc for AbstractHashedMap and AbstractHashedMapTest #88. + + + Update size to capacity for GrowthList #90. + + + Test subMap and tailMap #94. + + + Add junit for add, remove, setCount and entrySet in the UnmodifiableMultiSetTest #95. + + + Add two test cases in UnmodifiableQueueTest #96. + + + Update two test cases in AbstractMultiValuedMapTest testPutAll_map1 testPutAll_map2 #97. + + + TransformedSortedBagTest should work with TransformedSortedBag, not TransformedBag #98. + + + Add a test case for AbstractMultiValuedMapTest testToString() #100. + + + Update some map test cases #104. + + + Add three test cases in UnmodifiableQueueTest #105. + + + Add CollectionUtils removeRange, removeCount #91. + + + Add a test case AbstractMultiValuedMapTest#testMultiValuedMapIterator() #108. + + + Remove the parentheses in the error message in CircularFifoQueue #107. + + + Add junit for getWithNull and subList in LazyListTest; #103. + + + Add test cases to ArrayListValuedHashMapTest; #106. + + + Add test cases in UnmodifiableMultiValuedMapTest; #102. + + + [test] org.easymock:easymock 4.0.2 -> 4.1. + + + Encountered an IllegalStateException while traversing with Flat3Map.entrySet(). #115. + + + Fix inconsistent @throws comments in ListOrderedSet #125. + + + Add missing @throws comment for SwitchTransformer.switchTransformer. #124. + + + Fix inconsistent @throws comments in DefaultedMap #123. + + + Fix links to release notes and update contents for 4.4 #127. + + + Add org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration). + + + BloomFilter contribution. + + + [test] Update JUnit from 4.12 to 4.13. + + + [build] Update Apache commons-parent from 48 to 50. + + + Add org.apache.commons.collections4.properties.PropertiesFactory.EMPTY_PROPERTIES. + + + [build] Update Jacoco from 0.8.4 to 0.8.5. + + + [test] Update org.easymock:easymock 4.1 -> 4.2. + + + MultiKey.getKeys class cast exception. + + + Let org.apache.commons.collections4.properties.[Sorted]PropertiesFactory accept XML input. + + + + + NullPointerExceptions in CompositeCollection, CompositeSet, and CompositeMap. + + + Implement Collection's removeIf(). + + + Fix LRUMap exception message. + + + Create a PropertiesFactory and SortedPropertiesFactory. + + + Support Transformer for LazyList #52. + + + Make use of FunctionalInterface #48. + + + Don't include email address in Exception messages. + + + + + Use boolean operator for boolean result. + + + Update platform requirement from Java 7 to 8. + + + Link to Javadoc API broken. + + + Replace use of deprecated Class#newInstance() PR #49. + + + AbstractReferenceMap made easier for subclassing; PR #51. + + + StackOverflowError in SetUniqueList.add() when it receives itself. + + + The PassiveExpiringMap#put() method should return the previous record only if not expired. + + + Add SetUtils.unmodifiableSet(T... items) method. + + + MultiSet.Entry::getCount() isn't 0 after removing the last element. + + + + + Add test for MultiSetUtils + + + HashEntry array object naming data initialized with double the size during deserialization. + + + Unit tests MapUtilsTest and ListIteratorWrapperTest no longer fail on Java 9. + + + Intermittent test failures in Windows for HashSetValuedHashMap. + + + Uncomment test in AbstractMapTest regarding LRUMap equals. + + + Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility. + + + Fix site build on Java 8. + + + Update Javadoc to Build on Java 1.8. + + + Build status, Coverage status and Maven central weren't in README.md + + + Improve efficiency of DefaultedMap.get. + + + Small improvements for generics, conditional statements, and warnings suppressions. + + + Update platform from Java 6 to Java 7. + + + Web site spelling error: MultiValuedMapeList. + + + Correction of Javadoc for org.apache.commons.collections4.functors.CatchAndRethrowClosure. + + + Add null-safe MapUtils.size(Map<?, ?>) method. + + + PatriciaTrie prefixMap clear throws NullPointerException. + + + Add class SortedProperties to sort keys. + + + org.apache.commons.collections4.ListUtils.union(List, List) should pre-allocate result list. + + + Update org.apache.commons.collections4.CollectionUtils.addAll(Collection<C>, C[]) to addAll(Collection<C>, C...). + + + Add CollectionUtils containsAny method for primitive array: org.apache.commons.collections4.CollectionUtils.containsAny(Collection<?>, T...). + + + Synchronized queue wrapper in QueueUtils. + + + Add org.apache.commons.collections4.IteratorUtils.first(Iterator). + + + Add org.apache.commons.collections4.IterableUtils.first(Iterable). + + + The verification of unsupported iterator methods is not complete. + + + ListUtils.partition potential integer overflow. + + + + + Added new interfaces "MultiValuedMap", "ListValuedMap" and "SetValuedMap" + as a replacement for "MultiMap". Decorators and implementations reside in + the "multimap" package and a "MultiMapUtils" class has been added. + The existing interface "MultiMap" as well as the concrete implementation + "MultiValueMap" has been deprecated. + + + Deprecated various method in "CollectionUtils" in favor of similar + methods in the newly introduced "IterableUtils". + + + Serialization support for unsafe classes in the functor package + has been removed as this can be exploited for remote code execution + attacks. Classes considered to be unsafe are: CloneTransformer, + ForClosure, InstantiateFactory, InstantiateTransformer, InvokerTransformer, + PrototypeCloneFactory, PrototypeSerializationFactory, WhileClosure. + + + Added validation when de-serializing a "MultiValueMap#ReflectionFactory": + only Collection classes are allowed, otherwise an UnsupportedOperationException + will be thrown during de-serialization. + + + Added new MultiSet interface which is intended to be a replacement for + the Bag interface. The main difference is that a MultiSet is fully compatible + to the Collection contract. + + + Subclasses of MultiKey did not re-calculate their hashcode after de-serialization. + + + Added set operations to "SetUtils": union, difference, intersection and disjunction. + The operations return a view of the result that is backed by the input sets. + + + All constructors and static factory methods will now throw a "NullPointerException" if + a required input argument is null. Previously sometimes a "IllegalArgumentException" was used. + + + Deprecated methods "synchronizedCollection(Collection)" and "unmodifiableCollection(Collection)" + in class "CollectionUtils", the corresponding methods in "java.util.Collections" should be used instead. + + + "IteratorUtils#collate(...)" methods did not use natural ordering when a + null comparator was provided. + + + Added support to specify the initial size of a "LRUMap". + + + Added decorators for "NavigableSet" interface. + + + Added new class "FluentIterable" to support a fluent API for manipulating + Iterable instances. Additionally various supporting methods have been + added to "IterableUtils" and "IteratorUtils". + + + Added new "ZippingIterator" and factory methods "IteratorUtils#zippingIterator(...)". + + + Added new decorator "SkippingIterator" and factory methods "IteratorUtils#skippingIterator(...)". + + + Added method "SetUtils#newIdentityHashSet()" which returns a new identity HashSet + using reference-equality instead of object-equality. + + + Upgraded minimum java requirement to Java 6 (up from Java 5). + + + Added method "LRUMap#get(Object, boolean)" that allows to query the map + without affecting the least recently used order. + + + Changed return type of "ListOrderedSet#remove(int)" from Object to the generic type parameter. + + + Added clarification to javadoc of "TreeBag#add(Object)" wrt null arguments. + + + Added "toString(...)" methods to newly created "IterableUtils" and existing "IteratorUtils" + to get a string representation of an Iterable/Iterator instance similar to "Arrays#toString(...)". + + + Reverted performance improvement for "SetUniqueList#retainAll(Collection)" + introduced in 4.0. Added clarifying javadoc wrt runtime complexity instead. + + + Reverted performance improvement for "ListOrderedSet#retainAll(Collection)" + introduced in 4.0. Added clarifying javadoc wrt runtime complexity instead. + + + Added a Builder for "PredicatedCollection". Elements added to the builder + that fail the predicate will not throw an IllegalArgumentException. The builder + supports creating predicated lists, bags, sets and queues. + + + Documented runtime complexity of "CollectionUtils#removeAll(Collection, Collection). + + + "AbstractCollectionDecorator" doesn't forward equals and hashCode anymore. + + + Documented runtime complexity of "CollectionUtils#retainAll(Collection, Collection). + + + "AbstractHashedMap" still inherits from "AbstractMap", contrary to what + the class javadoc stated. The inheritance will now be removed in v5.0. + + + Changed scope of "CircularFifoQueue#isAtFullCapacity()" to public. + + + The map returned by "PatriciaTrie#prefixMap()" did not contain all keys + that are prefixed by the given search key in some rare cases. + + + Added new methods "IterableUtils#partition(...)" to partition an input collection + into separate output collections based on evaluation of one or more predicates. + + + Harmonized signature of factory methods for functor-related classes which take + a collection as input with their array counterparts. + + + Added overloaded method "CollectionUtils#get(Enumeration, int)" and simplified + code for "CollectionUtils#get(Object, int)". + + + Improved check for null input in "MapUtils#putAll(Map, Object[])". + + + Added clarifying javadoc wrt runtime complexity of "CollectionBag#retainAll". + + + Added methods "removeAll(...)" and "retainAll(...)" to "CollectionUtils" that perform + equality checks using the provided "Equator" object instead of "Object#equals()". + + + Use correct type bounds in + "CollectionUtils#isEqualCollection(Collection, Collection, Equator)" to + prevent a "ClassCastException" at runtime for invalid inputs. + + + Removed unneeded private method in "PassiveExpiringMap". + + + Added clarification to the javadoc of "MapUtils#toProperties(Map)" in case + of null keys/values. + + + "ListOrderedSet#listOrderedSet(List)" did not remove duplicates from the + input list as advertised in the javadoc. + + + "MultiKeyMap" was throwing a "NullPointerException" for various operations + if two key arguments have been used and the second was "null". + + + Updated code example for "PredicatedList". + + + "TransformingComparator" and "FixedOrderComparator" did not comply with + the contract of "Object#equals". + + + Fix compilation errors when using source level 1.8 and a recent java 8 compiler. + + + Clarified javadoc of "CollectionBag" wrt changes from the original Bag interface. + + + Removed wrong type bounds for "ComparatorUtils#chainedComparator(...)". + + + Added javadoc clarification to class "CollectionUtils" that input objects which + override "Object#equals(Object)" must also maintain the general contract of + "Object#hashCode()" as various utility methods take advantage of sets/maps/bags. + + + Added new transformer "IfTransformer" and factory methods "TransformerUtils#ifTransformer(...)" + which replace "TransformerUtils#switchTransformer(Predicate, Transformer, Transformer)". + + + Added new decorator "BoundedIterator" and factory methods "IteratorUtils#boundedIterator(...)". + + + + + Resolved generic parameter inconsistency for various static fields, e.g. BagUtils.EMPTY_BAG, + TruePredicate.INSTANCE and many others. All accessible static fields use raw types so that + they can be used directly without explicit casting. To avoid compiler warnings about unchecked + conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag(). + + + Renamed methods "V MultiKeyMap#remove(Object, Object, ...)" to + "V MultiKeyMap#removeMultiKey(Object, Object, ...)" to avoid future conflicts + with a default method of the Map interface in Java 8. + + + Renamed "V MultiMap#remove(K, V)" to "boolean MultiMap#removeMapping(K, V)" + to avoid future conflicts with a default method of the Map interface in Java 8. + + + Refactored the test framework for Bag implementations to extend from + "AbstractCollectionTest" by decorating the concrete Bag instance with + a CollectionBag or CollectionSortedBag. + + + "CollectionBag" will now also respect the contract of the decorated bag in case + a null argument is provided to either removeAll or retainAll. + + + Added bag decorator "CollectionSortedBag" which decorates a SortedBag to make it + comply with the Collection contract. + + + "UnmodifiableBoundedCollection" does now also implement the marker interface "Unmodifiable" + similar as all other unmodifiable decorators. + + + "UnmodifiableTrie#unmodifiableTrie(Trie)" will not decorate again an already + unmodifiable Trie. Also the return type has been changed to "Trie" to be consistent + with other Unmodifiable decorators. + + + Moved "Equator" interface to base package for consistency. + + + Added "CollectionsUtils#matchesAll(Iterable, Predicate)" to test if all elements + of a collection match a given predicate. + + + Accept wildcard input where possible, e.g. in copy-constructors, Unmodifiable* decorators + and iterators. + + + No collision detection/resolution was performed when calling "CompositeSet#addComposited(...)" + with more than one Set as argument. Additionally use varargs parameters instead of arrays + in CompositeSet and CompositeCollection constructor and addComposited method. + + + Narrow return type of "BidiMap#values()" to Set as the values are required to be unique. + + + Fixed conversion of timeout parameters in "PassiveExpiringMap". + + + Exception in "ListOrderedMap#putAll" if map contains null values. + + + Made field "collection" in class "AbstractCollectionDecorator" private and added + setter "setCollection(Collection)" with scope protected to set the decorated collection + during de-serialization. + + + Improved performance of "AbstractMapBag#containsAll(Collection)" by returning immediately + after a difference has been found. + + + Renamed class "TransformedMap" in package "splitmap" to "TransformedSplitMap" to avoid + name clash with similar class in package "map". + + + Added bag decorator "CollectionBag" which decorates a bag to make it comply with the + Collection contract. + + + Replaced "Collection" with "Iterable" for method arguments where applicable. + + + Added "PushbackIterator" decorator to support pushback of elements during iteration. + + + Added "PeekingIterator" decorator to support one-element lookahead during iteration. + + + Added additional clarification to javadoc of interface "Put" wrt return type of + "put(Object, Object)" method. + + + Changed "IteratorChain" to use internally a "Queue" instead of a "List". Iterators are + removed from the queue once used and can be garbage collected after being exhausted. + Additionally removed the methods "setIterator(Iterator)" and "getIterators()". + + + Removed method "setArray(Object)" in class ArrayIterator and method "setArray(Object[])" + in class ObjectArrayIterator and made fields array, startIndex and endIndex final. + + + Removed unused class "AbstractUntypedCollectionDecorator<E, D>". + + + Added methods "ListUtils#longestCommonSubsequence(...)" to get the longest common subsequence + of arbitrary lists or CharSequences. + + + Changed scope of fields to private where appropriate. + + + An iterator over a "Flat3Map#entrySet()" will now return + independent Map.Entry objects that will not change anymore when + the iterator progresses. + + + Several closure and transformer implementations in the functors package + will now copy an array as input to their constructor (e.g. ChainedClosure). + + + Change base package to org.apache.commons.collections4. + + + The constructors for all Utils classes are now private to prevent instantiation. + + + Added methods "forAllButLastDo(Collection, Closure)" and "forAllButLastDo(Iterator, Closure)" + to class "CollectionUtils". + + + Tree traversal with a TreeListIterator will not be affected anymore by + the removal of an element directly after a call to previous(). + + + Added method "CollectionUtils#isEqualCollection(Collection, Collection, Equator)". + + + Adapt and/or ignore several unit tests when run on a IBM J9 VM (specification version 1.6.0) + due to a faulty "java.util.TreeMap" implementation. + + + SetUniqueList.set(int, E) now works correctly if the object to be inserted + is already placed at the given position. + + + MultiKeyMap.clone() now correctly calls super.clone(). + + + Added "emptyIfNull" methods to classes "CollectionUtils", "ListUtils", "SetUtils" + and "MapUtils". + + + Improve performance of "TreeList#addAll" and "TreeList(Collection)" by converting + the input collection into an AVL tree and efficiently merge it into the existing tree. + + + Replaced "Buffer" interface with "java.util.Queue". Kept "CircularFifoQueue" + as well as "Predicated", "Transformed" and "Unmodifiable" decorators. + + + Added method "CollectionUtils#containsAll(Collection, Collection)" with guaranteed + runtime complexity of O(n + m) and space complexity of O(n). This method may yield much + better performance than "Collection#containsAll(Collection)" depending on the use-case and + type of collection used. + + + Fixed performance issue in "SetUniqueList#retainAll" method for large collections. + + + Fixed performance issue in "ListOrderedSet#retainAll" method for large collections. + + + Improved performance of "ListOrderedMap#remove(Object)" method. + + + "CompositeSet" does not inherit from "CompositeCollection" anymore. The inner class + "SetMutator" has been updated accordingly. + + + Added method "CollectionUtils#permutations(Collection)" and class "PermutationIterator" + to generate unordered permutations of a collection. + + + Update javadoc for "ListUtils#lazyList()" and "ListUtils#fixedSizeList()". + + + Added clarifying javadoc wrt runtime complexity of "AbstractDualBidiMap#retainAll". + + + Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#retainAll". + + + Added clarifying javadoc wrt runtime complexity of "AbstractLinkedList#removeAll". + + + Fixed several compilation issues with older Java 1.6 compilers. + + + Improved performance of "removeAll()" method for sets returned by "DualHashBidiMap#entrySet()". + + + Improved performance of "CollectionUtils#subtract" methods. + + + Fixed possible "IndexOutOfBoundsException" in "ListOrderedMap#putAll". + + + Improved performance of "SetUniqueList#addAll" method. + + + Improved performance of "ListOrderedSet#addAll" method. + + + Improved performance of "SetUniqueList#removeAll". + + + Improved performance of "ListOrderedSet#remove(Object)" in case the object is + not contained in the Set. + + + Improved performance of "ListUtils#subtract" method. + + + Added "ListUtils#select" and "ListUtils#selectRejected" methods. + + + Added an implementation of Eugene Myers difference algorithm in package + o.a.c.c.sequence. + + + Added missing null check in "CollectionUtils#addIgnoreNull(Collection, Object)". + + + Added new method "get(int)" to "CircularFifoQueue". + + + Added "LazyIteratorChain" iterator. + + + Added "ListUtils#partition" method to split a List into consecutive sublists. + + + Fixed javadoc for "MapUtils#toProperties(Map)". + + + Clarified javadoc for "TransformerUtils#mapTransformer" for null input. + + + Clarified javadoc for "FactoryUtils#prototypeFactory" for null input. + + + Fixed inconsistent javadoc for "MapUtils#synchronizedMap(Map)". + + + Added "CollectionUtils#forAllDo" implementation which takes an "Iterator" as input. + + + Change maven coordinates to "org.apache.commons.commons-collections4". + + + Move the project structure to a standard maven layout. + + + Fixed infinite loop when calling "UnmodifiableBoundedCollection#unmodifiableBoundedCollection()". + + + Fixed javadoc for several methods wrt expected NullPointerExceptions. + + + Added method "ListUtils#defaultIfNull(List, List)". + + + TransformingComparator now supports different types for its input/output values. + + + "DualTreeBidiMap" now uses the correct comparator for the reverse map during de-serialization. + + + "TransformedMap" in the package "splitmap" can now be serialized. + + + "CollectionUtils#filter(Iterable, Predicate)" will now return whether the collection + has been modified. + + + Add method "CollectionUtils#filterInverse(Iterable, Predicate)". + + + "FilterListIterator#hasNext" does not throw a NullPointerException anymore + to comply to the Java iterator specification. + + + "ListUtils#intersection(List, List)" will now also work correctly if there + are duplicate elements in the provided lists. + + + "AbstractCollectionDecorator" will now use internally "decorated()" to access + the decorated collection. + + + Removed features which are now supported by the JDK. + + + Removed debug output in "MapUtils#getNumber(Map)". + + + Fixed javadoc for all "transformedXXX(XXX)" methods in the respective Utils classes + to clarify that existing objects in the list are not transformed. + + + Singleton classes in package "functors" are now correctly de-serialized. + + + "NOPClosure" is now a final class. + + + Removed broken methods "equals(Object)" and "hashCode()" in class "NOPClosure". + + + Simplified exceptions as the cause is available from the parent. + + + Fixed cache assignment for "TreeBidiMap#entrySet". + + + Synchronized access to lock in "StaticBucketMap#size()". + + + Added clarification to javadoc of "ListOrderedMap" that "IdentityMap" and + "CaseInsensitiveMap" are not supported. + + + Improve javadoc of "CollatingIterator" wrt the used "Comparator" and throw a + NullPointerException in "CollatingIterator#least" if no comparator is set. + + + "LRUMap#keySet()#remove(Object)" will not throw a "ConcurrentModificationException" anymore. + + + Improved performance of "ListUtils#intersection(List, List)". + + + Added serialVersionUID fields for "CompositeCollection", "CompositeSet", + "EmptyMapMutator", "EmptySetMutator". + + + Fields transformer and decorated in class "TransformingComparator" are now final. + + + Changed behavior of "CaseInsensitiveMap" constructor to be compliant with "HashMap" + in case the initial capacity is set to zero. + + + Added NodeListIterator and convenience methods in IteratorUtils to iterate over + a org.w3c.dom.NodeList. + + + Improved performance of "StaticBucketMap#putAll(Map)" by iterating over the entry set. + + + Avoid redundant null check in "IteratorUtils#getIterator(Object)". + + + Use a private method to populate the object in "AbstractHashedMap(Map)". + + + Fixed javadoc of "LRUMap" wrt to the maxSize parameter of the constructor. + + + Added new abstract class "CatchAndRethrowClosure" that re-throws any checked exception + as unchecked "FunctorException". + + + Use of final keyword where applicable, minor performance improvements by properly + initializing the capacity of newly created collections when known in advance. + + + "SetUniqueList#subList()" will now return an unmodifiable list as changes to it + may invalidate the parent list. + + + "SetUniqueList#subList()#contains(Object)" will now correctly check the subList + rather than the parent list. + + + Added method "CollectionUtils#subtract(Iterable, Iterable, Predicate)". + + + "SetUniqueList#set(int, Object)" will now correctly enforce the uniqueness constraint. + + + Improved javadoc for "Unmodifiable*" classes wrt behavior when the users tries + to modify the collection. + + + Calling "CollectionUtils#sizeIsEmpty(null)" will now return true. + + + Added methods "CollectionUtils#collate(...)" to merge two sorted Collections + into a sorted List using the standard O(n) merge algorithm. + + + "CaseInsensitiveMap" will now convert input strings to lower-case in a + locale-independant manner. + + + Added support for using custom "Equator" objects in "EqualPredicate". + + + Added method "CollatingIterator#getIteratorIndex()". + + + Fixed javadoc for "ListUtils#transformedList(List)" to clarify that existing objects + in the list are not transformed. + + + Added method "CollectionUtils#extractSingleton(Collection)". + + + Added serialization support for "TreeBidiMap". + + + The predicate that rejected an object to be added to a "PredicatedCollection" + is now contained in the respective exception message. + + + Added "IndexedCollection" collection decorator which provides a map-like + view on an existing collection. + + + Added serialization support for "FixedOrderComparator" and "TransformingComparator". + + + "MultiKey" will now be correctly serialized/de-serialized. + + + "TreeBag" will now only accept "Comparable" objects as input when used with natural ordering. + + + Added methods "MapUtils#populateMap(MultiMap, ...)" to support also "MultiMap" instances + as input. + + + Fixed javadoc for methods "firstKey()" and "lastKey()" in class "AbstractLinkedMap". + + + "Flat3Map#remove(Object)" will now return the correct value mapped to the removed key + if the size of the map is less or equal 3. + + + Added constructor "TransformingComparator(Transformer)". + + + Added "DualLinkedHashBidiMap" bidi map implementation. + + + Removed unused variables in "TreeBidiMap". + + + The static factory methods have been renamed from "getInstance()" to a camel-case + version of the class name, e.g. "truePredicate()" for class "TruePredicate". + + + "SetUniqueList.addAll(int, Collection)" now correctly add the collection at the + provided index. + + + Added "Equator" interface. + + + Added "PassiveExpiringMap" map decorator. + + + "MultiValueMap" is now serializable. + + + Added method "MultiValueMap#iterator()" to return a flattened version of + "entrySet().iterator()". Clarified javadoc for "entrySet()" that the returned Entry + objects are unflattened, i.e. the Entry object for a given key contains all values + mapped to this key. + + + Added method "ListUtils#indexOf(List, Predicate)". + + + Fixed several unit tests which were using parameters to "assertEquals(...)" in wrong order. + + + Return concrete class in static factory methods instead of base class interface + (except for Unmodifiable decorators). + + + "CollectionUtils#size(Collection)" now returns 0 when called with null as input. + + + Removed deprecated classes and methods. + + + "MultiValueMap#put(Object, Object)" and "MultiValueMap#putAll(Object, Collection)" + now correctly return if the map has changed by this operation. + + + Added method "ListOrderedMap#putAll(int, Map)". + + + Added new "Trie" interface with a first concrete implementation "PatriciaTrie" + together with decorators "Unmodifiable" and "Synchronized". + + + "CollectionUtils#addAll(...)" methods now return if the collection has been changed + by this operation. + + + "CompositeCollection", "CompositeMap" and "CompositeSet" are now serializable. + + + "CollectionUtils#removeAll" wrongly called "ListUtils#retainAll". + + + The "CollectionUtils#select(Collection, Predicate, Collection)" method will now + return the output collection. + + + Calling "setValue(Object)" on any Entry returned by a "Flat3Map" will now + correctly set the value for the current entry. + + + "MultiKey#toString()" will now use "Arrays#toString(List)". + + + Added support for resettable iterators in "IteratorIterable". + + + Added methods "MapUtils#populateMap(Map, Iterable, Transformer, ...)". + + + "CollectionUtils#forAllDo(Collection, Closure)" now returns the provided closure. + + + Make generic versions of all classes in collections. + + + Added class "ComparatorPredicate". + + + + + Serialization support for unsafe classes in the functor package is disabled + by default as this can be exploited for remote code execution attacks. + To re-enable the feature the system property "org.apache.commons.collections.enableUnsafeSerialization" + needs to be set to "true". + Classes considered to be unsafe are: CloneTransformer, ForClosure, InstantiateFactory, + InstantiateTransformer, InvokerTransformer, PrototypeCloneFactory, + PrototypeSerializationFactory, WhileClosure. + + + "ExtendedProperties" will now use a privileged action to access the + "file.separator" system property. In case the class does not have + permission to read system properties, the "File#separator" field will + be used instead. + + + Tree traversal with a TreeListIterator will not be affected anymore by + the removal of an element directly after a call to previous(). + + + SetUniqueList.set(int, Object) now works correctly if the object to be inserted + is already placed at the given position. + + + Removed debug output in "MapUtils#getNumber(Map)". + + + Fixed cache assignment for "TreeBidiMap#entrySet". + + + Synchronized access to lock in "StaticBucketMap#size()". + + + "SetUniqueList#subList()#contains(Object)" will now correctly check the subList + rather than the parent list. + + + "SetUniqueList#set(int, Object)" will now correctly enforce the uniqueness constraint. + + + "CaseInsensitiveMap" will now convert input strings to lower-case in a + locale-independent manner. + + + "MultiKey" will now be correctly serialized/de-serialized. + + + "Flat3Map#remove(Object)" will now return the correct value mapped to the removed key + if the size of the map is less or equal 3. + + + "SetUniqueList.addAll(int, Collection)" now correctly add the collection at the + provided index. + + + "MultiValueMap#put(Object, Object)" and "MultiValueMap#putAll(Object, Collection)" + now correctly return if the map has changed by this operation. + + + "CollectionUtils#removeAll" wrongly called "ListUtils#retainAll". + + + Calling "setValue(Object)" on any Entry returned by a "Flat3Map" will now + correctly set the value for the current entry. + + + + diff --git a/src/conf/checkstyle-suppressions.xml b/src/conf/checkstyle-suppressions.xml index fec463884..62f416112 100644 --- a/src/conf/checkstyle-suppressions.xml +++ b/src/conf/checkstyle-suppressions.xml @@ -28,7 +28,7 @@ - + diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml index c2bfec20d..3079b6b82 100644 --- a/src/conf/checkstyle.xml +++ b/src/conf/checkstyle.xml @@ -20,7 +20,7 @@ limitations under the License. "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> - + diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java index c32838f8e..6b60b6c49 100644 --- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java +++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java @@ -73,7 +73,7 @@ public class CollectionUtils { * @param a the first collection * @param b the second collection */ - public CardinalityHelper(final Iterable a, final Iterable b) { + CardinalityHelper(final Iterable a, final Iterable b) { cardinalityA = CollectionUtils.getCardinalityMap(a); cardinalityB = CollectionUtils.getCardinalityMap(b); } @@ -140,7 +140,7 @@ public class CollectionUtils { * @param a the first collection * @param b the second collection */ - public SetOperationCardinalityHelper(final Iterable a, final Iterable b) { + SetOperationCardinalityHelper(final Iterable a, final Iterable b) { super(a, b); elements = new HashSet<>(); addAll(elements, a); @@ -555,15 +555,15 @@ public class CollectionUtils { * @return {@code true} iff the collections contain the same elements with the same cardinalities. */ public static boolean isEqualCollection(final Collection a, final Collection b) { - if(a.size() != b.size()) { + if (a.size() != b.size()) { return false; } final CardinalityHelper helper = new CardinalityHelper<>(a, b); - if(helper.cardinalityA.size() != helper.cardinalityB.size()) { + if (helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } - for( final Object obj : helper.cardinalityA.keySet()) { - if(helper.freqA(obj) != helper.freqB(obj)) { + for (final Object obj : helper.cardinalityA.keySet()) { + if (helper.freqA(obj) != helper.freqB(obj)) { return false; } } @@ -598,7 +598,7 @@ public class CollectionUtils { final Equator equator) { Objects.requireNonNull(equator, "equator"); - if(a.size() != b.size()) { + if (a.size() != b.size()) { return false; } @@ -622,7 +622,7 @@ public class CollectionUtils { private final Equator equator; private final O object; - public EquatorWrapper(final Equator equator, final O object) { + EquatorWrapper(final Equator equator, final O object) { this.equator = equator; this.object = object; } @@ -1318,7 +1318,7 @@ public class CollectionUtils { if (i < 0) { throw new IndexOutOfBoundsException("Index cannot be negative: " + i); } - if (object instanceof Map) { + if (object instanceof Map) { final Map map = (Map) object; final Iterator iterator = map.entrySet().iterator(); return IteratorUtils.get(iterator, i); @@ -1355,7 +1355,7 @@ public class CollectionUtils { * @return the object at the specified index * @throws IndexOutOfBoundsException if the index is invalid */ - public static Map.Entry get(final Map map, final int index) { + public static Map.Entry get(final Map map, final int index) { checkIndexBounds(index); return get(map.entrySet(), index); } @@ -1383,7 +1383,7 @@ public class CollectionUtils { return 0; } int total = 0; - if (object instanceof Map) { + if (object instanceof Map) { total = ((Map) object).size(); } else if (object instanceof Collection) { total = ((Collection) object).size(); diff --git a/src/main/java/org/apache/commons/collections4/Equator.java b/src/main/java/org/apache/commons/collections4/Equator.java index 5b5dd3a52..63cce0f30 100644 --- a/src/main/java/org/apache/commons/collections4/Equator.java +++ b/src/main/java/org/apache/commons/collections4/Equator.java @@ -1,12 +1,18 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license - * agreements. See the NOTICE file distributed with this work for additional information regarding - * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. You may obtain a - * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable - * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" - * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License - * for the specific language governing permissions and limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.commons.collections4; diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index 55c31239b..125002d5d 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -478,7 +478,7 @@ public class IterableUtils { private static final class UnmodifiableIterable extends FluentIterable { private final Iterable unmodifiable; - public UnmodifiableIterable(final Iterable iterable) { + UnmodifiableIterable(final Iterable iterable) { super(); this.unmodifiable = iterable; } diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index bf3779f65..d6c52832d 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -808,7 +808,7 @@ public class IteratorUtils { * Convenience method, allows easy iteration over NodeLists: *
      *   Iterator<Node> iterator = IteratorUtils.nodeListIterator(node);
-     *   for(Node childNode : IteratorUtils.asIterable(iterator)) {
+     *   for (Node childNode : IteratorUtils.asIterable(iterator)) {
      *     ...
      *   }
      * 
@@ -1247,7 +1247,7 @@ public class IteratorUtils { Objects.requireNonNull(predicate, "predicate"); if (iterator != null) { - for(int index = 0; iterator.hasNext(); index++) { + for (int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (predicate.evaluate(element)) { return index; @@ -1469,7 +1469,7 @@ public class IteratorUtils { stringBuilder.append(transformer.transform(element)); stringBuilder.append(delimiter); } - if(stringBuilder.length() > prefix.length()) { + if (stringBuilder.length() > prefix.length()) { stringBuilder.setLength(stringBuilder.length() - delimiter.length()); } } diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java index b439d38d8..fa3ef9e08 100644 --- a/src/main/java/org/apache/commons/collections4/ListUtils.java +++ b/src/main/java/org/apache/commons/collections4/ListUtils.java @@ -611,7 +611,7 @@ public class ListUtils { private static final class LcsVisitor implements CommandVisitor { private final ArrayList sequence; - public LcsVisitor() { + LcsVisitor() { sequence = new ArrayList<>(); } @@ -639,23 +639,21 @@ public class ListUtils { * A simple wrapper to use a CharSequence as List. */ private static final class CharSequenceAsList extends AbstractList { + private final CharSequence sequence; - private final CharSequence sequence; + CharSequenceAsList(final CharSequence sequence) { + this.sequence = sequence; + } - public CharSequenceAsList(final CharSequence sequence) { - this.sequence = sequence; - } - - @Override - public Character get( final int index ) { - return Character.valueOf(sequence.charAt( index )); - } - - @Override - public int size() { - return sequence.length(); - } + @Override + public Character get(final int index) { + return Character.valueOf(sequence.charAt(index)); + } + @Override + public int size() { + return sequence.length(); + } } //----------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java index 97e46e58e..3b833af94 100644 --- a/src/main/java/org/apache/commons/collections4/SetUtils.java +++ b/src/main/java/org/apache/commons/collections4/SetUtils.java @@ -58,7 +58,7 @@ public class SetUtils { * @param the element type * @since 4.1 */ - public static abstract class SetView extends AbstractSet { + public abstract static class SetView extends AbstractSet { /** * Copies the contents of this view into the provided set. diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java index b5b984570..8f970885c 100644 --- a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java @@ -191,7 +191,7 @@ public abstract class AbstractMapBag implements Bag { * * @param parent the parent bag */ - public BagIterator(final AbstractMapBag parent) { + BagIterator(final AbstractMapBag parent) { this.parent = parent; this.entryIterator = parent.map.entrySet().iterator(); this.current = null; @@ -507,7 +507,7 @@ public abstract class AbstractMapBag implements Bag { @Override public Set uniqueSet() { if (uniqueSet == null) { - uniqueSet = UnmodifiableSet. unmodifiableSet(map.keySet()); + uniqueSet = UnmodifiableSet.unmodifiableSet(map.keySet()); } return uniqueSet; } diff --git a/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java b/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java index 4ae4d42a3..a72582305 100644 --- a/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java @@ -111,7 +111,7 @@ public final class CollectionBag extends AbstractBagDecorator { public boolean containsAll(final Collection coll) { final Iterator e = coll.iterator(); while (e.hasNext()) { - if(!contains(e.next())) { + if (!contains(e.next())) { return false; } } diff --git a/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java b/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java index ef433e5f6..abcfb3dc2 100644 --- a/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java @@ -92,7 +92,7 @@ public final class CollectionSortedBag extends AbstractSortedBagDecorator public boolean containsAll(final Collection coll) { final Iterator e = coll.iterator(); while (e.hasNext()) { - if(!contains(e.next())) { + if (!contains(e.next())) { return false; } } diff --git a/src/main/java/org/apache/commons/collections4/bag/TreeBag.java b/src/main/java/org/apache/commons/collections4/bag/TreeBag.java index 9ce1d8ab6..64558677e 100644 --- a/src/main/java/org/apache/commons/collections4/bag/TreeBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/TreeBag.java @@ -88,7 +88,7 @@ public class TreeBag extends AbstractMapBag implements SortedBag, Seria */ @Override public boolean add(final E object) { - if(comparator() == null && !(object instanceof Comparable)) { + if (comparator() == null && !(object instanceof Comparable)) { Objects.requireNonNull(object, "object"); throw new IllegalArgumentException("Objects of type " + object.getClass() + " cannot be added to " + "a naturally ordered TreeBag as it does not implement Comparable"); diff --git a/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java b/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java index e3aa3165d..6e0f74f1f 100644 --- a/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java @@ -108,7 +108,7 @@ public final class UnmodifiableBag //----------------------------------------------------------------------- @Override public Iterator iterator() { - return UnmodifiableIterator. unmodifiableIterator(decorated().iterator()); + return UnmodifiableIterator.unmodifiableIterator(decorated().iterator()); } @Override @@ -163,7 +163,7 @@ public final class UnmodifiableBag @Override public Set uniqueSet() { final Set set = decorated().uniqueSet(); - return UnmodifiableSet. unmodifiableSet(set); + return UnmodifiableSet.unmodifiableSet(set); } } diff --git a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java index c8c91ad8d..33e2611f7 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java @@ -344,7 +344,7 @@ public abstract class AbstractDualBidiMap implements BidiMap { /** * Inner class View. */ - protected static abstract class View extends AbstractCollectionDecorator { + protected abstract static class View extends AbstractCollectionDecorator { /** Generated serial version ID. */ private static final long serialVersionUID = 4621510560119690639L; diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java index 0022b5dcc..7af7f2cf6 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java @@ -1465,7 +1465,7 @@ public class TreeBidiMap, V extends Comparable> stream.defaultReadObject(); rootNode = new Node[2]; final int size = stream.readInt(); - for(int i = 0; i < size; i++){ + for (int i = 0; i < size; i++){ final K k =(K) stream.readObject(); final V v =(V) stream.readObject(); put(k, v); @@ -1521,7 +1521,7 @@ public class TreeBidiMap, V extends Comparable> /** * Create a new TreeBidiMap.KeyView. */ - public KeyView(final DataElement orderType) { + KeyView(final DataElement orderType) { super(orderType); } @@ -1548,7 +1548,7 @@ public class TreeBidiMap, V extends Comparable> /** * Create a new TreeBidiMap.ValueView. */ - public ValueView(final DataElement orderType) { + ValueView(final DataElement orderType) { super(orderType); } @@ -1792,7 +1792,7 @@ public class TreeBidiMap, V extends Comparable> /** * Create a new TreeBidiMap.InverseViewMapIterator. */ - public InverseViewMapIterator(final DataElement orderType) { + InverseViewMapIterator(final DataElement orderType) { super(orderType); } diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java index 1339dac70..e568bf52c 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilter.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -168,7 +167,7 @@ public abstract class AbstractBloomFilter implements BloomFilter { * @param other the other Bloom filter. */ @Override - abstract public void merge(BloomFilter other); + public abstract void merge(BloomFilter other); /** * Merge the decomposed Bloom filter defined by the hasher into this Bloom @@ -179,7 +178,7 @@ public abstract class AbstractBloomFilter implements BloomFilter { * this filter, or if the hasher is not the specified one */ @Override - abstract public void merge(Hasher hasher); + public abstract void merge(Hasher hasher); @Override public int orCardinality(final BloomFilter other) { diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BitSetBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BitSetBloomFilter.java index eb1aff437..2781844d7 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/BitSetBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BitSetBloomFilter.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -64,7 +63,7 @@ public class BitSetBloomFilter extends AbstractBloomFilter { if (other instanceof BitSetBloomFilter) { verifyShape(other); final BitSet result = (BitSet) bitSet.clone(); - result.and(((BitSetBloomFilter)other).bitSet); + result.and(((BitSetBloomFilter) other).bitSet); return result.cardinality(); } return super.andCardinality(other); @@ -101,7 +100,7 @@ public class BitSetBloomFilter extends AbstractBloomFilter { public void merge(final BloomFilter other) { verifyShape(other); if (other instanceof BitSetBloomFilter) { - bitSet.or(((BitSetBloomFilter)other).bitSet); + bitSet.or(((BitSetBloomFilter) other).bitSet); } else { bitSet.or(BitSet.valueOf(other.getBits())); } @@ -118,7 +117,7 @@ public class BitSetBloomFilter extends AbstractBloomFilter { if (other instanceof BitSetBloomFilter) { verifyShape(other); final BitSet result = (BitSet) bitSet.clone(); - result.or(((BitSetBloomFilter)other).bitSet); + result.or(((BitSetBloomFilter) other).bitSet); return result.cardinality(); } return super.orCardinality(other); @@ -134,7 +133,7 @@ public class BitSetBloomFilter extends AbstractBloomFilter { if (other instanceof BitSetBloomFilter) { verifyShape(other); final BitSet result = (BitSet) bitSet.clone(); - result.xor(((BitSetBloomFilter)other).bitSet); + result.xor(((BitSetBloomFilter) other).bitSet); return result.cardinality(); } return super.xorCardinality(other); diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java index a485f53cb..9d982021b 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java index a3734653a..d3df6c267 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -105,7 +104,7 @@ public class CountingBloomFilter extends AbstractBloomFilter { public int andCardinality(final BloomFilter other) { if (other instanceof CountingBloomFilter) { final Set result = new HashSet<>(counts.keySet()); - result.retainAll(((CountingBloomFilter)other).counts.keySet()); + result.retainAll(((CountingBloomFilter) other).counts.keySet()); return result.size(); } return super.andCardinality(other); @@ -229,7 +228,7 @@ public class CountingBloomFilter extends AbstractBloomFilter { public void remove(final Hasher hasher) { verifyHasher(hasher); final Set lst = new HashSet<>(); - hasher.getBits(getShape()).forEachRemaining((Consumer)lst::add); + hasher.getBits(getShape()).forEachRemaining((Consumer) lst::add); remove(lst.stream()); } diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/HasherBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/HasherBloomFilter.java index 4ab8c5120..8390144d9 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/HasherBloomFilter.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/HasherBloomFilter.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/SetOperations.java b/src/main/java/org/apache/commons/collections4/bloomfilter/SetOperations.java index 80017a33d..48c43620a 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/SetOperations.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/SetOperations.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -35,7 +34,7 @@ public final class SetOperations { * @return the jaccard distance. */ public static double cosineDistance(final BloomFilter first, final BloomFilter second) { - return 1.0 - cosineSimilarity(first,second); + return 1.0 - cosineSimilarity(first, second); } /** @@ -64,9 +63,9 @@ public final class SetOperations { * @return an estimate of the size of the intersection between the two filters. */ public static long estimateIntersectionSize(final BloomFilter first, final BloomFilter second) { - verifyShape(first,second); + verifyShape(first, second); // do subtraction early to avoid Long overflow. - return estimateSize(first) - estimateUnionSize(first,second) + estimateSize(second); + return estimateSize(first) - estimateUnionSize(first, second) + estimateSize(second); } /** @@ -93,7 +92,7 @@ public final class SetOperations { * @return an estimate of the size of the union between the two filters. */ public static long estimateUnionSize(final BloomFilter first, final BloomFilter second) { - verifyShape(first,second); + verifyShape(first, second); final Shape shape = first.getShape(); final double estimate = -(shape.getNumberOfBits() * Math.log(1.0 - first.orCardinality(second) * 1.0 / shape.getNumberOfBits())) / @@ -109,7 +108,7 @@ public final class SetOperations { * @return the Hamming distance. */ public static int hammingDistance(final BloomFilter first, final BloomFilter second) { - verifyShape(first,second); + verifyShape(first, second); return first.xorCardinality(second); } @@ -123,7 +122,7 @@ public final class SetOperations { * @return the Jaccard distance. */ public static double jaccardDistance(final BloomFilter first, final BloomFilter second) { - return 1.0 - jaccardSimilarity(first,second); + return 1.0 - jaccardSimilarity(first, second); } /** diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java index 68991c52d..251402f5c 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasher.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunction.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunction.java index 11b18e4cc..cbdfd0f18 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunction.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunction.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java index 7a58d445f..13ed43fa3 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java index 5a55f1b44..c75973a37 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionValidator.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionValidator.java index 602dcde04..21d2cb06f 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionValidator.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionValidator.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Hasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Hasher.java index 259639612..0ba46aa4d 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Hasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Hasher.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java index 956575ff4..34513bab7 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -291,7 +290,7 @@ public class Shape { * @return the number of bytes in the Bloom filter. */ public int getNumberOfBytes() { - return Double.valueOf(Math.ceil(numberOfBits / (double)Byte.SIZE )).intValue(); + return Double.valueOf(Math.ceil(numberOfBits / (double) Byte.SIZE )).intValue(); } /** @@ -347,4 +346,4 @@ public class Shape { HashFunctionIdentity.asCommonString(hashFunctionIdentity), numberOfItems, numberOfBits, numberOfHashFunctions); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java index b17bf8eca..676cc2f85 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasher.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java index f6d4e5945..de2063faa 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java index d4782c95e..7f24d065d 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86Cyclic.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java index f612f8ccc..678d01183 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86Iterative.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java index ad97aba0d..d5cef318f 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterative.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/package-info.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/package-info.java index 4edb95864..1a1096af9 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/package-info.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/package-info.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,9 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** * Implementations of org.apache.commons.collections4.bloomfilter.hasher.HasherFunction * interface. + * * @since 4.5 */ package org.apache.commons.collections4.bloomfilter.hasher.function; diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/package-info.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/package-info.java index 43888b7b4..505f947b4 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/package-info.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/package-info.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,9 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** * Implementations of org.apache.commons.collections4.bloomfilter.Hasher * interface. + * * @since 4.5 */ package org.apache.commons.collections4.bloomfilter.hasher; diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/package-info.java b/src/main/java/org/apache/commons/collections4/bloomfilter/package-info.java index 0c71933f8..bfc3d67ab 100644 --- a/src/main/java/org/apache/commons/collections4/bloomfilter/package-info.java +++ b/src/main/java/org/apache/commons/collections4/bloomfilter/package-info.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** * A collection of extensible Bloom filter classes and interfaces. * diff --git a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java index 7d273554f..8b4150640 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java @@ -173,7 +173,7 @@ public final class BooleanComparator implements Comparator, Serializabl public boolean equals(final Object object) { return (this == object) || ((object instanceof BooleanComparator) && - (this.trueFirst == ((BooleanComparator)object).trueFirst)); + (this.trueFirst == ((BooleanComparator) object).trueFirst)); } //----------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java index 0af0d5d13..83ff884ed 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java +++ b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java @@ -182,7 +182,7 @@ public class ComparatorChain implements Comparator, Serializable { public void setComparator(final int index, final Comparator comparator, final boolean reverse) { checkLocked(); - comparatorChain.set(index,comparator); + comparatorChain.set(index, comparator); if (reverse == true) { orderingBits.set(index); } else { @@ -278,7 +278,7 @@ public class ComparatorChain implements Comparator, Serializable { for (int comparatorIndex = 0; comparators.hasNext(); ++comparatorIndex) { final Comparator comparator = comparators.next(); - int retval = comparator.compare(o1,o2); + int retval = comparator.compare(o1, o2); if (retval != 0) { // invert the order if it is a reverse sort if (orderingBits.get(comparatorIndex) == true) { diff --git a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java index 669373580..176c74ba0 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java @@ -132,9 +132,15 @@ public class NullComparator implements Comparator, Serializable { **/ @Override public int compare(final E o1, final E o2) { - if(o1 == o2) { return 0; } - if(o1 == null) { return this.nullsAreHigh ? 1 : -1; } - if(o2 == null) { return this.nullsAreHigh ? -1 : 1; } + if (o1 == o2) { + return 0; + } + if (o1 == null) { + return this.nullsAreHigh ? 1 : -1; + } + if (o2 == null) { + return this.nullsAreHigh ? -1 : 1; + } return this.nonNullComparator.compare(o1, o2); } @@ -163,14 +169,19 @@ public class NullComparator implements Comparator, Serializable { **/ @Override public boolean equals(final Object obj) { - if(obj == null) { return false; } - if(obj == this) { return true; } - if(!obj.getClass().equals(this.getClass())) { return false; } + if (obj == null) { + return false; + } + if (obj == this) { + return true; + } + if (!obj.getClass().equals(this.getClass())) { + return false; + } final NullComparator other = (NullComparator) obj; return this.nullsAreHigh == other.nullsAreHigh && this.nonNullComparator.equals(other.nonNullComparator); } - } diff --git a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java index f9e7911e2..0f804bcf3 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java @@ -107,7 +107,7 @@ public class IfTransformer implements Transformer, Serializable { */ @Override public O transform(final I input) { - if(iPredicate.evaluate(input)){ + if (iPredicate.evaluate(input)){ return iTrueTransformer.transform(input); } return iFalseTransformer.transform(input); diff --git a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java index 266b28c8d..972f616bf 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/BoundedIterator.java @@ -1,15 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - * or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.commons.collections4.iterators; diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java index cda26ef5d..32997144e 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java @@ -208,7 +208,7 @@ public class IteratorChain implements Iterator { protected void updateCurrentIterator() { if (currentIterator == null) { if (iteratorChain.isEmpty()) { - currentIterator = EmptyIterator. emptyIterator(); + currentIterator = EmptyIterator.emptyIterator(); } else { currentIterator = iteratorChain.remove(); } diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java index f193d83f1..17ee47e4b 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java @@ -1,15 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - * or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.commons.collections4.iterators; @@ -129,7 +132,7 @@ public class IteratorIterable implements Iterable { @Override public Iterator iterator() { if (iterator instanceof ResettableIterator) { - ((ResettableIterator)iterator).reset(); + ((ResettableIterator) iterator).reset(); } return typeSafeIterator; } diff --git a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java index 955483e71..f278f87ee 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java @@ -1,9 +1,10 @@ /* - * Copyright 2013 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java index d28060bf6..80fe2cb53 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/PeekingIterator.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java index a52935447..f6d393d21 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java index 5f4ea6027..62d1f9167 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java @@ -137,7 +137,7 @@ public class SingletonListIterator implements ResettableListIterator { */ @Override public void remove() { - if(!nextCalled || removed) { + if (!nextCalled || removed) { throw new IllegalStateException(); } object = null; diff --git a/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java index f86559b2f..afa970c68 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SkippingIterator.java @@ -1,15 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - * or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.commons.collections4.iterators; diff --git a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java index 0844385ab..2b30a2a25 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java @@ -112,7 +112,7 @@ public class ZippingIterator implements Iterator { return true; } - while(iterators.hasNext()) { + while (iterators.hasNext()) { final Iterator childIterator = iterators.next(); if (childIterator.hasNext()) { nextIterator = childIterator; diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java index c1080f82c..1980e76b3 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java @@ -227,8 +227,7 @@ public class MultiKey implements Serializable { * Calculate the hash code of the instance using the provided keys. * @param keys the keys to calculate the hash code for */ - private void calculateHashCode(final Object[] keys) - { + private void calculateHashCode(final Object[] keys) { int total = 0; for (final Object key : keys) { if (key != null) { diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java index 0400f45b9..f1306b6ce 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java @@ -108,7 +108,7 @@ public class TiedMapEntry implements Map.Entry, KeyValue, Seri if (obj instanceof Map.Entry == false) { return false; } - final Map.Entry other = (Map.Entry) obj; + final Map.Entry other = (Map.Entry) obj; final Object value = getValue(); return (key == null ? other.getKey() == null : key.equals(other.getKey())) && diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java index 2378d65ba..a9bdb3938 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java @@ -1164,7 +1164,7 @@ public class AbstractHashedMap extends AbstractMap implements Iterab * @param the type of the keys in the map * @param the type of the values in the map */ - protected static abstract class HashIterator { + protected abstract static class HashIterator { /** The parent map */ private final AbstractHashedMap parent; @@ -1349,11 +1349,11 @@ public class AbstractHashedMap extends AbstractMap implements Iterab if (obj instanceof Map == false) { return false; } - final Map map = (Map) obj; + final Map map = (Map) obj; if (map.size() != size()) { return false; } - final MapIterator it = mapIterator(); + final MapIterator it = mapIterator(); try { while (it.hasNext()) { final Object key = it.next(); diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java index 25b980b0d..b173e8299 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java @@ -543,7 +543,7 @@ public abstract class AbstractLinkedMap extends AbstractHashedMap im /** * Base Iterator that iterates in link order. */ - protected static abstract class LinkIterator { + protected abstract static class LinkIterator { /** The parent map */ protected final AbstractLinkedMap parent; diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java index e422756de..bd5c03d56 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java @@ -679,7 +679,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap return false; } - final Map.Entry entry = (Map.Entry)obj; + final Map.Entry entry = (Map.Entry) obj; final Object entryKey = entry.getKey(); // convert to hard reference final Object entryValue = entry.getValue(); // convert to hard reference if (entryKey == null || entryValue == null) { @@ -794,7 +794,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap int expectedModCount; - public ReferenceBaseIterator(final AbstractReferenceMap parent) { + ReferenceBaseIterator(final AbstractReferenceMap parent) { super(); this.parent = parent; index = parent.size() != 0 ? parent.data.length : 0; @@ -876,7 +876,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap static class ReferenceEntrySetIterator extends ReferenceBaseIterator implements Iterator> { - public ReferenceEntrySetIterator(final AbstractReferenceMap parent) { + ReferenceEntrySetIterator(final AbstractReferenceMap parent) { super(parent); } @@ -973,7 +973,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap /** the hashCode of the key (even if the reference points to a value) */ private final int hash; - public SoftRef(final int hash, final T r, final ReferenceQueue q) { + SoftRef(final int hash, final T r, final ReferenceQueue q) { super(r, q); this.hash = hash; } @@ -991,7 +991,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap /** the hashCode of the key (even if the reference points to a value) */ private final int hash; - public WeakRef(final int hash, final T r, final ReferenceQueue q) { + WeakRef(final int hash, final T r, final ReferenceQueue q) { super(r, q); this.hash = hash; } diff --git a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java index fbb71c7f1..4be81a710 100644 --- a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java +++ b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java @@ -809,7 +809,7 @@ public class Flat3Map implements IterableMap, Serializable, Cloneabl private final int index; private volatile boolean removed; - public FlatMapEntry(final Flat3Map parent, final int index) { + FlatMapEntry(final Flat3Map parent, final int index) { this.parent = parent; this.index = index; this.removed = false; @@ -918,7 +918,7 @@ public class Flat3Map implements IterableMap, Serializable, Cloneabl } - static abstract class EntryIterator { + abstract static class EntryIterator { private final Flat3Map parent; private int nextIndex = 0; private FlatMapEntry currentEntry = null; @@ -926,7 +926,7 @@ public class Flat3Map implements IterableMap, Serializable, Cloneabl /** * Create a new Flat3Map.EntryIterator. */ - public EntryIterator(final Flat3Map parent) { + EntryIterator(final Flat3Map parent) { this.parent = parent; } @@ -1031,7 +1031,7 @@ public class Flat3Map implements IterableMap, Serializable, Cloneabl /** * KeySetIterator */ - static class KeySetIterator extends EntryIterator implements Iterator{ + static class KeySetIterator extends EntryIterator implements Iterator { @SuppressWarnings("unchecked") KeySetIterator(final Flat3Map parent) { diff --git a/src/main/java/org/apache/commons/collections4/map/LRUMap.java b/src/main/java/org/apache/commons/collections4/map/LRUMap.java index 8fbf872a0..a49b0dc55 100644 --- a/src/main/java/org/apache/commons/collections4/map/LRUMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LRUMap.java @@ -269,7 +269,7 @@ public class LRUMap if (entry.after != header) { modCount++; // remove - if(entry.before == null) { + if (entry.before == null) { throw new IllegalStateException("Entry.before is null." + " This should not occur if your keys are immutable, and you have used synchronization properly."); } diff --git a/src/main/java/org/apache/commons/collections4/map/LazyMap.java b/src/main/java/org/apache/commons/collections4/map/LazyMap.java index d12ce496f..ceeaeb1fc 100644 --- a/src/main/java/org/apache/commons/collections4/map/LazyMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LazyMap.java @@ -86,7 +86,7 @@ public class LazyMap extends AbstractMapDecorator implements Seriali * @throws NullPointerException if map or factory is null * @since 4.0 */ - public static LazyMap lazyMap(final Map map, final Factory< ? extends V> factory) { + public static LazyMap lazyMap(final Map map, final Factory factory) { return new LazyMap<>(map, factory); } @@ -113,7 +113,7 @@ public class LazyMap extends AbstractMapDecorator implements Seriali * @param factory the factory to use, must not be null * @throws NullPointerException if map or factory is null */ - protected LazyMap(final Map map, final Factory factory) { + protected LazyMap(final Map map, final Factory factory) { super(map); this.factory = FactoryTransformer.factoryTransformer(Objects.requireNonNull(factory, "factory")); } @@ -125,7 +125,7 @@ public class LazyMap extends AbstractMapDecorator implements Seriali * @param factory the factory to use, must not be null * @throws NullPointerException if map or factory is null */ - protected LazyMap(final Map map, final Transformer factory) { + protected LazyMap(final Map map, final Transformer factory) { super(map); this.factory = Objects.requireNonNull(factory, "factory"); } diff --git a/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java b/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java index 36418e737..47bbe8b70 100644 --- a/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java @@ -63,7 +63,7 @@ import org.apache.commons.collections4.Transformer; * @param the type of the values in this map * @since 3.0 */ -public class LazySortedMap extends LazyMap implements SortedMap { +public class LazySortedMap extends LazyMap implements SortedMap { /** Serialization version */ private static final long serialVersionUID = 2715322183617658933L; @@ -108,7 +108,7 @@ public class LazySortedMap extends LazyMap implements SortedMap { * @param factory the factory to use, must not be null * @throws NullPointerException if map or factory is null */ - protected LazySortedMap(final SortedMap map, final Factory factory) { + protected LazySortedMap(final SortedMap map, final Factory factory) { super(map, factory); } @@ -119,7 +119,7 @@ public class LazySortedMap extends LazyMap implements SortedMap { * @param factory the factory to use, must not be null * @throws NullPointerException if map or factory is null */ - protected LazySortedMap(final SortedMap map, final Transformer factory) { + protected LazySortedMap(final SortedMap map, final Transformer factory) { super(map, factory); } @@ -129,8 +129,8 @@ public class LazySortedMap extends LazyMap implements SortedMap { * * @return the decorated map */ - protected SortedMap getSortedMap() { - return (SortedMap) map; + protected SortedMap getSortedMap() { + return (SortedMap) map; } //----------------------------------------------------------------------- @@ -150,20 +150,20 @@ public class LazySortedMap extends LazyMap implements SortedMap { } @Override - public SortedMap subMap(final K fromKey, final K toKey) { - final SortedMap map = getSortedMap().subMap(fromKey, toKey); + public SortedMap subMap(final K fromKey, final K toKey) { + final SortedMap map = getSortedMap().subMap(fromKey, toKey); return new LazySortedMap<>(map, factory); } @Override - public SortedMap headMap(final K toKey) { - final SortedMap map = getSortedMap().headMap(toKey); + public SortedMap headMap(final K toKey) { + final SortedMap map = getSortedMap().headMap(toKey); return new LazySortedMap<>(map, factory); } @Override - public SortedMap tailMap(final K fromKey) { - final SortedMap map = getSortedMap().tailMap(fromKey); + public SortedMap tailMap(final K fromKey) { + final SortedMap map = getSortedMap().tailMap(fromKey); return new LazySortedMap<>(map, factory); } diff --git a/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java b/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java index 46b8a68d3..e50fac955 100644 --- a/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java @@ -600,7 +600,7 @@ public class ListOrderedMap private final List insertOrder; private Set> entrySet; - public EntrySetView(final ListOrderedMap parent, final List insertOrder) { + EntrySetView(final ListOrderedMap parent, final List insertOrder) { super(); this.parent = parent; this.insertOrder = insertOrder; diff --git a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java index c0aa64b91..2a221868f 100644 --- a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java +++ b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java @@ -91,7 +91,7 @@ public class MultiValueMap extends AbstractMapDecorator impleme */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static MultiValueMap multiValueMap(final Map> map) { - return MultiValueMap. multiValueMap((Map) map, ArrayList.class); + return MultiValueMap.multiValueMap((Map) map, ArrayList.class); } /** @@ -517,7 +517,7 @@ public class MultiValueMap extends AbstractMapDecorator impleme private final Collection values; private final Iterator iterator; - public ValuesIterator(final Object key) { + ValuesIterator(final Object key) { this.key = key; this.values = getCollection(key); this.iterator = values.iterator(); @@ -552,7 +552,7 @@ public class MultiValueMap extends AbstractMapDecorator impleme private final Class clazz; - public ReflectionFactory(final Class clazz) { + ReflectionFactory(final Class clazz) { this.clazz = clazz; } diff --git a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java index 68d6be32a..3587bc3f2 100644 --- a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java +++ b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java @@ -572,11 +572,11 @@ public class SingletonMap if (obj instanceof Map == false) { return false; } - final Map other = (Map) obj; + final Map other = (Map) obj; if (other.size() != 1) { return false; } - final Map.Entry entry = other.entrySet().iterator().next(); + final Map.Entry entry = other.entrySet().iterator().next(); return isEqualKey(entry.getKey()) && isEqualValue(entry.getValue()); } diff --git a/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java b/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java index ecd0a234c..8a2c51cf0 100644 --- a/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java +++ b/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java @@ -500,7 +500,7 @@ public final class StaticBucketMap extends AbstractIterableMap { /** * The lock object, which also includes a count of the nodes in this lock. */ - private final static class Lock { + private static final class Lock { public int size; } diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java index ca7bc2d57..878bfb959 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java @@ -109,7 +109,7 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap */ private class WrappedList extends WrappedCollection implements List { - public WrappedList(final K key) { + WrappedList(final K key) { super(key); } @@ -220,13 +220,13 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap private List values; private ListIterator iterator; - public ValuesListIterator(final K key) { + ValuesListIterator(final K key) { this.key = key; this.values = ListUtils.emptyIfNull(getMap().get(key)); this.iterator = values.listIterator(); } - public ValuesListIterator(final K key, final int index) { + ValuesListIterator(final K key, final int index) { this.key = key; this.values = ListUtils.emptyIfNull(getMap().get(key)); this.iterator = values.listIterator(index); diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java index d5414e3be..b05d9016a 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java @@ -398,7 +398,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap implements MultiValuedMap { - public MultiValuedMapEntry(final K key, final V value) { + MultiValuedMapEntry(final K key, final V value) { super(key, value); } @@ -656,7 +656,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap current = null; - public MultiValuedMapIterator() { + MultiValuedMapIterator() { this.it = AbstractMultiValuedMap.this.entries().iterator(); } @@ -734,7 +734,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap values; private final Iterator iterator; - public ValuesIterator(final Object key) { + ValuesIterator(final Object key) { this.key = key; this.values = getMap().get(key); this.iterator = values.iterator(); diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java index 08e431647..b25a9aeaa 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java @@ -109,7 +109,7 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< */ private class WrappedSet extends WrappedCollection implements Set { - public WrappedSet(final K key) { + WrappedSet(final K key) { super(key); } @@ -133,5 +133,4 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< } } - } diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java index 511f402f9..d086e3d0c 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java @@ -165,7 +165,7 @@ public abstract class AbstractMapMultiSet extends AbstractMultiSet { * * @param parent the parent multiset */ - public MapBasedMultiSetIterator(final AbstractMapMultiSet parent) { + MapBasedMultiSetIterator(final AbstractMapMultiSet parent) { this.parent = parent; this.entryIterator = parent.map.entrySet().iterator(); this.current = null; diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java index 1c4248c39..a0a681305 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java @@ -138,7 +138,7 @@ public abstract class AbstractMultiSet extends AbstractCollection implemen * * @param parent the parent multiset */ - public MultiSetIterator(final AbstractMultiSet parent) { + MultiSetIterator(final AbstractMultiSet parent) { this.parent = parent; this.entryIterator = parent.entrySet().iterator(); this.current = null; @@ -404,7 +404,7 @@ public abstract class AbstractMultiSet extends AbstractCollection implemen /** * Inner class AbstractEntry. */ - protected static abstract class AbstractEntry implements Entry { + protected abstract static class AbstractEntry implements Entry { @Override public boolean equals(final Object object) { diff --git a/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java index 2376c3ceb..e5c39d147 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java @@ -104,7 +104,7 @@ public final class UnmodifiableMultiSet //----------------------------------------------------------------------- @Override public Iterator iterator() { - return UnmodifiableIterator. unmodifiableIterator(decorated().iterator()); + return UnmodifiableIterator.unmodifiableIterator(decorated().iterator()); } @Override diff --git a/src/main/java/org/apache/commons/collections4/overview.html b/src/main/java/org/apache/commons/collections4/overview.html index ba9e93251..af3f71823 100644 --- a/src/main/java/org/apache/commons/collections4/overview.html +++ b/src/main/java/org/apache/commons/collections4/overview.html @@ -1,19 +1,19 @@ - +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-->

Commons-Collections contains implementations, enhancements and utilities diff --git a/src/main/java/org/apache/commons/collections4/properties/AbstractPropertiesFactory.java b/src/main/java/org/apache/commons/collections4/properties/AbstractPropertiesFactory.java index 249905b69..00423fa8c 100644 --- a/src/main/java/org/apache/commons/collections4/properties/AbstractPropertiesFactory.java +++ b/src/main/java/org/apache/commons/collections4/properties/AbstractPropertiesFactory.java @@ -40,7 +40,7 @@ import java.util.Properties; */ public abstract class AbstractPropertiesFactory { - /** + /** * Enumerat5es property formats. * * @since 4.5 @@ -82,7 +82,7 @@ public abstract class AbstractPropertiesFactory { * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. */ public T load(final ClassLoader classLoader, final String name) throws IOException { - try (final InputStream inputStream = classLoader.getResourceAsStream(name)) { + try (InputStream inputStream = classLoader.getResourceAsStream(name)) { return load(inputStream, PropertyFormat.toPropertyFormat(name)); } } @@ -100,7 +100,7 @@ public abstract class AbstractPropertiesFactory { * the file. */ public T load(final File file) throws FileNotFoundException, IOException { - try (final FileInputStream inputStream = new FileInputStream(file)) { + try (FileInputStream inputStream = new FileInputStream(file)) { return load(inputStream, PropertyFormat.toPropertyFormat(file.getName())); } } @@ -154,7 +154,7 @@ public abstract class AbstractPropertiesFactory { * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. */ public T load(final Path path) throws IOException { - try (final InputStream inputStream = Files.newInputStream(path)) { + try (InputStream inputStream = Files.newInputStream(path)) { return load(inputStream, PropertyFormat.toPropertyFormat(Objects.toString(path.getFileName(), null))); } } @@ -182,7 +182,7 @@ public abstract class AbstractPropertiesFactory { * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. */ public T load(final String name) throws IOException { - try (final FileInputStream inputStream = new FileInputStream(name)) { + try (FileInputStream inputStream = new FileInputStream(name)) { return load(inputStream, PropertyFormat.toPropertyFormat(name)); } } @@ -208,7 +208,7 @@ public abstract class AbstractPropertiesFactory { * @throws IllegalArgumentException Thrown if the input contains a malformed Unicode escape sequence. */ public T load(final URL url) throws IOException { - try (final InputStream inputStream = url.openStream()) { + try (InputStream inputStream = url.openStream()) { return load(inputStream, PropertyFormat.toPropertyFormat(url.getFile())); } } diff --git a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java index b03e73578..4376b22b4 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java +++ b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java @@ -183,7 +183,7 @@ public class SequencesComparator { vDown[1+offset] = start1; vUp[1+offset] = end1 + 1; - for (int d = 0; d <= offset ; ++d) { + for (int d = 0; d <= offset; ++d) { // Down for (int k = -d; k <= d; k += 2) { // First step @@ -314,7 +314,7 @@ public class SequencesComparator { * @param end end index of the snake * @param diag diagonal number */ - public Snake(final int start, final int end, final int diag) { + Snake(final int start, final int end, final int diag) { this.start = start; this.end = end; this.diag = diag; diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java index e6a5334a1..ab5ffe2f3 100644 --- a/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java +++ b/src/main/java/org/apache/commons/collections4/trie/AbstractBitwiseTrie.java @@ -150,11 +150,11 @@ public abstract class AbstractBitwiseTrie extends AbstractMap protected V value; - public BasicEntry(final K key) { + BasicEntry(final K key) { this.key = key; } - public BasicEntry(final K key, final V value) { + BasicEntry(final K key, final V value) { this.key = key; this.value = value; } @@ -198,7 +198,7 @@ public abstract class AbstractBitwiseTrie extends AbstractMap return false; } - final Map.Entry other = (Map.Entry)o; + final Map.Entry other = (Map.Entry) o; if (compare(key, other.getKey()) && compare(value, other.getValue())) { return true; diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java index 9b694a85e..f06ea3d74 100644 --- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java +++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java @@ -55,7 +55,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { */ private transient volatile Set keySet; private transient volatile Collection values; - private transient volatile Set> entrySet; + private transient volatile Set> entrySet; /** The current size of the {@link org.apache.commons.collections4.Trie}. */ private transient int size = 0; @@ -192,7 +192,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { TrieEntry addEntry(final TrieEntry entry, final int lengthInBits) { TrieEntry current = root.left; TrieEntry path = root; - while(true) { + while (true) { if (current.bitIndex >= entry.bitIndex || current.bitIndex <= path.bitIndex) { entry.predecessor = entry; @@ -247,14 +247,14 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { *

* This may throw ClassCastException if the object is not of type K. */ - TrieEntry getEntry(final Object k) { + TrieEntry getEntry(final Object k) { final K key = castKey(k); if (key == null) { return null; } final int lengthInBits = lengthInBits(key); - final TrieEntry entry = getNearestEntryForKey(key, lengthInBits); + final TrieEntry entry = getNearestEntryForKey(key, lengthInBits); return !entry.isEmpty() && compareKeys(key, entry.key) ? entry : null; } @@ -385,7 +385,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { } @Override - public Set> entrySet() { + public Set> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } @@ -453,7 +453,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { TrieEntry getNearestEntryForKey(final K key, final int lengthInBits) { TrieEntry current = root.left; TrieEntry path = root; - while(true) { + while (true) { if (current.bitIndex <= path.bitIndex) { return current; } @@ -752,7 +752,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { * Goes left through the tree until it finds a valid node. */ TrieEntry followLeft(TrieEntry node) { - while(true) { + while (true) { TrieEntry child = node.left; // if we hit root and it didn't have a node, go right instead. if (child.isEmpty()) { @@ -878,7 +878,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { * Returns an entry strictly higher than the given key, * or null if no such entry exists. */ - TrieEntry higherEntry(final K key) { + TrieEntry higherEntry(final K key) { // TODO: Cleanup so that we don't actually have to add/remove from the // tree. (We do it here because there are other well-defined // functions to perform the search.) @@ -931,7 +931,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { * Returns a key-value mapping associated with the least key greater * than or equal to the given key, or null if there is no such key. */ - TrieEntry ceilingEntry(final K key) { + TrieEntry ceilingEntry(final K key) { // Basically: // Follow the steps of adding an entry, but instead... // @@ -990,7 +990,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { * Returns a key-value mapping associated with the greatest key * strictly less than the given key, or null if there is no such key. */ - TrieEntry lowerEntry(final K key) { + TrieEntry lowerEntry(final K key) { // Basically: // Follow the steps of adding an entry, but instead... // @@ -1042,7 +1042,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { * Returns a key-value mapping associated with the greatest key * less than or equal to the given key, or null if there is no such key. */ - TrieEntry floorEntry(final K key) { + TrieEntry floorEntry(final K key) { // TODO: Cleanup so that we don't actually have to add/remove from the // tree. (We do it here because there are other well-defined // functions to perform the search.) @@ -1091,7 +1091,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { TrieEntry subtree(final K prefix, final int offsetInBits, final int lengthInBits) { TrieEntry current = root.left; TrieEntry path = root; - while(true) { + while (true) { if (current.bitIndex <= path.bitIndex || lengthInBits <= current.bitIndex) { break; } @@ -1264,7 +1264,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * A {@link org.apache.commons.collections4.Trie} is a set of {@link TrieEntry} nodes. */ - protected static class TrieEntry extends BasicEntry { + protected static class TrieEntry extends BasicEntry { private static final long serialVersionUID = 4596023148184140013L; @@ -1272,16 +1272,16 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { protected int bitIndex; /** The parent of this entry. */ - protected TrieEntry parent; + protected TrieEntry parent; /** The left child of this entry. */ - protected TrieEntry left; + protected TrieEntry left; /** The right child of this entry. */ - protected TrieEntry right; + protected TrieEntry right; /** The entry who uplinks to this entry. */ - protected TrieEntry predecessor; + protected TrieEntry predecessor; public TrieEntry(final K key, final V value, final int bitIndex) { super(key, value); @@ -1365,7 +1365,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { buffer.append(", "); if (predecessor != null) { - if(predecessor.bitIndex == -1) { + if (predecessor.bitIndex == -1) { buffer.append("predecessor=").append("ROOT"); } else { buffer.append("predecessor=").append(predecessor.getKey()).append(" ["). @@ -1382,10 +1382,10 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * This is a entry set view of the {@link Trie} as returned by {@link Map#entrySet()}. */ - private class EntrySet extends AbstractSet> { + private class EntrySet extends AbstractSet> { @Override - public Iterator> iterator() { + public Iterator> iterator() { return new EntryIterator(); } @@ -1395,7 +1395,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { return false; } - final TrieEntry candidate = getEntry(((Map.Entry)o).getKey()); + final TrieEntry candidate = getEntry(((Map.Entry) o).getKey()); return candidate != null && candidate.equals(o); } @@ -1425,9 +1425,9 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * An {@link Iterator} that returns {@link Entry} Objects. */ - private class EntryIterator extends TrieIterator> { + private class EntryIterator extends TrieIterator> { @Override - public Map.Entry next() { + public Map.Entry next() { return nextEntry(); } } @@ -1552,12 +1552,12 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * Returns the next {@link TrieEntry}. */ - protected TrieEntry nextEntry() { + protected TrieEntry nextEntry() { if (expectedModCount != AbstractPatriciaTrie.this.modCount) { throw new ConcurrentModificationException(); } - final TrieEntry e = next; + final TrieEntry e = next; if (e == null) { throw new NoSuchElementException(); } @@ -1650,12 +1650,12 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { return nextEntry; } - protected TrieEntry previousEntry() { + protected TrieEntry previousEntry() { if (expectedModCount != AbstractPatriciaTrie.this.modCount) { throw new ConcurrentModificationException(); } - final TrieEntry e = previous; + final TrieEntry e = previous; if (e == null) { throw new NoSuchElementException(); } @@ -1881,7 +1881,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { @Override public K firstKey() { - Map.Entry e = null; + Map.Entry e = null; if (fromKey == null) { e = firstEntry(); } else { @@ -1901,7 +1901,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { @Override public K lastKey() { - Map.Entry e; + Map.Entry e; if (toKey == null) { e = lastEntry(); } else { @@ -1965,7 +1965,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * Creates a {@link RangeEntrySet}. */ - public RangeEntrySet(final RangeMap delegate) { + RangeEntrySet(final RangeMap delegate) { this.delegate = Objects.requireNonNull(delegate, "delegate"); } @@ -2049,14 +2049,14 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * An {@link Iterator} for {@link RangeEntrySet}s. */ - private final class EntryIterator extends TrieIterator> { + private final class EntryIterator extends TrieIterator> { private final K excludedKey; /** * Creates a {@link EntryIterator}. */ - private EntryIterator(final TrieEntry first, final TrieEntry last) { + private EntryIterator(final TrieEntry first, final TrieEntry last) { super(first); this.excludedKey = last != null ? last.getKey() : null; } @@ -2067,7 +2067,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { } @Override - public Map.Entry next() { + public Map.Entry next() { if (next == null || compare(next.key, excludedKey)) { throw new NoSuchElementException(); } @@ -2124,7 +2124,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { fromKey = entry == null ? null : entry.getKey(); if (fromKey != null) { - final TrieEntry prior = previousEntry((TrieEntry)entry); + final TrieEntry prior = previousEntry((TrieEntry) entry); fromKey = prior == null ? null : prior.getKey(); } @@ -2138,7 +2138,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { toKey = entry == null ? null : entry.getKey(); if (toKey != null) { - entry = nextEntry((TrieEntry)entry); + entry = nextEntry((TrieEntry) entry); toKey = entry == null ? null : entry.getKey(); } @@ -2152,7 +2152,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { public K firstKey() { fixup(); - Map.Entry e = null; + Map.Entry e = null; if (fromKey == null) { e = firstEntry(); } else { @@ -2171,7 +2171,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { public K lastKey() { fixup(); - Map.Entry e = null; + Map.Entry e = null; if (toKey == null) { e = lastEntry(); } else { @@ -2275,7 +2275,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { /** * Creates a {@link PrefixRangeEntrySet}. */ - public PrefixRangeEntrySet(final PrefixRangeMap delegate) { + PrefixRangeEntrySet(final PrefixRangeMap delegate) { super(delegate); this.delegate = delegate; } @@ -2286,14 +2286,14 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { } @Override - public Iterator> iterator() { + public Iterator> iterator() { if (AbstractPatriciaTrie.this.modCount != expectedModCount) { prefixStart = subtree(delegate.prefix, delegate.offsetInBits, delegate.lengthInBits); expectedModCount = AbstractPatriciaTrie.this.modCount; } if (prefixStart == null) { - final Set> empty = Collections.emptySet(); + final Set> empty = Collections.emptySet(); return empty.iterator(); } else if (delegate.lengthInBits > prefixStart.bitIndex) { return new SingletonIterator(prefixStart); @@ -2311,7 +2311,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { private int hit = 0; - public SingletonIterator(final TrieEntry entry) { + SingletonIterator(final TrieEntry entry) { this.entry = entry; } @@ -2368,7 +2368,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { } @Override - public Map.Entry next() { + public Map.Entry next() { final Map.Entry entry = nextEntry(); if (lastOne) { next = null; @@ -2419,7 +2419,7 @@ abstract class AbstractPatriciaTrie extends AbstractBitwiseTrie { stream.defaultReadObject(); root = new TrieEntry<>(null, null, -1); final int size = stream.readInt(); - for(int i = 0; i < size; i++){ + for (int i = 0; i < size; i++){ final K k = (K) stream.readObject(); final V v = (V) stream.readObject(); put(k, v); diff --git a/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java b/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java index 9552e5a5c..a6d25a5d5 100644 --- a/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java +++ b/src/main/java/org/apache/commons/collections4/trie/analyzer/StringKeyAnalyzer.java @@ -74,7 +74,7 @@ public class StringKeyAnalyzer extends KeyAnalyzer { // then figure out which bit makes the difference // and return it. char k = 0, f = 0; - for(int i = 0; i < length; i++) { + for (int i = 0; i < length; i++) { final int index1 = beginIndex1 + i; final int index2 = beginIndex2 + i; diff --git a/src/site/xdoc/bloomFilters.xml b/src/site/xdoc/bloomFilters.xml index ce1b9fb1e..3f551d773 100644 --- a/src/site/xdoc/bloomFilters.xml +++ b/src/site/xdoc/bloomFilters.xml @@ -1,13 +1,13 @@ - @@ -442,7 +442,7 @@ hadoopBloomFilter.add( new Key( "pear".getBytes () ) ); ]]>

@@ -961,7 +961,7 @@ for ( Map.Entry < BloomFilter , Collection < T >> entry : shards ) { } } } -// result is either null or contains the desired value. +// result is either null or contains the desired value. ]]> @@ -1134,4 +1134,4 @@ for ( Map.Entry < BloomFilter , Collection < T >> entry : shards ) { - \ No newline at end of file + diff --git a/src/site/xdoc/history.xml b/src/site/xdoc/history.xml index d8e120334..fb19a53f3 100644 --- a/src/site/xdoc/history.xml +++ b/src/site/xdoc/history.xml @@ -104,10 +104,10 @@ Notably MultiValueMap is a new more flexible implementation of MultiHashMap.

-Collections 3.2.2 Serialization support for unsafe classes in the functor package is disabled by default as -this can be exploited for remote code execution attacks. To re-enable the feature the system property -"org.apache.commons.collections.enableUnsafeSerialization" needs to be set to "true". Classes considered to be -unsafe are: CloneTransformer, ForClosure, InstantiateFactory, InstantiateTransformer, InvokerTransformer, +Collections 3.2.2 Serialization support for unsafe classes in the functor package is disabled by default as +this can be exploited for remote code execution attacks. To re-enable the feature the system property +"org.apache.commons.collections.enableUnsafeSerialization" needs to be set to "true". Classes considered to be +unsafe are: CloneTransformer, ForClosure, InstantiateFactory, InstantiateTransformer, InvokerTransformer, PrototypeCloneFactory, PrototypeSerializationFactory, WhileClosure. Fixes COLLECTIONS-580. Other bug fixes as well.

@@ -130,11 +130,11 @@ API for Iterable instances (FluentIterable).

Additionally, serialization support for unsafe classes in the functor package -has been completely removed (see entry for Collections 3.2.2 for more details). +has been completely removed (see entry for Collections 3.2.2 for more details).

-Collections 4.2 fixes some bugs in 4.1 and adds a few new enhancements: +Collections 4.2 fixes some bugs in 4.1 and adds a few new enhancements: Updates the platform requirement from Java 6 to 7, adds Automatic-Module-Name MANIFEST entry for Java 9 compatibility, and adds a few new APIs. diff --git a/src/site/xdoc/pick.xml b/src/site/xdoc/pick.xml index 3a610e525..a9bc1fdf0 100644 --- a/src/site/xdoc/pick.xml +++ b/src/site/xdoc/pick.xml @@ -33,18 +33,18 @@ Commons-Collections and the Java Collections Framework provide a wide variety of