make it compile in SBT & Eclipse with 2.9.2-SNAPSHOT

- there is one remaining bug, which makes it impossible to implement
  Function1[T, Boolean] from Java (I wonder if this will ever work,
  given that there is no equivalent type expressible in Java)
- hence create Function1 in Scala code, Java only prepares a Filter SAM
  which does not inherit from anything
- ugly (one more alloc) but the only way I see right now.
This commit is contained in:
Roland 2012-02-25 19:34:59 +01:00
parent 74a36e5ddb
commit 0cb2184904
4 changed files with 15 additions and 18 deletions

View file

@ -148,12 +148,12 @@ public class JavaFutureTests {
final CountDownLatch latch = new CountDownLatch(1);
Promise<String> cf = Futures.promise(system.dispatcher());
Future<String> f = cf;
Future<String> r = f.filter(new Filter<String>() {
Future<String> r = f.filter(Filter.create(new Filter<String>() {
public boolean filter(String r) {
latch.countDown();
return r.equals("foo");
}
});
}));
cf.success("foo");
assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));