Skip to content

[Bug] in ParallelStream should compare with numberOfThreads instead of 0 #2

@DenisKnoepfle

Description

@DenisKnoepfle

In the final comparison return collect.size() == 0; it should be return collect.size() == TestPrime.numberOfThread.intValue(); since the filter predicate lets all parts pass that succeeded the isPrime() test. So if all threads pass it, it's a prime.
Test it with a simple number, e.g. "19" and it would return false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions