playframework/Play20 — pull request #236 by kevinbosman (2012-04-13 00:24:52+00:00)
Title: fix lighthouse 302+350 - unwrap Java Result plus Context for AsyncResult

SHA: 1203737bb454432b056db459bde20f9023db4c92 from lighthouse 302, pull #230 is actually incomplete, and only works for headers that have actually been added to the response. It ignores session, cookies and flash parameters.

This patch uses the function `createResult()` from the `play.core.j.JavaHelpers` trait to rather unwrap *both* the Java `play.mvc.Result` *and* current `play.mvc.Http.Context` to a more complete Scala `play.api.mvc.Result`.

*Please note* that I'm not sure how correctly to call a function of the `JavaHelpers` object from within Java (due to the identical name clash with the trait), so I've just added "`with JavaHelpers`" to the existing `play.core.j.JavaResults` helper object. While this works, there could very well be a more acceptable/sensible way to achieve that. Advice in this regard would be welcomed.

Also note that this patch makes the previous pull #230 redundant, and so also embeds a reversal of that change.

for more info see:
https://play.lighthouseapp.com/projects/82401-play-20/tickets/350
https://play.lighthouseapp.com/projects/82401-play-20/tickets/302