Releases: GlenKPeterson/Paguro
Releases · GlenKPeterson/Paguro
3.10.3: concat() and precat() (redux)
Release 3.10.3 2022-05-08: concat() and precat()
- Implemented concat() and precat() methods on RrbTree and precat() on ImRrbTree and MutRrbTree
because:- concat() was implemented on PersistentVector() because it's a cheap operation.
- concat() and precat() are cheap and sensible on the RRB Tree.
- Added a few @NotNull and @contract annotations where they were missing.
Do NOT use release 3.10.2. That was a mistake!
3.10.2: concat() and precat()
Release 3.10.2 2022-05-08: concat() and precat()
- Implemented concat() and precat() methods on ImMap, MutMap, ImSet, MutSet, ImRrbTree and MutRrbTree
because:- concat() was implemented on PersistentVector() because it's a cheap operation.
- concat() and precat() are cheap and sensible on the other collection types (RRB Tree and non-sorted maps and sets)
- Now they all return their original collection type instead of an Xform.
- Mirko Raner (@raner) brought this to my attention in #49 - Thank you @raner!
- Added a few @NotNull and @contract annotations where they were missing.
3.10.1 2022-03-18: NotNull whereNotNull()
Release 3.10.1 2022-03-18: NotNull whereNotNull()
- Added
@NotNull
annotation to the generic type parameter returned by Transformable.whereNonNull()
(and implementation of that method in UnmodIterable).- Was:
@NotNull Transformable<T> whereNonNull()
- Now:
@NotNull Transformable<@NotNull T> whereNonNull()
- Was:
OneOf5
Release 3.10.0 2022-01-21: "OneOf5"
- Added
OneOf5
. A second-class Union Type likeOneOf4
, but with one more. - Removed
OneOf2OrNone
; useOption<OneOf2>
instead.
The OneOf2OrNoneTest shows how. - Changed the contained object in all OneOf_ classes from
@Nullable
to@NotNull
and fromprivate
toprotected
.
If you use@NotNull
annotations in your subclass, you can now overload the static factory methods in your subclasses (you can use the same name for all of them).
Instead of storing null in aOneOf_
, simply return anull
OneOf_ orOption<OneOf_>.none()
.
Theprotected
modifier now lets subclasses access the contained item for easily implementing an interface that the possible values share.
The OneOf2Test shows how. - Test coverage reached 95% by line.
3.9.0 2021-12-30: Removed None.none()
The following are results of usage and casual code review.
Release 3.9.0 2021-12-30: Removed None.none()
- Use Option.none() instead of None.none().
They are duplicate methods.
You're almost certainly going to be importing Option.some() already, so it makes sense to use Option.none() as well. - Fixed appendSome() to take a covariant parameter:
appendSome(@NotNull Fn0<? extends @NotNull Option<E>> supplier)
- Made RuntimeTypes store types in a Trie with node-level synchronization. The previous storage made no sense.
- Added more nullability annotations.
Release 3.8.0 2021-12-28: BaseList.appendSome(() -> Option)
- Replaced BaseList.appendWhen(Fn0 test, E item) with appendSome(Fn0<Option>).
This is a better design because it can do everything the first design does, but
allows you to avoid constructing a new E unless you need it. - Added more nullability annotations.
- Tuples now have a
private static final long serialVersionUID
field.
This was always intended to be there
(so you can serialize with one version of Paguro and deserialize with another)
but was generated as part of comment by accident.
This field will not change so long as tuples do not change in a way that affects their serialization.
3.7.2 2021-12-20: Fixed RrbTree
Release 3.7.2 2021-12-20: Fix RrbTree.split()
- Fixed Bug #47: "RrbTree.split() returns wrong type" and added test to prevent regressions.
Thank you, @fcurts, for reporting this!
Release 3.7.1 2021-12-20
- Added BaseList.appendWhen() for fluent list building with optional additions.
Release 3.7.0 2021-12-19
- RRB Tree .join() method appears to work after removing strict-node optimization.
Many thanks to hours of conversations with Andy Fingerhut @jafingerhut and for his
great unit tests and fixes. Without his help, this would not have happened.
Choose wisely based on your write operations: If you're only doing appends, use PersistentVector as it's more efficient.
Inserts or joins, use RRB-Tree. - PersistentVector.MutVector.replace() now works thanks to a bug report and unit test
from Axel Kramer @axkr. The persistent version was unaffected by this issue. - Added more @NotNull annotations, though there are still many more to add.
Release 3.6.0 2021-09-21
- Added back .add() and .addAll() methods to MutList.
This is sort of an experiment to see if this is more helpful than dangerous.
It's probably helpful, but I can't do this with all the appropriate methods/interfaces right now. - Made project Eclipse 1.0 by default, some files available Apache 2.0 if you want.
This is not a big change from what it was before and probably only affects forks,
or people just using a few files or code snippets.
Nullability bug fix
Fixed some nullability annotations in StaticImports to work with Kotlin 1.4.21.
Still waiting on this to appear on maven central... they are slow right now.
Kotlin-Friendly
Release 3.5.8 2020-10-06
- Renamed all mutable collections from Mutable___ to Mut___ so they no longer conflict with Kotlin's StdLib. See script below to help you upgrade.
- Deprecated RRB-Tree join() and remove() methods until the bugs in them can be fixed.
- Added org.jetbrains.annotations dependency and marked many methods with Nullable and NotNull.
This increased the size of the jar file by less than 3%. - Use filterNonNull() Instead of .filter(Objects::nonNull) because sometimes IntelliJ gets confused about whether objects can be null in this case or not.
- Fixed some nullability issues with the few varargs methods in this project.
- Added Transform.any(Fn1) which returns true if anything matches the given predicate.
Here is a script to ease your upgrade from 3.0 or 3.2 to 3.5
# USE CAUTION AND HAVE A BACKUP OF YOUR SOURCE CODE (VERSION CONTROL) - NO GUARANTEES
oldString='MutableList'
newString=MutList
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableMap'
newString=MutMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableSet'
newString=MutSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='toMutableSortedSet'
newString=toMutSortedSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='toMutableSortedMap'
newString=toMutSortedMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableHashSet'
newString=MutHashSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
oldString='MutableHashMap'
newString=MutHashMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)
After the above, you probably want to check out any Kotlin files. Sorry. If you use MutableMap/MutableList/etc. inside a Kotlin file, you have to fix it manually. Sorry.
IllegalStateException
- Merged kmark's changes to ues IllegalStateException (extends RuntimeException) instead of IllegalAccessError (extends Error) in PersistentHashMap.
IllegalAccessError was a holdover from the original Clojure source code and may have made sense in an earlier Java version, but IllegalStateException is a better choice today.
Thank you, Kevin! - Updated test and plugin dependencies
- Compiled with Java 11 (hence updating middle version number).
- Fixed warnings
3.1.2: Heterogeneous RrbTree Fix
- Fixed a bug (reported by fcurts - with unit test!) where Heterogeneous RrbTrees of more than 32 items
would throw an exception at Runtime. - Documented Cowry (Copy-On Write aRraY) better.
- Updated version number past 3.1.1 which conflicted with the Kotlin-Friendly branch. Kotlin-Friendly Paguro is now called Paguro-KF and starts with version 3.5.x.