diff --git a/src/main/java/org/jooq/lambda/SeqUtils.java b/src/main/java/org/jooq/lambda/SeqUtils.java
index ce6a0555..94ff0a82 100644
--- a/src/main/java/org/jooq/lambda/SeqUtils.java
+++ b/src/main/java/org/jooq/lambda/SeqUtils.java
@@ -68,9 +68,22 @@ public long estimateSize() {
return Long.MAX_VALUE;
}
+ /**
+ * This Spliterator
always returns a subset of elements from the source stream
so:
+ * - it cannot be SIZED
nor SUBSIZED
(some element may have been removed)
+ * - it is still DISTINCT
, NONNULL
, and IMMUTABLE
(nothing added)
+ * - it is still SORTED
(nothing reordered)
+ *
+ * Moreover:
+ * - we impose ORDERED
because Seq
is always ordered
+ * - we remove CONCURRENT
because Seq
is always sequential
+ *
+ * @see [#311]
+ */
@Override
public int characteristics() {
- return delegate.characteristics() & Spliterator.ORDERED;
+ return (delegate.characteristics() | Spliterator.ORDERED)
+ & ~(Spliterator.SIZED | Spliterator.SUBSIZED | Spliterator.CONCURRENT);
}
@Override