diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index 814baf5..88e8448 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -5,6 +5,12 @@ releases on the way from an old version to a new one. Fix any deprecation warni release before upgrading to the next one. The documentation next to each Deprecated annotation tells you what to use instead. Once we delete the deprecated methods, that documentation goes too. +## 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 whereNonNull()` + - Now: `@NotNull Transformable<@NotNull T> whereNonNull()` + ## Release 3.10.0 2022-01-21: "OneOf5" - Added OneOf5. A second-class Union Type like OneOf4, but with one more. - Removed OneOf2OrNone; use Option instead. diff --git a/pom.xml b/pom.xml index fb21b64..15ee7ed 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ http://mvnrepository.com/artifact/org.organicdesign/Paguro --> org.organicdesign Paguro - 3.10.0 + 3.10.1 jar Paguro diff --git a/src/main/java/org/organicdesign/fp/collections/UnmodIterable.java b/src/main/java/org/organicdesign/fp/collections/UnmodIterable.java index 8a0d078..06ec559 100644 --- a/src/main/java/org/organicdesign/fp/collections/UnmodIterable.java +++ b/src/main/java/org/organicdesign/fp/collections/UnmodIterable.java @@ -194,7 +194,7 @@ default B fold(B ident, @NotNull Fn2 reducer) { } /** {@inheritDoc} */ - @Override default @NotNull UnmodIterable whereNonNull() { + @Override default @NotNull UnmodIterable<@NotNull T> whereNonNull() { return Xform.of(this).filter(Objects::nonNull); } diff --git a/src/main/java/org/organicdesign/fp/xform/Transformable.java b/src/main/java/org/organicdesign/fp/xform/Transformable.java index 570b29c..d59b4f7 100644 --- a/src/main/java/org/organicdesign/fp/xform/Transformable.java +++ b/src/main/java/org/organicdesign/fp/xform/Transformable.java @@ -94,10 +94,10 @@ Add items to the end of this Transformable (precat() adds to the beginning) @NotNull Transformable filter(@NotNull Fn1 predicate); /** - Return only the items which are non-null - @return a Transformable of only the non-null items. + * Return only the items which are non-null + * @return a Transformable of only the non-null items. */ - @NotNull Transformable whereNonNull(); + @NotNull Transformable<@NotNull T> whereNonNull(); /** Returns the first item produced by this transform. If the source is unordered, there is no guarantee about which