Vavr 1.1.0 is out - a maintenance-heavy minor release focused on correctness and performance of the 1.x line.
This release wasn't planned. Most of these fixes were made during work on Vavr 2.0.0, but they turned out to be easy to backport, and there was no good reason to make 1.x users wait for them. So here they are.
Huge thanks to everyone who contributed!
Highlights
Faster LinkedHashMap / LinkedHashSet (#3302, #3303, #3292, #3294)
put() for an already-present key is now O(1) instead of O(n), and the internal insertion-order structure was switched from Queue to Vector.
Serialized instances from 1.0.1 can still be deserialized.
Either#transform (#3268)
Either gets the missing transform(Function<? super Either<L, R>, ? extends U>), consistent with the rest of the Vavr types.
Better Null-Safety Annotations (#3266, #3317)
Missing JSpecify annotations were added, including @NonNull on Option's type parameter.
Behavior Changes Worth Knowing
These are bug fixes, but they may change observable behavior if you did not pay attention to the contract:
Try.Failure#equalsnow also compares the exception type and message, not just stack traces (#3274)Try#andFinallyTry()no longer swallows the original failure when the finalizer also throws (#3288)Map#replace(Tuple2, Tuple2)now checks the full entry, not just the key (#3289)Queue#replacenow replaces only the first occurrence (#3271)Multimap#isDistinct()no longer returnstrueforSEQcontainers (#3286)
What's Changed
- Make Lazy.value explicitly volatile by @pivovarit in #3176
- Annotate Option's generic parameter as @nonnull by @jkstrauss in #3266
- Implement missing Either#transform by @pivovarit in #3268
- Fix Queue#flatMap ordering issue by @pivovarit in #3270
- Fix Queue#replace violating first-occurrence-only semantics by @pivovarit in #3271
- Fix Iterator#findLast returning None for null matches by @pivovarit in #3272
- Fix Failure#equals comparing only stack traces, ignoring exception type and message by @pivovarit in #3274
- Fix Map#computeIfPresent returning None for null by @pivovarit in #3276
- Fix future cancellation callbacks by @puneetdixit200 in #3280
- Fix TreeMap.collector() null-checking by @pivovarit in #3281
- Preserve custom comparator through derived operations for TreeMultimap by @pivovarit in #3282
- Fix Tree#build() validating wrong parameters in null checks by @pivovarit in #3283
- Fix LinkedHashMultimap.toJavaMap() losing insertion order by @pivovarit in #3284
- Fix Iterator#slideBy() NPE when classifier returns null by @pivovarit in #3285
- Fix Multimap#isDistinct() returning true for SEQ container type by @pivovarit in #3286
- Fix Validation#peek missing null check on action by @pivovarit in #3287
- Fix Try#andFinallyTry() swallowing original failure when runnable also throws by @pivovarit in #3288
- Fix Map#replace(Tuple2, Tuple2) checking only key instead of full entry by @pivovarit in #3289
- Cache Multimap size to avoid O(n) recomputation by @pivovarit in #3291
- Skip O(n) dedup in LinkedHashMap.wrapNonUnique() when keys are already unique by @pivovarit in #3292
- Avoid unnecessary allocation in Validation.map()/mapError() by @pivovarit in #3293
- Avoid Iterator.map() indirection in LinkedHashMap/TreeMap keysIterator()/valuesIterator() by @pivovarit in #3294
- O(1) LinkedHashMap/LinkedHashSet#put() for existing keys by @pivovarit in #3302
- Swap Queue for Vector in LinkedHashMap by @pivovarit in #3303
- Custom Queue iterator by @pivovarit in #3304
- Fix LinkedHashMap#put by @pivovarit in #3309
- Add missing JSpecify annotations by @pivovarit in #3317
- Fix List.remove throwing NullPointerException when the list contains null by @pivovarit in #3360
New Contributors
- @jkstrauss made their first contribution in #3266
- @puneetdixit200 made their first contribution in #3280
Full Changelog: v1.0.1...v1.1.0