changeset 7829:215d9ddc8762

Reflect ORDERED-ness of a Collector in the TerminalOp flags for collect(Collector)
author briangoetz
date Fri, 05 Apr 2013 16:09:34 -0400
parents 360ebf593040
children 92cd244a11db
files src/share/classes/java/util/stream/ReduceOps.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/ReduceOps.java	Fri Apr 05 15:14:09 2013 -0400
+++ b/src/share/classes/java/util/stream/ReduceOps.java	Fri Apr 05 16:09:34 2013 -0400
@@ -179,6 +179,13 @@
             public ReducingSink makeSink() {
                 return new ReducingSink();
             }
+
+            @Override
+            public int getOpFlags() {
+                return collector.characteristics().contains(Collector.Characteristics.UNORDERED)
+                       ? StreamOpFlag.NOT_ORDERED
+                       : 0;
+            }
         };
     }