Switching over to immutable.Iterable where possible

This commit is contained in:
Viktor Klang 2012-11-07 16:35:14 +01:00
parent 8f131c680f
commit b00c47854b
44 changed files with 385 additions and 369 deletions

View file

@ -27,6 +27,7 @@ import akka.testkit.ErrorFilter;
import akka.testkit.EventFilter;
import akka.testkit.TestEvent;
import static java.util.concurrent.TimeUnit.SECONDS;
import static akka.japi.Util.immutableSeq;
import akka.japi.Function;
import scala.Option;
import scala.collection.JavaConverters;
@ -219,8 +220,7 @@ public class FaultHandlingTestBase {
//#testkit
public <A> Seq<A> seq(A... args) {
return JavaConverters.collectionAsScalaIterableConverter(
java.util.Arrays.asList(args)).asScala().toList();
return immutableSeq(args);
}
//#testkit
}

View file

@ -180,16 +180,14 @@ public class CustomRouterDocTestBase {
//#crRoutingLogic
return new CustomRoute() {
@Override
public Iterable<Destination> destinationsFor(ActorRef sender, Object msg) {
public scala.collection.immutable.Seq<Destination> destinationsFor(ActorRef sender, Object msg) {
switch ((Message) msg) {
case DemocratVote:
case DemocratCountResult:
return Arrays.asList(
new Destination[] { new Destination(sender, democratActor) });
return akka.japi.Util.immutableSingletonSeq(new Destination(sender, democratActor));
case RepublicanVote:
case RepublicanCountResult:
return Arrays.asList(
new Destination[] { new Destination(sender, republicanActor) });
return akka.japi.Util.immutableSingletonSeq(new Destination(sender, republicanActor));
default:
throw new IllegalArgumentException("Unknown message: " + msg);
}