improve AbstractActor, #21717

* Receive class that wraps PartialFunction, to avoid
  scary scala types
* move AbstractActorContext to AbstractActor.ActorContext
* converting docs, many, many UntypedActor
* removing UntypedActor docs
* add unit test for ReceiveBuilder
* MiMa filters
* consistent use of getContext(), self(), sender()
* rename cross references
* migration guide
* skip samples for now
* improve match type safetyi, add matchUnchecked
  * the `? extends P` caused code like this to compile:
    `match(String.class, (Integer i) -> {})`
  * added matchUnchecked, since it can still be useful (um, convenient)
    to be able to do:
    `matchUnchecked(List.class, (List<String> list) -> {})`
* eleminate some scala.Option
  * preRestart
  * findChild
  * ActorIdentity.getActorRef
This commit is contained in:
Patrik Nordwall 2016-12-13 10:59:29 +01:00
parent 3617fe8b41
commit 4bd6b7aab1
157 changed files with 3290 additions and 8882 deletions

View file

@ -137,7 +137,7 @@ public class JavaAPI extends JUnitSuite {
final Tuple4<Integer, String, Integer, Long> t4 = Tuple4.create(1, "2", 3, 4L);
Tuple22.create(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22);
}
@Test
public void mustBeAbleToCreateOptionFromOptional() {
Option<Object> empty = Util.option(Optional.ofNullable(null));
@ -147,7 +147,7 @@ public class JavaAPI extends JUnitSuite {
assertTrue(full.isDefined());
}
public static class ActorWithConstructorParams extends UntypedActor {
public static class ActorWithConstructorParams extends UntypedAbstractActor {
private final String a;
private final String b;
@ -189,7 +189,6 @@ public class JavaAPI extends JUnitSuite {
this.d = d;
}
@Override
public void onReceive(Object msg) {
String reply = String.valueOf(a) + "-" + String.valueOf(b) + "-" + String.valueOf(c) + "-" + String.valueOf(d);
getSender().tell(reply, getSelf());