-
Bug
-
Resolution: Fixed
-
P4
-
8, 9
-
b143
-
Not verified
A DESCRIPTION OF THE PROBLEM :
Available code snippet is the following:
List<String> people
= people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
But this is a compiler error: "the variable 'people' is already defined in the scope"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I think it should be written something like this:
List<String> people
= peopleList.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
ACTUAL -
List<String> people
= people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#collectingAndThen-java.util.stream.Collector-java.util.function.Function-
Available code snippet is the following:
List<String> people
= people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
But this is a compiler error: "the variable 'people' is already defined in the scope"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I think it should be written something like this:
List<String> people
= peopleList.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
ACTUAL -
List<String> people
= people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html#collectingAndThen-java.util.stream.Collector-java.util.function.Function-