=str #16272 splitWhen should drop reference when done with substream

The completeSubstreamOutput is used to not early complete the stream,
where as invalidating would shutdown the stream too early (and elements
wouldn't be emitted as expected).
This commit is contained in:
Konrad 'ktoso' Malawski 2014-11-12 10:16:22 +01:00
parent bb07c20547
commit 0f4abb687f
3 changed files with 15 additions and 8 deletions

View file

@ -257,10 +257,10 @@ public class FlowTest {
@Test
public void mustBeAbleToUseSplitWhen() {
final JavaTestKit probe = new JavaTestKit(system);
final Iterable<String> input = Arrays.asList("A", "B", "C", "\n", "D", "\n", "E", "F");
final Iterable<String> input = Arrays.asList("A", "B", "C", ".", "D", ".", "E", "F");
Source.from(input).splitWhen(new Predicate<String>() {
public boolean test(String elem) {
return elem.equals("\n");
return elem.equals(".");
}
}).foreach(new Procedure<Source<String>>() {
@Override
@ -268,7 +268,7 @@ public class FlowTest {
subStream.filter(new Predicate<String>() {
@Override
public boolean test(String elem) {
return !elem.equals("\n");
return !elem.equals(".");
}
}).grouped(10).foreach(new Procedure<List<String>>() {
@Override