You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix broken implementation of ParTaskImpl::tasksFromIterable (linkedin#347)
The `tasksFromIterable` method in `ParTaskImpl` needs to read the contents of
an iterator and then create an array of the read tasks. This is an unfortunate
performance/memory tradeoff of using these two things: iterators don't have a
length and arrays need one. The implementation reads the iterator's contents
into a collection and then turns that collection into an array. The problem is,
it then tries to cast that array of `Object` into a more narrow type, which is
not allowed. This _always_ results in a ClassCastException if the value is non
null. The exists tests did not cover this case.
The code has been fixed to take a less performant path and delegate the array
creation to `tasksFromCollection`. A test has been written for the `Iterable`
code path and verified through coverage analysis.
0 commit comments