diff --git a/akka-actor-migration/src/main/scala/akka/migration/AskableActorRef.scala b/akka-actor-migration/src/main/scala/akka/migration/AskableActorRef.scala
index caf8921812..fc4f28cd8b 100644
--- a/akka-actor-migration/src/main/scala/akka/migration/AskableActorRef.scala
+++ b/akka-actor-migration/src/main/scala/akka/migration/AskableActorRef.scala
@@ -37,7 +37,7 @@ class AskableActorRef(val actorRef: ActorRef) {
*
* [see the [[akka.dispatch.Future]] companion object for a description of `flow`]
*/
- def ask(message: Any)(implicit timeout: Timeout = null): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
+ def ask(message: Any)(implicit timeout: Timeout): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
/**
* Sends a message asynchronously and returns a [[akka.dispatch.Future]]
diff --git a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala
index 44cdd91eba..ecb9690594 100644
--- a/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala
+++ b/akka-actor-tests/src/test/scala/akka/pattern/AskSpec.scala
@@ -4,6 +4,7 @@
package akka.pattern
import akka.testkit.AkkaSpec
+import akka.util.duration._
class AskSpec extends AkkaSpec {
@@ -11,7 +12,7 @@ class AskSpec extends AkkaSpec {
"return broken promises on DeadLetters" in {
val dead = system.actorFor("/system/deadLetters")
- val f = dead ask 42
+ val f = dead.ask(42)(1 second)
f.isCompleted must be(true)
f.value.get match {
case Left(_: AskTimeoutException) ⇒
diff --git a/akka-actor/src/main/scala/akka/pattern/AskSupport.scala b/akka-actor/src/main/scala/akka/pattern/AskSupport.scala
index 57dec1debe..492bb46ed8 100644
--- a/akka-actor/src/main/scala/akka/pattern/AskSupport.scala
+++ b/akka-actor/src/main/scala/akka/pattern/AskSupport.scala
@@ -51,7 +51,7 @@ object AskSupport {
*
* [see the [[akka.dispatch.Future]] companion object for a description of `flow`]
*/
- def ask(message: Any)(implicit timeout: Timeout = null): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
+ def ask(message: Any)(implicit timeout: Timeout): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
/**
* Sends a message asynchronously and returns a [[akka.dispatch.Future]]
@@ -81,7 +81,7 @@ object AskSupport {
*
* [see the [[akka.dispatch.Future]] companion object for a description of `flow`]
*/
- def ?(message: Any)(implicit timeout: Timeout = null): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
+ def ?(message: Any)(implicit timeout: Timeout): Future[Any] = akka.pattern.ask(actorRef, message)(timeout)
}
/**
diff --git a/akka-actor/src/main/scala/akka/pattern/Patterns.scala b/akka-actor/src/main/scala/akka/pattern/Patterns.scala
index b1498ee2d0..8c52f096f1 100644
--- a/akka-actor/src/main/scala/akka/pattern/Patterns.scala
+++ b/akka-actor/src/main/scala/akka/pattern/Patterns.scala
@@ -9,39 +9,6 @@ object Patterns {
import akka.pattern.{ ask ⇒ scalaAsk }
import akka.util.{ Timeout, Duration }
- /**
- * Java API for `akka.pattern.ask`:
- * Sends a message asynchronously and returns a [[akka.dispatch.Future]]
- * holding the eventual reply message; this means that the target actor
- * needs to send the result to the `sender` reference provided. The Future
- * will be completed with an [[akka.actor.AskTimeoutException]] after the
- * given timeout has expired; this is independent from any timeout applied
- * while awaiting a result for this future (i.e. in
- * `Await.result(..., timeout)`).
- *
- * This variant will use the `akka.actor.timeout` from the configuration.
- *
- * Warning:
- * When using future callbacks, inside actors you need to carefully avoid closing over
- * the containing actor’s object, i.e. do not call methods or access mutable state
- * on the enclosing actor from within the callback. This would break the actor
- * encapsulation and may introduce synchronization bugs and race conditions because
- * the callback will be scheduled concurrently to the enclosing actor. Unfortunately
- * there is not yet a way to detect these illegal accesses at compile time.
- *
- * Recommended usage:
- *
- * {{{
- * final Future