Renaming tryRecover to recoverWith as in SIP14, adding parameter to foreach

This commit is contained in:
Viktor Klang 2012-02-03 09:25:56 +01:00
parent d8fa7578e1
commit 8193e61aee
7 changed files with 14 additions and 14 deletions

View file

@ -306,10 +306,10 @@ public class JavaFutureTests {
}
@Test
public void tryRecoverToMustBeCallable() {
public void recoverWithToMustBeCallable() {
final IllegalStateException fail = new IllegalStateException("OHNOES");
Promise<Object> p = Futures.promise(system.dispatcher());
Future<Object> f = p.future().tryRecover(new Recover<Future<Object>>() {
Future<Object> f = p.future().recoverWith(new Recover<Future<Object>>() {
public Future<Object> recover(Throwable t) throws Throwable {
if (t == fail) return Futures.<Object>successful("foo", system.dispatcher()).future();
else throw t;