Download Latest Version streamsupport-1.7.4.jar (981.3 kB)
Email in envelope

Get an email when there's a new version of streamsupport

Home / 1.7.1-stable
Name Modified Size InfoDownloads / Week
Parent folder
streamsupport-1.7.1.jar 2019-05-26 981.3 kB
streamsupport-1.7.1-javadoc.zip 2019-05-26 967.5 kB
streamsupport-1.7.1-src.zip 2019-05-26 555.3 kB
streamsupport-1.7.1-all-tests.zip 2019-05-26 4.9 MB
streamsupport-atomic-1.7.1.zip 2019-05-26 121.4 kB
streamsupport-cfuture-1.7.1.zip 2019-05-26 162.6 kB
streamsupport-flow-1.7.1.zip 2019-05-26 96.5 kB
LICENSE 2019-05-26 19.3 kB
Readme.txt 2019-05-26 6.6 kB
Totals: 9 Items   7.8 MB 0
NEW
---

 - Completed Java 12 port, integrated improvements from Java 13

 - JDK-8215995: Add toArray() methods to immutable collections

 - JDK-8221921: Implement size() / isEmpty() in immutable collections

 - JDK-8214761: Bug in parallel Kahan summation

 - JDK-8221924: Unmodifiable Map with one entry returns null

 - JDK-8221981: Simplify Map/List/Set.of() implementation

 - JDK-8221980: Simplify Optional implementation

 - JDK-8215359: setContextClassLoader() needlessly throws

 - JDK-8211283: Misc. changes imported from jsr166 CVS 2018-11

 - JDK-8219138: Misc. changes imported from jsr166 CVS 2019-05

 - JDK-8223112: Clarify semantics of java.util.Objects.equals

 - JDK-8223379: Clarify ForkJoinPool.getStealCount() Javadoc

 - JDK-8213238: Erroneous Javadoc in MatchOps.MatchKind

 - Test on Java 13 (early access) [#396]

 - please refer to the 1.7.1 milestone tickets for more details



GENERAL
-------

 - The provided Jar files are compiled for Java 6 (Bytecode version 50).
   You'll need Retrolambda (https://github.com/orfjackal/retrolambda)
   to build the core streamsupport.jar from its sources

 - To create a Stream from a java.util Collection use the static
   j8.u.s.StreamSupport methods StreamSupport#stream(Collection),
   or, for parallel Streams, StreamSupport#parallelStream(Collection)

 - The static methods from interface j.u.s.Stream are located in
   j8.u.s.RefStreams which also contains the new Java 9 j.u.s.Stream
   default methods.

 - As of release 1.4, the former single streamsupport.jar has been
   partitioned into a core streamsupport.jar and 3 additional optional
   components:

   * streamsupport-cfuture (CompletableFuture API)
   * streamsupport-atomic  (j8.u.c.atomic package)
   * streamsupport-flow    (Java 9 Flow API)

   All of them have a dependency on the core streamsupport.jar

 - As of release 1.5, a new optional component "streamsupport-literal"
   that contains the implementation for JEP 269 (Java 9) has been added.
   See JEP 269: Convenience Factory Methods for Collections
   http://openjdk.java.net/jeps/269

   * streamsupport-literal (Java 9 Collections factory methods)

   From release 1.5.3 onwards streamsupport-literal can be used without
   any dependencies.

 - As of release 1.5.3 streamsupport detects when it is running on a
   stream enabled Android 7+ device and automatically delegates to the
   Android Spliterators (contributed by Tobias Thierer, ticket#240).

   This feature can be disabled by setting the system property
   "java8.util.Spliterators.jre.delegation.enabled" to false.

 - Release 1.6.0 introduces some new methods from the Java 10 API

 - As of release 1.6.0 "streamsupport-literal" has been merged into the
   core streamsupport.jar component in order to make the new Collectors
   for unmodifiable Lists, Sets, and Maps (JDK-8184690) possible.

   streamsupport-literal-1.6.0 is still available as a standalone component
   without any dependencies but has been discontinued in release 1.6.1

 - As of release 1.6.1, j8.u.c.Phaser has moved to the streamsupport-atomic
   component and j8.u.c.CompletionException has moved to streamsupport-cfuture
   (the only place where it is used).
   streamsupport-literal is no longer maintained but the 1.6.0 version can
   still be used since it doesn't have any dependencies on other artifacts.

 - Release 1.7.0 completes the Java 11 port and adds a couple of new methods
   from Java 12, especially a new merging Collector (JDK-8205461) and new
   exception handling methods for CompletableFuture (JDK-8210971).

 - Release 1.7.1 completes the Java 12 port and adds some improvements and
   bug fixes from Java 13.



KNOWN PROBLEMS
--------------

 - Incorrect LinkedHashMap Spliterator ordering in Android N.

   The implementation of LinkedHashMap's collection views' spliterators in
   Android Nougat (API levels 24 and 25) uses the wrong order (inconsistent
   with the iterators, which use the correct order), despite reporting
   Spliterator#ORDERED (however, the unordered HashMap spliterators are used).

   Since streamsupport 1.5.3 and later will by default delegate to the Android 7.x
   spliterators you'd be affected by this unordered behavior on Android 7.x unless
   you disable spliterator delegation altogether or you work around this behavior
   on API level 24 and 25 as follows.

   You may use the following code to obtain a correctly ordered Spliterator:

   For a Collection view
   col = lhm.keySet(), col = lhm.entrySet() or col = lhm.values(), use

   Spliterator sp = java8.util.Spliterators.spliterator(col, c) where

   int c = Spliterator.DISTINCT | Spliterator.ORDERED | Spliterator.SIZED

   for keySet() and entrySet() and

   int c = Spliterator.ORDERED | Spliterator.SIZED for values()

   to obtain a correctly ordered spliterator. Then, instead of
   StreamSupport.stream(col) or StreamSupport.parallelStream(col), use

   java8.util.stream.StreamSupport.stream(sp, false)

   to construct a (nonparallel) java8.util.stream.Stream from the Spliterator sp.

   Note that these workarounds are only suggested where lhm is a LinkedHashMap.
   Note further that everything works perfectly fine on API level 23 and below (if
   you don't plan to deploy on Android 7.x devices, you can ignore this whole advice
   altogether).

   To mitigate the risk if you don't follow this advice, streamsupport 1.5.3 (and
   later) exercises a check whether the spliterator for a HashMap collection view
   reports ORDERED (a bug) and excepts these cases from the delegation mechanism
   (using the reflective implementation instead. So, in effect the same mechanism
   that is used on API level 23 and below gets employed in this case).

   But note that this check isn't 100% fool-proof as the LinkedHashMap (or its
   collection view) could be wrapped, for example in a j.u.Collections$UnmodifiableMap
   (whose UnmodifiableEntrySetSpliterator delegates back to the defective
   HashMap$EntrySpliterator).

   Since we can't know an arbitrary wrapper beforehand there is nothing streamsupport
   can do about this in such cases - you have been warned.

   The latest version of LinkedHashMap in AOSP implements its Spliterators via
   Spliterators.spliterator(), which means that this bug has already been fixed
   in Android O.



OUTLOOK
-------

 - Unless someone finds a bug that needs fixing this is probably the last
   streamsupport release in the foreseeable future.
Source: Readme.txt, updated 2019-05-26