playframework/playframework — pull request #2486 by ornicar (2014-03-13 17:03:41+00:00)
Title: Fix exception in Reads.traversableReads when JsArray contains a stream 

See the new test case. When the Seq contained in JsArray is a lazy
stream, the former implementation of `traversableReads` was throwing an
exception. Because the `ts.zipWithIndex.map` on line 457 is executed
lazily, it does not set the mutable flag `hasErrors` to true. So line
474 `r.foreach(builder += _.right.get)` can be reached even if `r`
contains `Left` values.

This commit removes both mutable flag `hasErrors` and unsafe function
`Either.get`, fixing the bug.

For the sake of consistency, `mapReads` was rewritten too, as it presented the same weaknesses.