mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8193856
: takeWhile produces incorrect result with elements produced by flatMap
Reviewed-by: smarks
This commit is contained in:
parent
388f422efd
commit
e6680338c5
2 changed files with 36 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -95,7 +95,7 @@ final class WhileOps {
|
|||
|
||||
@Override
|
||||
public void accept(T t) {
|
||||
if (take = predicate.test(t)) {
|
||||
if (take && (take = predicate.test(t))) {
|
||||
downstream.accept(t);
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ final class WhileOps {
|
|||
|
||||
@Override
|
||||
public void accept(int t) {
|
||||
if (take = predicate.test(t)) {
|
||||
if (take && (take = predicate.test(t))) {
|
||||
downstream.accept(t);
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ final class WhileOps {
|
|||
|
||||
@Override
|
||||
public void accept(long t) {
|
||||
if (take = predicate.test(t)) {
|
||||
if (take && (take = predicate.test(t))) {
|
||||
downstream.accept(t);
|
||||
}
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ final class WhileOps {
|
|||
|
||||
@Override
|
||||
public void accept(double t) {
|
||||
if (take = predicate.test(t)) {
|
||||
if (take && (take = predicate.test(t))) {
|
||||
downstream.accept(t);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue