diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index 7f8d9e4b..833d02be 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -5,6 +5,9 @@ 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.5.9 2020-12-07 + - Fixed some nullability annotations in StaticImports to work with Kotlin 1.4.21. + ## 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. diff --git a/pom.xml b/pom.xml index 0bdc098a..05083eeb 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ http://mvnrepository.com/artifact/org.organicdesign/Paguro --> org.organicdesign Paguro - 3.5.8 + 3.5.9 jar Paguro diff --git a/src/main/java/org/organicdesign/fp/StaticImports.java b/src/main/java/org/organicdesign/fp/StaticImports.java index 55ed96a6..f34b1aa8 100644 --- a/src/main/java/org/organicdesign/fp/StaticImports.java +++ b/src/main/java/org/organicdesign/fp/StaticImports.java @@ -134,9 +134,9 @@ inserts, then the RRB tree get() method may be about 5x slower. Otherwise, perf This data definition method is one of the few methods in this project that support varargs. */ @SafeVarargs - public static @NotNull MutRrbt<@Nullable T> mutableRrb(@Nullable T... items) { + public static @NotNull MutRrbt mutableRrb(T... items) { if ( (items == null) || (items.length < 1) ) { return RrbTree.emptyMutable(); } - return RrbTree.<@Nullable T>emptyMutable() + return RrbTree.emptyMutable() .concat(Arrays.asList(items)); } @@ -146,10 +146,10 @@ inserts, then the RRB tree get() method may be about 5x slower. Otherwise, perf values overwrite earlier ones. */ @SafeVarargs - public static @NotNull MutSet<@Nullable T> mutableSet(@Nullable T... items) { - MutSet<@Nullable T> ret = PersistentHashSet.emptyMutable(); + public static @NotNull MutSet mutableSet(T... items) { + MutSet ret = PersistentHashSet.emptyMutable(); if (items == null) { return ret; } - for (@Nullable T t : items) { + for (T t : items) { ret.put(t); } return ret; @@ -160,10 +160,10 @@ inserts, then the RRB tree get() method may be about 5x slower. Otherwise, perf few methods in this project that support varargs. */ @SafeVarargs - public static @NotNull MutList<@Nullable T> mutableVec(@Nullable T... items) { - MutList<@Nullable T> ret = PersistentVector.emptyMutable(); + public static @NotNull MutList mutableVec(T... items) { + MutList ret = PersistentVector.emptyMutable(); if (items == null) { return ret; } - for (@Nullable T t : items) { + for (T t : items) { ret.append(t); } return ret; @@ -179,7 +179,7 @@ inserts, then the RRB tree get() method may be about 5x slower. Otherwise, perf This data definition method is one of the few methods in this project that support varargs. */ @SafeVarargs - static public @NotNull ImRrbt<@Nullable T> rrb(@Nullable T... items) { + static public @NotNull ImRrbt rrb(T... items) { if ( (items == null) || (items.length < 1) ) { return RrbTree.empty(); } return mutableRrb(items).immutable(); } @@ -190,7 +190,7 @@ inserts, then the RRB tree get() method may be about 5x slower. Otherwise, perf values overwrite earlier ones. */ @SafeVarargs - public static @NotNull ImSet<@Nullable T> set(@Nullable T... items) { + public static @NotNull ImSet set(T... items) { if ( (items == null) || (items.length < 1) ) { return PersistentHashSet.empty(); } return PersistentHashSet.of(Arrays.asList(items)); } @@ -258,7 +258,7 @@ becomes part of the set (it's not for pre-sorting). few methods in this project that support varargs. */ @SafeVarargs - static public @NotNull ImList<@Nullable T> vec(@Nullable T... items) { + static public @NotNull ImList vec(T... items) { if ( (items == null) || (items.length < 1) ) { return PersistentVector.empty(); } return mutableVec(items).immutable(); } @@ -289,14 +289,18 @@ becomes part of the set (it's not for pre-sorting). /** Wrap a String (or CharSequence) to perform a Character-by-Character transformation on it. */ public static @NotNull UnmodIterable xformChars(CharSequence seq) { //noinspection Convert2Lambda - return new UnmodIterable() { + return new UnmodIterable<>() { @NotNull - @Override public UnmodIterator iterator() { - return new UnmodIterator() { + @Override + public UnmodIterator iterator() { + return new UnmodIterator<>() { private int idx = 0; - @Override public boolean hasNext() { return idx < seq.length(); } - @Override public Character next() { + @Override + public boolean hasNext() { return idx < seq.length(); } + + @Override + public Character next() { int nextIdx = idx + 1; Character c = seq.charAt(idx); idx = nextIdx;