changeset 7662:12233e8ad61c

For map source create collection on construction so asCollection returns the same value.
author psandoz
date Fri, 15 Mar 2013 18:19:38 +0100
parents 08fb61af669d
children 53ffcf3be05d debd8078d8da
files test-ng/tests/org/openjdk/tests/java/util/stream/SpliteratorLateBindingFailTestTest.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/SpliteratorLateBindingFailTestTest.java	Fri Mar 15 18:09:52 2013 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/SpliteratorLateBindingFailTestTest.java	Fri Mar 15 18:19:38 2013 +0100
@@ -127,18 +127,18 @@
             class MapSource<U> implements Source<U> {
                 final Map<T, T> m = mapConstructor.apply(mExp);
 
-                final Function<Map<T, T>, Collection<U>> f;
+                final Collection<U> c;
 
                 final Consumer<Map<T, T>> updater;
 
                 MapSource(Function<Map<T, T>, Collection<U>> f, Consumer<Map<T, T>> updater) {
-                    this.f = f;
+                    this.c = f.apply(m);
                     this.updater = updater;
                 }
 
                 @Override
                 public Collection<U> asCollection() {
-                    return f.apply(m);
+                    return c;
                 }
 
                 @Override