diff --git a/CHANGES b/CHANGES index 23325798..5d365f39 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ - The fields of array-based containers are now protected. +- Entry.setValue() now works correctly in all iterators and iterator-like + methods of hash maps. Thanks to Nikita Sokolov for reporting that some + methods (e.g., fastForEach()) were not supporting setValue(). + 8.5.11 - Hash-based containers now expose ensureCapacity(). diff --git a/build.properties b/build.properties index 81e0c1c0..b6b246bf 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ javadoc.base=/usr/share/javadoc build.sysclasspath=ignore -version=8.5.11 +version=8.5.12 dist=dist src=src diff --git a/drv/AVLTreeMap.drv b/drv/AVLTreeMap.drv index dfaddaa5..1a9ab33c 100644 --- a/drv/AVLTreeMap.drv +++ b/drv/AVLTreeMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AVLTreeSet.drv b/drv/AVLTreeSet.drv index bbfff15a..c51ecce0 100644 --- a/drv/AVLTreeSet.drv +++ b/drv/AVLTreeSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractBidirectionalIterator.drv b/drv/AbstractBidirectionalIterator.drv index 494fb606..759495ba 100644 --- a/drv/AbstractBidirectionalIterator.drv +++ b/drv/AbstractBidirectionalIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractBigList.drv b/drv/AbstractBigList.drv index 11642aca..33ea6f55 100644 --- a/drv/AbstractBigList.drv +++ b/drv/AbstractBigList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractBigListIterator.drv b/drv/AbstractBigListIterator.drv index bd2d4fba..39b44703 100644 --- a/drv/AbstractBigListIterator.drv +++ b/drv/AbstractBigListIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractCollection.drv b/drv/AbstractCollection.drv index 5af2f724..5d28cfff 100644 --- a/drv/AbstractCollection.drv +++ b/drv/AbstractCollection.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractComparator.drv b/drv/AbstractComparator.drv index 610b6ec0..d571a1a4 100644 --- a/drv/AbstractComparator.drv +++ b/drv/AbstractComparator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractFunction.drv b/drv/AbstractFunction.drv index fc06cd0d..92ce8278 100644 --- a/drv/AbstractFunction.drv +++ b/drv/AbstractFunction.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractIterator.drv b/drv/AbstractIterator.drv index 26674ca8..b84711bb 100644 --- a/drv/AbstractIterator.drv +++ b/drv/AbstractIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractList.drv b/drv/AbstractList.drv index 6f13d273..af5b2efd 100644 --- a/drv/AbstractList.drv +++ b/drv/AbstractList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractListIterator.drv b/drv/AbstractListIterator.drv index 45845adb..1016f171 100644 --- a/drv/AbstractListIterator.drv +++ b/drv/AbstractListIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractMap.drv b/drv/AbstractMap.drv index aefdf3cb..769e420e 100644 --- a/drv/AbstractMap.drv +++ b/drv/AbstractMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractPriorityQueue.drv b/drv/AbstractPriorityQueue.drv index 79e3218e..189a48f5 100644 --- a/drv/AbstractPriorityQueue.drv +++ b/drv/AbstractPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractSet.drv b/drv/AbstractSet.drv index 786ca2a0..a5958d57 100644 --- a/drv/AbstractSet.drv +++ b/drv/AbstractSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractSortedMap.drv b/drv/AbstractSortedMap.drv index 7ab4b6f4..fd32e371 100644 --- a/drv/AbstractSortedMap.drv +++ b/drv/AbstractSortedMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractSortedSet.drv b/drv/AbstractSortedSet.drv index 7bdc048c..8d9eb40a 100644 --- a/drv/AbstractSortedSet.drv +++ b/drv/AbstractSortedSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Sebastiano Vigna + * Copyright (C) 2003-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractSpliterator.drv b/drv/AbstractSpliterator.drv index c9ccabf3..7dc888c6 100644 --- a/drv/AbstractSpliterator.drv +++ b/drv/AbstractSpliterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/AbstractStack.drv b/drv/AbstractStack.drv index 04e29b75..9c3a4abd 100644 --- a/drv/AbstractStack.drv +++ b/drv/AbstractStack.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayFIFOQueue.drv b/drv/ArrayFIFOQueue.drv index 904876dc..5c3697da 100644 --- a/drv/ArrayFIFOQueue.drv +++ b/drv/ArrayFIFOQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayFrontCodedBigList.drv b/drv/ArrayFrontCodedBigList.drv index 910581d0..59b3ccda 100644 --- a/drv/ArrayFrontCodedBigList.drv +++ b/drv/ArrayFrontCodedBigList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayFrontCodedList.drv b/drv/ArrayFrontCodedList.drv index 8edf0af7..c3c500fd 100644 --- a/drv/ArrayFrontCodedList.drv +++ b/drv/ArrayFrontCodedList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayIndirectPriorityQueue.drv b/drv/ArrayIndirectPriorityQueue.drv index bf78cadb..55ddda07 100644 --- a/drv/ArrayIndirectPriorityQueue.drv +++ b/drv/ArrayIndirectPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayList.drv b/drv/ArrayList.drv index 2387eeaf..0d885091 100644 --- a/drv/ArrayList.drv +++ b/drv/ArrayList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayMap.drv b/drv/ArrayMap.drv index 9e104a11..1d754947 100644 --- a/drv/ArrayMap.drv +++ b/drv/ArrayMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2022 Sebastiano Vigna + * Copyright (C) 2007-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArrayPriorityQueue.drv b/drv/ArrayPriorityQueue.drv index 39885ea6..f3465a2d 100644 --- a/drv/ArrayPriorityQueue.drv +++ b/drv/ArrayPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ArraySet.drv b/drv/ArraySet.drv index 0027a69b..812bf0b7 100644 --- a/drv/ArraySet.drv +++ b/drv/ArraySet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2022 Sebastiano Vigna + * Copyright (C) 2007-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Arrays.drv b/drv/Arrays.drv index 35f00e9c..7c5e0b15 100644 --- a/drv/Arrays.drv +++ b/drv/Arrays.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BidirectionalIterable.drv b/drv/BidirectionalIterable.drv index e603e607..2007aa0b 100644 --- a/drv/BidirectionalIterable.drv +++ b/drv/BidirectionalIterable.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BidirectionalIterator.drv b/drv/BidirectionalIterator.drv index 64164a74..18ef547e 100644 --- a/drv/BidirectionalIterator.drv +++ b/drv/BidirectionalIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigArrayBigList.drv b/drv/BigArrayBigList.drv index 35a59099..1cfd6dda 100644 --- a/drv/BigArrayBigList.drv +++ b/drv/BigArrayBigList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigArrays.drv b/drv/BigArrays.drv index b85247f8..92f78b27 100644 --- a/drv/BigArrays.drv +++ b/drv/BigArrays.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2022 Sebastiano Vigna + * Copyright (C) 2009-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigArraysCommon.drv b/drv/BigArraysCommon.drv index 04a64849..a502d204 100644 --- a/drv/BigArraysCommon.drv +++ b/drv/BigArraysCommon.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigArraysFragment.drv b/drv/BigArraysFragment.drv index b98bdc81..dfcaeb2c 100644 --- a/drv/BigArraysFragment.drv +++ b/drv/BigArraysFragment.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2022 Sebastiano Vigna + * Copyright (C) 2004-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigList.drv b/drv/BigList.drv index 2d9f1520..a6435225 100644 --- a/drv/BigList.drv +++ b/drv/BigList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigListIterator.drv b/drv/BigListIterator.drv index 4dc3bfd0..13ca1460 100644 --- a/drv/BigListIterator.drv +++ b/drv/BigListIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigListIterators.drv b/drv/BigListIterators.drv index 6446ba6c..461b4fd6 100644 --- a/drv/BigListIterators.drv +++ b/drv/BigListIterators.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigLists.drv b/drv/BigLists.drv index 4dbd4e54..38d364a2 100644 --- a/drv/BigLists.drv +++ b/drv/BigLists.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BigSpliterators.drv b/drv/BigSpliterators.drv index 7daa67bc..5798115f 100644 --- a/drv/BigSpliterators.drv +++ b/drv/BigSpliterators.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Sebastiano Vigna + * Copyright (C) 2019-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BinIO.drv b/drv/BinIO.drv index 96484363..0de5e179 100644 --- a/drv/BinIO.drv +++ b/drv/BinIO.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BinIOFragment.drv b/drv/BinIOFragment.drv index bc3c8ea6..96918e48 100644 --- a/drv/BinIOFragment.drv +++ b/drv/BinIOFragment.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2022 Sebastiano Vigna + * Copyright (C) 2004-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/BinaryOperator.drv b/drv/BinaryOperator.drv index 016f9d87..17884553 100644 --- a/drv/BinaryOperator.drv +++ b/drv/BinaryOperator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Collection.drv b/drv/Collection.drv index 0b9eaca9..2703bad5 100644 --- a/drv/Collection.drv +++ b/drv/Collection.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Collections.drv b/drv/Collections.drv index e4544619..d4817aff 100644 --- a/drv/Collections.drv +++ b/drv/Collections.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Comparator.drv b/drv/Comparator.drv index 8a4dd8b8..a3190771 100644 --- a/drv/Comparator.drv +++ b/drv/Comparator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Comparators.drv b/drv/Comparators.drv index 595f06bb..6386fe74 100644 --- a/drv/Comparators.drv +++ b/drv/Comparators.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Consumer.drv b/drv/Consumer.drv index 872621e1..51ba1c6d 100644 --- a/drv/Consumer.drv +++ b/drv/Consumer.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Sebastiano Vigna + * Copyright (C) 2017-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Function.drv b/drv/Function.drv index 6f39a0e4..cba1f709 100644 --- a/drv/Function.drv +++ b/drv/Function.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Functions.drv b/drv/Functions.drv index 56ec4fcf..422d4000 100644 --- a/drv/Functions.drv +++ b/drv/Functions.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Hash.drv b/drv/Hash.drv index 89cc2e73..f7af712e 100644 --- a/drv/Hash.drv +++ b/drv/Hash.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/HeapIndirectPriorityQueue.drv b/drv/HeapIndirectPriorityQueue.drv index 4f9c6c30..d4c3901d 100644 --- a/drv/HeapIndirectPriorityQueue.drv +++ b/drv/HeapIndirectPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/HeapPriorityQueue.drv b/drv/HeapPriorityQueue.drv index 6a3b3933..549349d4 100644 --- a/drv/HeapPriorityQueue.drv +++ b/drv/HeapPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/HeapSemiIndirectPriorityQueue.drv b/drv/HeapSemiIndirectPriorityQueue.drv index 45470525..5eaec06f 100644 --- a/drv/HeapSemiIndirectPriorityQueue.drv +++ b/drv/HeapSemiIndirectPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Heaps.drv b/drv/Heaps.drv index b827f237..3aca231a 100644 --- a/drv/Heaps.drv +++ b/drv/Heaps.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ImmutableList.drv b/drv/ImmutableList.drv index f2f02578..600f9f14 100644 --- a/drv/ImmutableList.drv +++ b/drv/ImmutableList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ImmutablePair.drv b/drv/ImmutablePair.drv index 604e8c42..c0dcb56e 100644 --- a/drv/ImmutablePair.drv +++ b/drv/ImmutablePair.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ImmutableSortedPair.drv b/drv/ImmutableSortedPair.drv index 26023a8f..c7c314a8 100644 --- a/drv/ImmutableSortedPair.drv +++ b/drv/ImmutableSortedPair.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/IndirectHeaps.drv b/drv/IndirectHeaps.drv index c9a7d818..3aef1209 100644 --- a/drv/IndirectHeaps.drv +++ b/drv/IndirectHeaps.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/IndirectPriorityQueue.drv b/drv/IndirectPriorityQueue.drv index 7d5c67f3..d55e7096 100644 --- a/drv/IndirectPriorityQueue.drv +++ b/drv/IndirectPriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Iterable.drv b/drv/Iterable.drv index 25912d5c..eaa9d458 100644 --- a/drv/Iterable.drv +++ b/drv/Iterable.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Iterables.drv b/drv/Iterables.drv index 53163aa7..27fc0270 100644 --- a/drv/Iterables.drv +++ b/drv/Iterables.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Iterator.drv b/drv/Iterator.drv index 8aa78a49..74c1cb67 100644 --- a/drv/Iterator.drv +++ b/drv/Iterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Iterators.drv b/drv/Iterators.drv index 1e26719c..56d3392e 100644 --- a/drv/Iterators.drv +++ b/drv/Iterators.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/List.drv b/drv/List.drv index 6f5ece3a..19e5a9b4 100644 --- a/drv/List.drv +++ b/drv/List.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/ListIterator.drv b/drv/ListIterator.drv index d323144d..d9304608 100644 --- a/drv/ListIterator.drv +++ b/drv/ListIterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Lists.drv b/drv/Lists.drv index 9c289d03..91ff63da 100644 --- a/drv/Lists.drv +++ b/drv/Lists.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Map.drv b/drv/Map.drv index 4e2afa06..d54e588f 100644 --- a/drv/Map.drv +++ b/drv/Map.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/MappedBigList.drv b/drv/MappedBigList.drv index 7ef36ae1..67cd9286 100644 --- a/drv/MappedBigList.drv +++ b/drv/MappedBigList.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Maps.drv b/drv/Maps.drv index 54d72ef8..c25d27ae 100644 --- a/drv/Maps.drv +++ b/drv/Maps.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/MutablePair.drv b/drv/MutablePair.drv index 7b3caf5c..2512b8ac 100644 --- a/drv/MutablePair.drv +++ b/drv/MutablePair.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/OpenHashBigSet.drv b/drv/OpenHashBigSet.drv index 915453e8..c0afbf86 100644 --- a/drv/OpenHashBigSet.drv +++ b/drv/OpenHashBigSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/OpenHashMap.drv b/drv/OpenHashMap.drv index ca5c6e84..b06c4acf 100644 --- a/drv/OpenHashMap.drv +++ b/drv/OpenHashMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2309,19 +2309,17 @@ public class OPEN_HASH_MAP KEY_VALUE_GENERIC extends ABSTRACT_MAP KEY_VALUE_GENE for(int i = size, curr, next = first; i-- != 0;) { curr = next; next = GET_NEXT(link[curr]); - consumer.accept(new ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC(key[curr], value[curr])); + consumer.accept(new MapEntry(curr)); } } /** {@inheritDoc} */ @Override public void fastForEach(final Consumer consumer) { - final ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC entry = new ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC_DIAMOND(); - for(int i = size, curr, next = first; i-- != 0;) { - curr = next; - next = GET_NEXT(link[curr]); - entry.key = key[curr]; - entry.value = value[curr]; + final MapEntry entry = new MapEntry(); + for(int i = size, next = first; i-- != 0;) { + entry.index = next; + next = GET_NEXT(link[next]); consumer.accept(entry); } } @@ -2331,24 +2329,22 @@ public class OPEN_HASH_MAP KEY_VALUE_GENERIC extends ABSTRACT_MAP KEY_VALUE_GENE /** {@inheritDoc} */ @Override public void forEach(final Consumer consumer) { - if (containsNullKey) consumer.accept(new ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC(key[n], value[n])); + if (containsNullKey) consumer.accept(new MapEntry(n)); for(int pos = n; pos-- != 0;) - if (! KEY_IS_NULL(key[pos])) consumer.accept(new ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC(key[pos], value[pos])); + if (! KEY_IS_NULL(key[pos])) consumer.accept(new MapEntry(pos)); } /** {@inheritDoc} */ @Override public void fastForEach(final Consumer consumer) { - final ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC entry = new ABSTRACT_MAP.BasicEntry KEY_VALUE_GENERIC_DIAMOND(); + final MapEntry entry = new MapEntry(); if (containsNullKey) { - entry.key = key[n]; - entry.value = value[n]; + entry.index = n; consumer.accept(entry); } for(int pos = n; pos-- != 0;) if (! KEY_IS_NULL(key[pos])) { - entry.key = key[pos]; - entry.value = value[pos]; + entry.index = pos; consumer.accept(entry); } } diff --git a/drv/OpenHashSet.drv b/drv/OpenHashSet.drv index 72aae78d..624d2449 100644 --- a/drv/OpenHashSet.drv +++ b/drv/OpenHashSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Pair.drv b/drv/Pair.drv index 38115194..c2f80d85 100644 --- a/drv/Pair.drv +++ b/drv/Pair.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Predicate.drv b/drv/Predicate.drv index 70708d31..3c7cdf62 100644 --- a/drv/Predicate.drv +++ b/drv/Predicate.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/PriorityQueue.drv b/drv/PriorityQueue.drv index e03be101..0c891345 100644 --- a/drv/PriorityQueue.drv +++ b/drv/PriorityQueue.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/PriorityQueues.drv b/drv/PriorityQueues.drv index 17fc6e0d..9075108d 100644 --- a/drv/PriorityQueues.drv +++ b/drv/PriorityQueues.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Sebastiano Vigna + * Copyright (C) 2003-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/RBTreeMap.drv b/drv/RBTreeMap.drv index 34900164..4f0a1b65 100644 --- a/drv/RBTreeMap.drv +++ b/drv/RBTreeMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/RBTreeSet.drv b/drv/RBTreeSet.drv index 443a0ac6..fc2380d3 100644 --- a/drv/RBTreeSet.drv +++ b/drv/RBTreeSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SemiIndirectHeaps.drv b/drv/SemiIndirectHeaps.drv index 1da5d3e8..3d77bb69 100644 --- a/drv/SemiIndirectHeaps.drv +++ b/drv/SemiIndirectHeaps.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Set.drv b/drv/Set.drv index 46bd2c33..8823485d 100644 --- a/drv/Set.drv +++ b/drv/Set.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Sets.drv b/drv/Sets.drv index 67c4dc35..27ea67c2 100644 --- a/drv/Sets.drv +++ b/drv/Sets.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SortedMap.drv b/drv/SortedMap.drv index eb456b79..b3a8d043 100644 --- a/drv/SortedMap.drv +++ b/drv/SortedMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SortedMaps.drv b/drv/SortedMaps.drv index 6a0545f9..bb24eb54 100644 --- a/drv/SortedMaps.drv +++ b/drv/SortedMaps.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SortedPair.drv b/drv/SortedPair.drv index 51c4e236..802e9d9d 100644 --- a/drv/SortedPair.drv +++ b/drv/SortedPair.drv @@ -1,7 +1,7 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SortedSet.drv b/drv/SortedSet.drv index cd297e32..6e8d6bd8 100644 --- a/drv/SortedSet.drv +++ b/drv/SortedSet.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/SortedSets.drv b/drv/SortedSets.drv index 36fba47f..ea293502 100644 --- a/drv/SortedSets.drv +++ b/drv/SortedSets.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Spliterator.drv b/drv/Spliterator.drv index 5246547a..13dbdb20 100644 --- a/drv/Spliterator.drv +++ b/drv/Spliterator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Spliterators.drv b/drv/Spliterators.drv index 1f9ff9f6..757a3915 100644 --- a/drv/Spliterators.drv +++ b/drv/Spliterators.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/Stack.drv b/drv/Stack.drv index 2869183e..ac149a95 100644 --- a/drv/Stack.drv +++ b/drv/Stack.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/StripedOpenHashMap.drv b/drv/StripedOpenHashMap.drv index 55e0450c..3c2d7a61 100644 --- a/drv/StripedOpenHashMap.drv +++ b/drv/StripedOpenHashMap.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/TextIO.drv b/drv/TextIO.drv index 9bff67cd..de92cbf2 100644 --- a/drv/TextIO.drv +++ b/drv/TextIO.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/TextIOFragment.drv b/drv/TextIOFragment.drv index d8c35e10..132af474 100644 --- a/drv/TextIOFragment.drv +++ b/drv/TextIOFragment.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2022 Sebastiano Vigna + * Copyright (C) 2004-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/drv/UnaryOperator.drv b/drv/UnaryOperator.drv index 5c9c67fd..6fabaf21 100644 --- a/drv/UnaryOperator.drv +++ b/drv/UnaryOperator.drv @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/AbstractIndirectPriorityQueue.java b/src/it/unimi/dsi/fastutil/AbstractIndirectPriorityQueue.java index 3a4f9243..708e5809 100644 --- a/src/it/unimi/dsi/fastutil/AbstractIndirectPriorityQueue.java +++ b/src/it/unimi/dsi/fastutil/AbstractIndirectPriorityQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/AbstractPriorityQueue.java b/src/it/unimi/dsi/fastutil/AbstractPriorityQueue.java index 5e65b508..c167f7c6 100644 --- a/src/it/unimi/dsi/fastutil/AbstractPriorityQueue.java +++ b/src/it/unimi/dsi/fastutil/AbstractPriorityQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/AbstractStack.java b/src/it/unimi/dsi/fastutil/AbstractStack.java index 3b82d7ca..8f480650 100644 --- a/src/it/unimi/dsi/fastutil/AbstractStack.java +++ b/src/it/unimi/dsi/fastutil/AbstractStack.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Arrays.java b/src/it/unimi/dsi/fastutil/Arrays.java index e66ae0f8..c23f7bc5 100644 --- a/src/it/unimi/dsi/fastutil/Arrays.java +++ b/src/it/unimi/dsi/fastutil/Arrays.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/BidirectionalIterator.java b/src/it/unimi/dsi/fastutil/BidirectionalIterator.java index 0b5c829e..81953a86 100644 --- a/src/it/unimi/dsi/fastutil/BidirectionalIterator.java +++ b/src/it/unimi/dsi/fastutil/BidirectionalIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/BigList.java b/src/it/unimi/dsi/fastutil/BigList.java index 394789e9..a67547fe 100644 --- a/src/it/unimi/dsi/fastutil/BigList.java +++ b/src/it/unimi/dsi/fastutil/BigList.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/BigListIterator.java b/src/it/unimi/dsi/fastutil/BigListIterator.java index c088cc4b..12d3af0c 100644 --- a/src/it/unimi/dsi/fastutil/BigListIterator.java +++ b/src/it/unimi/dsi/fastutil/BigListIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/BigSwapper.java b/src/it/unimi/dsi/fastutil/BigSwapper.java index b186ae37..cc45b9c9 100644 --- a/src/it/unimi/dsi/fastutil/BigSwapper.java +++ b/src/it/unimi/dsi/fastutil/BigSwapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Function.java b/src/it/unimi/dsi/fastutil/Function.java index d5988009..6a3253d7 100644 --- a/src/it/unimi/dsi/fastutil/Function.java +++ b/src/it/unimi/dsi/fastutil/Function.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Hash.java b/src/it/unimi/dsi/fastutil/Hash.java index 3266a14e..3d9232a9 100644 --- a/src/it/unimi/dsi/fastutil/Hash.java +++ b/src/it/unimi/dsi/fastutil/Hash.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/HashCommon.java b/src/it/unimi/dsi/fastutil/HashCommon.java index 656f4131..e1e2ac10 100644 --- a/src/it/unimi/dsi/fastutil/HashCommon.java +++ b/src/it/unimi/dsi/fastutil/HashCommon.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/IndirectPriorityQueue.java b/src/it/unimi/dsi/fastutil/IndirectPriorityQueue.java index 4f813ada..ff8c9cb9 100644 --- a/src/it/unimi/dsi/fastutil/IndirectPriorityQueue.java +++ b/src/it/unimi/dsi/fastutil/IndirectPriorityQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/IndirectPriorityQueues.java b/src/it/unimi/dsi/fastutil/IndirectPriorityQueues.java index 123ed79c..43a9a8f7 100644 --- a/src/it/unimi/dsi/fastutil/IndirectPriorityQueues.java +++ b/src/it/unimi/dsi/fastutil/IndirectPriorityQueues.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Sebastiano Vigna + * Copyright (C) 2003-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Pair.java b/src/it/unimi/dsi/fastutil/Pair.java index 048a2768..853825e2 100644 --- a/src/it/unimi/dsi/fastutil/Pair.java +++ b/src/it/unimi/dsi/fastutil/Pair.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/PriorityQueue.java b/src/it/unimi/dsi/fastutil/PriorityQueue.java index ea78883e..fe0084bf 100644 --- a/src/it/unimi/dsi/fastutil/PriorityQueue.java +++ b/src/it/unimi/dsi/fastutil/PriorityQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna + * Copyright (C) 2003-2023 Paolo Boldi and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/PriorityQueues.java b/src/it/unimi/dsi/fastutil/PriorityQueues.java index 5f641be8..817f55a1 100644 --- a/src/it/unimi/dsi/fastutil/PriorityQueues.java +++ b/src/it/unimi/dsi/fastutil/PriorityQueues.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2022 Sebastiano Vigna + * Copyright (C) 2003-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/SafeMath.java b/src/it/unimi/dsi/fastutil/SafeMath.java index ee790c4e..791aa6b3 100644 --- a/src/it/unimi/dsi/fastutil/SafeMath.java +++ b/src/it/unimi/dsi/fastutil/SafeMath.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2022 Sebastiano Vigna + * Copyright (C) 2017-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Size64.java b/src/it/unimi/dsi/fastutil/Size64.java index 6656ce0a..272b91d8 100644 --- a/src/it/unimi/dsi/fastutil/Size64.java +++ b/src/it/unimi/dsi/fastutil/Size64.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/SortedPair.java b/src/it/unimi/dsi/fastutil/SortedPair.java index 4b981b56..905a5739 100644 --- a/src/it/unimi/dsi/fastutil/SortedPair.java +++ b/src/it/unimi/dsi/fastutil/SortedPair.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Sebastiano Vigna + * Copyright (C) 2020-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Stack.java b/src/it/unimi/dsi/fastutil/Stack.java index 3684f3e0..8810ad4a 100644 --- a/src/it/unimi/dsi/fastutil/Stack.java +++ b/src/it/unimi/dsi/fastutil/Stack.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2022 Sebastiano Vigna + * Copyright (C) 2002-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/Swapper.java b/src/it/unimi/dsi/fastutil/Swapper.java index a13301f4..7e2fdc93 100644 --- a/src/it/unimi/dsi/fastutil/Swapper.java +++ b/src/it/unimi/dsi/fastutil/Swapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2022 Sebastiano Vigna + * Copyright (C) 2010-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/FastBufferedInputStream.java b/src/it/unimi/dsi/fastutil/io/FastBufferedInputStream.java index 5f9b2f17..69a5a0dc 100644 --- a/src/it/unimi/dsi/fastutil/io/FastBufferedInputStream.java +++ b/src/it/unimi/dsi/fastutil/io/FastBufferedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/FastBufferedOutputStream.java b/src/it/unimi/dsi/fastutil/io/FastBufferedOutputStream.java index 6a49f01e..44432edb 100644 --- a/src/it/unimi/dsi/fastutil/io/FastBufferedOutputStream.java +++ b/src/it/unimi/dsi/fastutil/io/FastBufferedOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java b/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java index fdb7aa14..33147334 100644 --- a/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java +++ b/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/FastByteArrayOutputStream.java b/src/it/unimi/dsi/fastutil/io/FastByteArrayOutputStream.java index 00d53567..3c585276 100644 --- a/src/it/unimi/dsi/fastutil/io/FastByteArrayOutputStream.java +++ b/src/it/unimi/dsi/fastutil/io/FastByteArrayOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/FastMultiByteArrayInputStream.java b/src/it/unimi/dsi/fastutil/io/FastMultiByteArrayInputStream.java index 5a494fa6..3a46dbfe 100644 --- a/src/it/unimi/dsi/fastutil/io/FastMultiByteArrayInputStream.java +++ b/src/it/unimi/dsi/fastutil/io/FastMultiByteArrayInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java b/src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java index 68375689..682611b6 100644 --- a/src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java +++ b/src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/MeasurableInputStream.java b/src/it/unimi/dsi/fastutil/io/MeasurableInputStream.java index c99a038f..16a6695f 100644 --- a/src/it/unimi/dsi/fastutil/io/MeasurableInputStream.java +++ b/src/it/unimi/dsi/fastutil/io/MeasurableInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/MeasurableOutputStream.java b/src/it/unimi/dsi/fastutil/io/MeasurableOutputStream.java index be6bd599..13b78ad4 100644 --- a/src/it/unimi/dsi/fastutil/io/MeasurableOutputStream.java +++ b/src/it/unimi/dsi/fastutil/io/MeasurableOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/MeasurableStream.java b/src/it/unimi/dsi/fastutil/io/MeasurableStream.java index 3cbf7861..b237a066 100644 --- a/src/it/unimi/dsi/fastutil/io/MeasurableStream.java +++ b/src/it/unimi/dsi/fastutil/io/MeasurableStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/it/unimi/dsi/fastutil/io/RepositionableStream.java b/src/it/unimi/dsi/fastutil/io/RepositionableStream.java index 84105abc..0610edd1 100644 --- a/src/it/unimi/dsi/fastutil/io/RepositionableStream.java +++ b/src/it/unimi/dsi/fastutil/io/RepositionableStream.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2022 Sebastiano Vigna + * Copyright (C) 2005-2023 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/it/unimi/dsi/fastutil/ints/Int2IntLinkedOpenHashMapTest.java b/test/it/unimi/dsi/fastutil/ints/Int2IntLinkedOpenHashMapTest.java index 6c251e6a..e1aec7c7 100644 --- a/test/it/unimi/dsi/fastutil/ints/Int2IntLinkedOpenHashMapTest.java +++ b/test/it/unimi/dsi/fastutil/ints/Int2IntLinkedOpenHashMapTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import it.unimi.dsi.fastutil.Hash; import it.unimi.dsi.fastutil.HashCommon; import it.unimi.dsi.fastutil.ints.Int2IntMap.Entry; +import it.unimi.dsi.fastutil.objects.ObjectIterator; public class Int2IntLinkedOpenHashMapTest { @Test @@ -60,13 +61,13 @@ public class Int2IntLinkedOpenHashMapTest { for (int i = 0; i < 100; i++) { assertEquals(0, s.put(i, i)); } - for (int i = 100; i-- != 0; ) { + for (int i = 100; i-- != 0;) { assertEquals(i, s.removeLastInt()); } assertTrue(s.isEmpty()); s = new Int2IntLinkedOpenHashMap(Hash.DEFAULT_INITIAL_SIZE); - for (int i = 100; i-- != 0; ) { + for (int i = 100; i-- != 0;) { assertEquals(0, s.put(i, i)); } for (int i = 0; i < 100; i++) { @@ -75,10 +76,10 @@ public class Int2IntLinkedOpenHashMapTest { assertTrue(s.isEmpty()); s = new Int2IntLinkedOpenHashMap(Hash.DEFAULT_INITIAL_SIZE); - for (int i = 100; i-- != 0; ) { + for (int i = 100; i-- != 0;) { assertEquals(0, s.put(i, i)); } - for (int i = 100; i-- != 0; ) { + for (int i = 100; i-- != 0;) { assertEquals(i, s.removeFirstInt()); } assertTrue(s.isEmpty()); @@ -100,7 +101,8 @@ public class Int2IntLinkedOpenHashMapTest { final IntOpenHashSet t = new IntOpenHashSet(); t.add(iterator.nextInt()); t.add(iterator.nextInt()); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice iterator.remove(); t.add(iterator.nextInt()); assertEquals(keys, t); @@ -110,7 +112,8 @@ public class Int2IntLinkedOpenHashMapTest { public void testWrapAround2() { final Int2IntLinkedOpenHashMap m = new Int2IntLinkedOpenHashMap(4, .75f); assertEquals(8, m.n); - // The following code inverts HashCommon.phiMix() and places strategically keys in slots 4, 5, 6, 7 and 0 + // The following code inverts HashCommon.phiMix() and places strategically keys in slots 4, 5, 6, 7 + // and 0 m.put(HashCommon.invMix(4), 0); m.put(HashCommon.invMix(5), 0); m.put(HashCommon.invMix(4 + 8), 0); @@ -121,21 +124,22 @@ public class Int2IntLinkedOpenHashMapTest { assertNotEquals(0, m.key[5]); assertNotEquals(0, m.key[6]); assertNotEquals(0, m.key[7]); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); final IntOpenHashSet keys = new IntOpenHashSet(m.keySet()); final IntIterator iterator = m.keySet().iterator(); final IntOpenHashSet t = new IntOpenHashSet(); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); - //System.err.println(Arraym.toString(m.key)); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // System.err.println(Arraym.toString(m.key)); + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice assertTrue(t.add(iterator.nextInt())); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); assertEquals(3, m.size()); assertEquals(keys, t); @@ -145,7 +149,8 @@ public class Int2IntLinkedOpenHashMapTest { public void testWrapAround3() { final Int2IntLinkedOpenHashMap m = new Int2IntLinkedOpenHashMap(4, .75f); assertEquals(8, m.n); - // The following code inverts HashCommon.phiMix() and places strategically keys in slots 5, 6, 7, 0 and 1 + // The following code inverts HashCommon.phiMix() and places strategically keys in slots 5, 6, 7, 0 + // and 1 m.put(HashCommon.invMix(5), 0); m.put(HashCommon.invMix(5 + 8), 0); m.put(HashCommon.invMix(5 + 16), 0); @@ -156,23 +161,24 @@ public class Int2IntLinkedOpenHashMapTest { assertNotEquals(0, m.key[7]); assertNotEquals(0, m.key[0]); assertNotEquals(0, m.key[1]); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); final IntOpenHashSet keys = new IntOpenHashSet(m.keySet()); final IntIterator iterator = m.keySet().iterator(); final IntOpenHashSet t = new IntOpenHashSet(); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // System.err.println(Arraym.toString(m.key)); + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - //System.err.println(Arraym.toString(m.key)); + // System.err.println(Arraym.toString(m.key)); assertTrue(t.add(iterator.nextInt())); iterator.remove(); assertEquals(0, m.size()); @@ -182,10 +188,11 @@ public class Int2IntLinkedOpenHashMapTest { @Test public void testEntrySetForEach() { final int[] a = new int[1000]; - for(int i = 0; i < 1000; i++) a[i] = a.length - 1 - i; + for (int i = 0; i < 1000; i++) a[i] = a.length - 1 - i; final Int2IntLinkedOpenHashMap m = new Int2IntLinkedOpenHashMap(a, a); m.int2IntEntrySet().forEach(new Consumer() { int i = a.length; + @Override public void accept(final Entry t) { assertEquals(--i, t.getIntKey()); @@ -193,6 +200,7 @@ public class Int2IntLinkedOpenHashMapTest { }); m.int2IntEntrySet().fastForEach(new Consumer() { int i = a.length; + @Override public void accept(final Entry t) { assertEquals(--i, t.getIntKey()); @@ -207,4 +215,41 @@ public class Int2IntLinkedOpenHashMapTest { s.removeLastInt(); assertFalse(s.int2IntEntrySet().iterator().hasNext()); } + + @Test + public void testSetValue() { + final Int2IntLinkedOpenHashMap s = new Int2IntLinkedOpenHashMap(); + + for (int i = 0; i < 20; i++) s.put(i, i); + final ObjectIterator f = s.int2IntEntrySet().fastIterator(); + while (f.hasNext()) { + final Entry e = f.next(); + e.setValue(e.getIntValue() + 20); + } + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + final ObjectIterator n = s.int2IntEntrySet().iterator(); + while (n.hasNext()) { + final Entry e = n.next(); + e.setValue(e.getIntValue() + 20); + } + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().fastIterator().forEachRemaining(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().iterator().forEachRemaining(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().forEach(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().fastForEach(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + } } diff --git a/test/it/unimi/dsi/fastutil/ints/Int2IntOpenHashMapTest.java b/test/it/unimi/dsi/fastutil/ints/Int2IntOpenHashMapTest.java index 8dac952c..f5788d72 100644 --- a/test/it/unimi/dsi/fastutil/ints/Int2IntOpenHashMapTest.java +++ b/test/it/unimi/dsi/fastutil/ints/Int2IntOpenHashMapTest.java @@ -33,7 +33,7 @@ public class Int2IntOpenHashMapTest { @SuppressWarnings("deprecation") @Test public void testContainsNull() { - final Int2IntOpenHashMap m = new Int2IntOpenHashMap(new int[] {1, 2, 3}, new int[] {1, 2, 3}); + final Int2IntOpenHashMap m = new Int2IntOpenHashMap(new int[] { 1, 2, 3 }, new int[] { 1, 2, 3 }); assertFalse(m.containsKey(null)); assertTrue(m.get(null) == null); } @@ -41,35 +41,26 @@ public class Int2IntOpenHashMapTest { @SuppressWarnings({ "boxing", "unlikely-arg-type" }) @Test public void testEquals() { - final Int2IntOpenHashMap m = new Int2IntOpenHashMap(new int[] {1, 2}, new int[] {1, 2}); - assertFalse(m.equals(new Object2ObjectOpenHashMap<>(new Integer[] {1, null}, new Integer[] {1, 1}))); + final Int2IntOpenHashMap m = new Int2IntOpenHashMap(new int[] { 1, 2 }, new int[] { 1, 2 }); + assertFalse(m.equals(new Object2ObjectOpenHashMap<>(new Integer[] { 1, null }, new Integer[] { 1, 1 }))); } @Test public void testStrangeRetainAllCase() { - final IntArrayList initialElements = IntArrayList.wrap(new int[] {586, 940, - 1086, 1110, 1168, 1184, 1185, 1191, 1196, 1229, 1237, 1241, - 1277, 1282, 1284, 1299, 1308, 1309, 1310, 1314, 1328, 1360, - 1366, 1370, 1378, 1388, 1392, 1402, 1406, 1411, 1426, 1437, - 1455, 1476, 1489, 1513, 1533, 1538, 1540, 1541, 1543, 1547, - 1548, 1551, 1557, 1568, 1575, 1577, 1582, 1583, 1584, 1588, - 1591, 1592, 1601, 1610, 1618, 1620, 1633, 1635, 1653, 1654, - 1655, 1660, 1661, 1665, 1674, 1686, 1688, 1693, 1700, 1705, - 1717, 1720, 1732, 1739, 1740, 1745, 1746, 1752, 1754, 1756, - 1765, 1766, 1767, 1771, 1772, 1781, 1789, 1790, 1793, 1801, - 1806, 1823, 1825, 1827, 1828, 1829, 1831, 1832, 1837, 1839, - 1844, 2962, 2969, 2974, 2990, 3019, 3023, 3029, 3030, 3052, - 3072, 3074, 3075, 3093, 3109, 3110, 3115, 3116, 3125, 3137, - 3142, 3156, 3160, 3176, 3180, 3188, 3193, 3198, 3207, 3209, - 3210, 3213, 3214, 3221, 3225, 3230, 3231, 3236, 3240, 3247, - 3261, 4824, 4825, 4834, 4845, 4852, 4858, 4859, 4867, 4871, - 4883, 4886, 4887, 4905, 4907, 4911, 4920, 4923, 4924, 4925, - 4934, 4942, 4953, 4957, 4965, 4973, 4976, 4980, 4982, 4990, - 4993, 6938, 6949, 6953, 7010, 7012, 7034, 7037, 7049, 7076, - 7094, 7379, 7384, 7388, 7394, 7414, 7419, 7458, 7459, 7466, - 7467}); + final IntArrayList initialElements = IntArrayList.wrap(new int[] { 586, 940, 1086, 1110, 1168, 1184, 1185, 1191, + 1196, 1229, 1237, 1241, 1277, 1282, 1284, 1299, 1308, 1309, 1310, 1314, 1328, 1360, 1366, 1370, 1378, + 1388, 1392, 1402, 1406, 1411, 1426, 1437, 1455, 1476, 1489, 1513, 1533, 1538, 1540, 1541, 1543, 1547, + 1548, 1551, 1557, 1568, 1575, 1577, 1582, 1583, 1584, 1588, 1591, 1592, 1601, 1610, 1618, 1620, 1633, + 1635, 1653, 1654, 1655, 1660, 1661, 1665, 1674, 1686, 1688, 1693, 1700, 1705, 1717, 1720, 1732, 1739, + 1740, 1745, 1746, 1752, 1754, 1756, 1765, 1766, 1767, 1771, 1772, 1781, 1789, 1790, 1793, 1801, 1806, + 1823, 1825, 1827, 1828, 1829, 1831, 1832, 1837, 1839, 1844, 2962, 2969, 2974, 2990, 3019, 3023, 3029, + 3030, 3052, 3072, 3074, 3075, 3093, 3109, 3110, 3115, 3116, 3125, 3137, 3142, 3156, 3160, 3176, 3180, + 3188, 3193, 3198, 3207, 3209, 3210, 3213, 3214, 3221, 3225, 3230, 3231, 3236, 3240, 3247, 3261, 4824, + 4825, 4834, 4845, 4852, 4858, 4859, 4867, 4871, 4883, 4886, 4887, 4905, 4907, 4911, 4920, 4923, 4924, + 4925, 4934, 4942, 4953, 4957, 4965, 4973, 4976, 4980, 4982, 4990, 4993, 6938, 6949, 6953, 7010, 7012, + 7034, 7037, 7049, 7076, 7094, 7379, 7384, 7388, 7394, 7414, 7419, 7458, 7459, 7466, 7467 }); - final IntArrayList retainElements = IntArrayList.wrap(new int[] {586}); + final IntArrayList retainElements = IntArrayList.wrap(new int[] { 586 }); // Initialize both implementations with the same data final Int2IntOpenHashMap instance = new Int2IntOpenHashMap(initialElements.elements(), new int[initialElements.size()]); @@ -98,7 +89,8 @@ public class Int2IntOpenHashMapTest { final IntOpenHashSet t = new IntOpenHashSet(); t.add(iterator.nextInt()); t.add(iterator.nextInt()); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice iterator.remove(); t.add(iterator.nextInt()); assertEquals(keys, t); @@ -108,7 +100,8 @@ public class Int2IntOpenHashMapTest { public void testWrapAround2() { final Int2IntOpenHashMap m = new Int2IntOpenHashMap(4, .75f); assertEquals(8, m.n); - // The following code inverts HashCommon.phiMix() and places strategically keys in slots 4, 5, 6, 7 and 0 + // The following code inverts HashCommon.phiMix() and places strategically keys in slots 4, 5, 6, 7 + // and 0 m.put(HashCommon.invMix(4), 0); m.put(HashCommon.invMix(5), 0); m.put(HashCommon.invMix(4 + 8), 0); @@ -126,7 +119,8 @@ public class Int2IntOpenHashMapTest { assertTrue(t.add(iterator.nextInt())); iterator.remove(); assertTrue(t.add(iterator.nextInt())); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice assertTrue(t.add(iterator.nextInt())); assertTrue(t.add(iterator.nextInt())); iterator.remove(); @@ -139,7 +133,8 @@ public class Int2IntOpenHashMapTest { public void testWrapAround3() { final Int2IntOpenHashMap m = new Int2IntOpenHashMap(4, .75f); assertEquals(8, m.n); - // The following code inverts HashCommon.phiMix() and places strategically keys in slots 5, 6, 7, 0 and 1 + // The following code inverts HashCommon.phiMix() and places strategically keys in slots 5, 6, 7, 0 + // and 1 m.put(HashCommon.invMix(5), 0); m.put(HashCommon.invMix(5 + 8), 0); m.put(HashCommon.invMix(5 + 16), 0); @@ -158,7 +153,8 @@ public class Int2IntOpenHashMapTest { iterator.remove(); assertTrue(t.add(iterator.nextInt())); iterator.remove(); - // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in 0 twice + // Originally, this remove would move the entry in slot 0 in slot 6 and we would return the entry in + // 0 twice assertTrue(t.add(iterator.nextInt())); iterator.remove(); assertTrue(t.add(iterator.nextInt())); @@ -183,7 +179,7 @@ public class Int2IntOpenHashMapTest { s = new Int2IntOpenHashMap(6, .75f); assertEquals(8, s.n); - for(int i = 0; i < 6; i++) s.put(i, i); + for (int i = 0; i < 6; i++) s.put(i, i); assertEquals(8, s.n); s.trim(2); assertEquals(8, s.n); @@ -226,4 +222,41 @@ public class Int2IntOpenHashMapTest { assertEquals((100 * 99) / 2, c[0]); } + @Test + public void testSetValue() { + final Int2IntOpenHashMap s = new Int2IntOpenHashMap(); + + for (int i = 0; i < 20; i++) s.put(i, i); + final ObjectIterator f = s.int2IntEntrySet().fastIterator(); + while (f.hasNext()) { + final Entry e = f.next(); + e.setValue(e.getIntValue() + 20); + } + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + final ObjectIterator n = s.int2IntEntrySet().iterator(); + while (n.hasNext()) { + final Entry e = n.next(); + e.setValue(e.getIntValue() + 20); + } + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().fastIterator().forEachRemaining(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().iterator().forEachRemaining(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().forEach(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + + for (int i = 0; i < 20; i++) s.put(i, i); + s.int2IntEntrySet().fastForEach(e -> e.setValue(e.getIntValue() + 20)); + for (int i = 0; i < 20; i++) assertEquals(20 + i, s.get(i)); + } + }