diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index 7c21f960fd..ce8e5ddb7c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -157,7 +157,7 @@ object ActorModelSpec { try { await(deadline)(stops == dispatcher.stops.get) } catch { - case e ⇒ + case e: Throwable ⇒ system.eventStream.publish(Error(e, dispatcher.toString, dispatcher.getClass, "actual: stops=" + dispatcher.stops.get + " required: stops=" + stops)) throw e @@ -214,7 +214,7 @@ object ActorModelSpec { await(deadline)(stats.msgsProcessed.get() == msgsProcessed) await(deadline)(stats.restarts.get() == restarts) } catch { - case e ⇒ + case e: Throwable ⇒ system.eventStream.publish(Error(e, Option(dispatcher).toString, (Option(dispatcher) getOrElse this).getClass, diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index eb0f241177..3b2ac5c86d 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -646,7 +646,7 @@ private[akka] class ActorSystemImpl(val name: String, applicationConfig: Config, instance //Profit! } } catch { - case t ⇒ + case t: Throwable ⇒ extensions.remove(ext, inProcessOfRegistration) //In case shit hits the fan, remove the inProcess signal throw t //Escalate to caller } finally { diff --git a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala index 4cf7ae2e65..4aa0f4d36b 100644 --- a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala @@ -300,7 +300,7 @@ abstract class MessageDispatcher(val prerequisites: DispatcherPrerequisites) ext try { executeTask(invocation) } catch { - case t ⇒ + case t: Throwable ⇒ addInhabitants(-1) throw t } @@ -575,7 +575,7 @@ object ForkJoinExecutorConfigurator { final override def setRawResult(u: Unit): Unit = () final override def getRawResult(): Unit = () final override def exec(): Boolean = try { mailbox.run; true } catch { - case anything ⇒ + case anything: Throwable ⇒ val t = Thread.currentThread t.getUncaughtExceptionHandler match { case null ⇒ diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index ca6e5bf3cb..84f2adfc87 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -688,7 +688,7 @@ sealed trait Future[+T] extends Await.Awaitable[T] { case NonFatal(e) ⇒ executor.reportFailure(new LogEventException(Debug("Future", getClass, e.getMessage), e)) p complete Left(e) - case t ⇒ + case t: Throwable ⇒ p complete Left(new ExecutionException(t)); throw t } } diff --git a/akka-actor/src/main/scala/akka/util/LockUtil.scala b/akka-actor/src/main/scala/akka/util/LockUtil.scala index c465002b70..91c837063a 100644 --- a/akka-actor/src/main/scala/akka/util/LockUtil.scala +++ b/akka-actor/src/main/scala/akka/util/LockUtil.scala @@ -25,9 +25,9 @@ class Switch(startAsOn: Boolean = false) { protected def transcend(from: Boolean, action: ⇒ Unit): Boolean = synchronized { if (switch.compareAndSet(from, !from)) { try action catch { - case e ⇒ + case t: Throwable ⇒ switch.compareAndSet(!from, from) // revert status - throw e + throw t } true } else false diff --git a/akka-agent/src/test/scala/akka/agent/AgentSpec.scala b/akka-agent/src/test/scala/akka/agent/AgentSpec.scala index 0e20d6c866..2b67104e13 100644 --- a/akka-agent/src/test/scala/akka/agent/AgentSpec.scala +++ b/akka-agent/src/test/scala/akka/agent/AgentSpec.scala @@ -1,5 +1,7 @@ package akka.agent +import language.postfixOps + import akka.dispatch.Await import akka.util.Duration import akka.util.duration._ diff --git a/akka-docs/java/code/docs/actor/japi/FaultHandlingDocSample.java b/akka-docs/java/code/docs/actor/japi/FaultHandlingDocSample.java index 1213ab5949..53e8dbc1e1 100644 --- a/akka-docs/java/code/docs/actor/japi/FaultHandlingDocSample.java +++ b/akka-docs/java/code/docs/actor/japi/FaultHandlingDocSample.java @@ -20,7 +20,7 @@ import akka.event.LoggingAdapter; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; -import static akka.japi.Util.manifest; +import static akka.japi.Util.classTag; import static akka.actor.SupervisorStrategy.*; import static akka.pattern.Patterns.ask; @@ -146,7 +146,7 @@ public class FaultHandlingDocSample { // Send current progress to the initial sender pipe(ask(counterService, GetCurrentCount, askTimeout) - .mapTo(manifest(CurrentCount.class)) + .mapTo(classTag(CurrentCount.class)) .map(new Mapper() { public Progress apply(CurrentCount c) { return new Progress(100.0 * c.count / totalCount); diff --git a/akka-docs/java/zeromq.rst b/akka-docs/java/zeromq.rst index 08d1a9541f..05123f2bc5 100644 --- a/akka-docs/java/zeromq.rst +++ b/akka-docs/java/zeromq.rst @@ -21,7 +21,7 @@ Sockets are always created using the ``akka.zeromq.ZeroMQExtension``, for exampl .. includecode:: code/docs/zeromq/ZeromqDocTestBase.java#pub-socket -Above examples will create a ZeroMQ Publisher socket that is Bound to the port 1233 on localhost. +Above examples will create a ZeroMQ Publisher socket that is Bound to the port 21231 on localhost. Similarly you can create a subscription socket, with a listener, that subscribes to all messages from the publisher using: diff --git a/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala b/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala index fc62cd940d..9b2e60b557 100644 --- a/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala +++ b/akka-docs/modules/code/docs/actor/mailbox/DurableMailboxDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor.mailbox +import language.postfixOps + //#imports import akka.actor.Props @@ -56,7 +58,7 @@ import akka.util.duration._ class MyMailboxType(systemSettings: ActorSystem.Settings, config: Config) extends MailboxType { - override def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = owner zip system headOption match { + override def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = (owner zip system) headOption match { case Some((o, s: ExtendedActorSystem)) ⇒ new MyMessageQueue(o, s) case None ⇒ throw new IllegalArgumentException( "requires an owner (i.e. does not work with BalancingDispatcher)") diff --git a/akka-docs/scala/code/docs/actor/ActorDocSpec.scala b/akka-docs/scala/code/docs/actor/ActorDocSpec.scala index ee05e95d42..29bdfd09d5 100644 --- a/akka-docs/scala/code/docs/actor/ActorDocSpec.scala +++ b/akka-docs/scala/code/docs/actor/ActorDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#imports1 import akka.actor.Actor import akka.actor.Props diff --git a/akka-docs/scala/code/docs/actor/FSMDocSpec.scala b/akka-docs/scala/code/docs/actor/FSMDocSpec.scala index 75b0309a42..84b6f5c85f 100644 --- a/akka-docs/scala/code/docs/actor/FSMDocSpec.scala +++ b/akka-docs/scala/code/docs/actor/FSMDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#test-code import akka.testkit.AkkaSpec import akka.actor.Props diff --git a/akka-docs/scala/code/docs/actor/FaultHandlingDocSample.scala b/akka-docs/scala/code/docs/actor/FaultHandlingDocSample.scala index 79f5a5d084..0d3978f95c 100644 --- a/akka-docs/scala/code/docs/actor/FaultHandlingDocSample.scala +++ b/akka-docs/scala/code/docs/actor/FaultHandlingDocSample.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#all //#imports import akka.actor._ diff --git a/akka-docs/scala/code/docs/actor/FaultHandlingDocSpec.scala b/akka-docs/scala/code/docs/actor/FaultHandlingDocSpec.scala index 65e03bd2ea..42ce68088a 100644 --- a/akka-docs/scala/code/docs/actor/FaultHandlingDocSpec.scala +++ b/akka-docs/scala/code/docs/actor/FaultHandlingDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#testkit import akka.testkit.{ AkkaSpec, ImplicitSender, EventFilter } import akka.actor.{ ActorRef, Props, Terminated } diff --git a/akka-docs/scala/code/docs/actor/SchedulerDocSpec.scala b/akka-docs/scala/code/docs/actor/SchedulerDocSpec.scala index f711d85129..03750cff3b 100644 --- a/akka-docs/scala/code/docs/actor/SchedulerDocSpec.scala +++ b/akka-docs/scala/code/docs/actor/SchedulerDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#imports1 import akka.actor.Actor import akka.actor.Props diff --git a/akka-docs/scala/code/docs/actor/TypedActorDocSpec.scala b/akka-docs/scala/code/docs/actor/TypedActorDocSpec.scala index 0c2f3bd5b8..a658dc6288 100644 --- a/akka-docs/scala/code/docs/actor/TypedActorDocSpec.scala +++ b/akka-docs/scala/code/docs/actor/TypedActorDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.actor +import language.postfixOps + //#imports import akka.dispatch.{ Promise, Future, Await } import akka.util.duration._ diff --git a/akka-docs/scala/code/docs/agent/AgentDocSpec.scala b/akka-docs/scala/code/docs/agent/AgentDocSpec.scala index 418159f638..9101bc8c5c 100644 --- a/akka-docs/scala/code/docs/agent/AgentDocSpec.scala +++ b/akka-docs/scala/code/docs/agent/AgentDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.agent +import language.postfixOps + import akka.agent.Agent import akka.util.duration._ import akka.util.Timeout diff --git a/akka-docs/scala/code/docs/camel/Consumers.scala b/akka-docs/scala/code/docs/camel/Consumers.scala index df7161b9e6..ccc6b6f62a 100644 --- a/akka-docs/scala/code/docs/camel/Consumers.scala +++ b/akka-docs/scala/code/docs/camel/Consumers.scala @@ -1,7 +1,7 @@ package docs.camel object Consumers { - { + def foo = { //#Consumer1 import akka.camel.{ CamelMessage, Consumer } @@ -14,7 +14,7 @@ object Consumers { } //#Consumer1 } - { + def bar = { //#Consumer2 import akka.camel.{ CamelMessage, Consumer } diff --git a/akka-docs/scala/code/docs/camel/Introduction.scala b/akka-docs/scala/code/docs/camel/Introduction.scala index eaf4c400f6..57229f9b37 100644 --- a/akka-docs/scala/code/docs/camel/Introduction.scala +++ b/akka-docs/scala/code/docs/camel/Introduction.scala @@ -1,7 +1,7 @@ package docs.camel object Introduction { - { + def foo = { //#Consumer-mina import akka.camel.{ CamelMessage, Consumer } @@ -21,7 +21,7 @@ object Introduction { val mina = sys.actorOf(Props[MinaClient]) //#Consumer-mina } - { + def bar = { //#Consumer import akka.camel.{ CamelMessage, Consumer } @@ -35,7 +35,7 @@ object Introduction { } //#Consumer } - { + def baz = { //#Producer import akka.actor.Actor import akka.camel.{ Producer, Oneway } diff --git a/akka-docs/scala/code/docs/dispatcher/DispatcherDocSpec.scala b/akka-docs/scala/code/docs/dispatcher/DispatcherDocSpec.scala index 7fdd0cd9bf..d5de012ac1 100644 --- a/akka-docs/scala/code/docs/dispatcher/DispatcherDocSpec.scala +++ b/akka-docs/scala/code/docs/dispatcher/DispatcherDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.dispatcher +import language.postfixOps + import org.scalatest.{ BeforeAndAfterAll, WordSpec } import org.scalatest.matchers.MustMatchers import akka.testkit.AkkaSpec diff --git a/akka-docs/scala/code/docs/future/FutureDocSpec.scala b/akka-docs/scala/code/docs/future/FutureDocSpec.scala index 66e80578fd..fb06341f32 100644 --- a/akka-docs/scala/code/docs/future/FutureDocSpec.scala +++ b/akka-docs/scala/code/docs/future/FutureDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.future +import language.postfixOps + import org.scalatest.{ BeforeAndAfterAll, WordSpec } import org.scalatest.matchers.MustMatchers import akka.testkit._ diff --git a/akka-docs/scala/code/docs/io/HTTPServer.scala b/akka-docs/scala/code/docs/io/HTTPServer.scala index b6b80aa27f..5c63eac3c2 100644 --- a/akka-docs/scala/code/docs/io/HTTPServer.scala +++ b/akka-docs/scala/code/docs/io/HTTPServer.scala @@ -3,6 +3,8 @@ */ package docs.io +import language.postfixOps + //#imports import akka.actor._ import akka.util.{ ByteString, ByteStringBuilder } diff --git a/akka-docs/scala/code/docs/routing/RouterTypeExample.scala b/akka-docs/scala/code/docs/routing/RouterTypeExample.scala index 421c7af3bb..74c9bbc790 100644 --- a/akka-docs/scala/code/docs/routing/RouterTypeExample.scala +++ b/akka-docs/scala/code/docs/routing/RouterTypeExample.scala @@ -3,6 +3,8 @@ */ package docs.routing +import language.postfixOps + import akka.routing.{ ScatterGatherFirstCompletedRouter, BroadcastRouter, RandomRouter, RoundRobinRouter } import annotation.tailrec import akka.actor.{ Props, Actor } diff --git a/akka-docs/scala/code/docs/testkit/Specs2DemoAcceptance.scala b/akka-docs/scala/code/docs/testkit/Specs2DemoAcceptance.scala index ab8bac9bf3..54fe9ab5ce 100644 --- a/akka-docs/scala/code/docs/testkit/Specs2DemoAcceptance.scala +++ b/akka-docs/scala/code/docs/testkit/Specs2DemoAcceptance.scala @@ -1,5 +1,8 @@ package docs.testkit +import language.postfixOps +import language.implicitConversions + import org.specs2.Specification import org.specs2.specification.{ Step, Scope } diff --git a/akka-docs/scala/code/docs/testkit/Specs2DemoSpec.scala b/akka-docs/scala/code/docs/testkit/Specs2DemoSpec.scala index a620c5139b..788b803099 100644 --- a/akka-docs/scala/code/docs/testkit/Specs2DemoSpec.scala +++ b/akka-docs/scala/code/docs/testkit/Specs2DemoSpec.scala @@ -1,5 +1,7 @@ package docs.testkit +import language.postfixOps + import org.specs2.mutable.Specification import org.specs2.specification.Scope import org.specs2.time.NoTimeConversions diff --git a/akka-docs/scala/code/docs/testkit/TestKitUsageSpec.scala b/akka-docs/scala/code/docs/testkit/TestKitUsageSpec.scala index 2ca1dbcef8..146e534e96 100644 --- a/akka-docs/scala/code/docs/testkit/TestKitUsageSpec.scala +++ b/akka-docs/scala/code/docs/testkit/TestKitUsageSpec.scala @@ -3,6 +3,8 @@ */ package docs.testkit +import language.postfixOps + //#testkit-usage import scala.util.Random diff --git a/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala b/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala index 564b7929ce..876d6b1c05 100644 --- a/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala +++ b/akka-docs/scala/code/docs/testkit/TestkitDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.testkit +import language.postfixOps + //#imports-test-probe import akka.testkit.TestProbe import akka.util.duration._ diff --git a/akka-docs/scala/code/docs/transactor/TransactorDocSpec.scala b/akka-docs/scala/code/docs/transactor/TransactorDocSpec.scala index c1556b837d..e44d4ae1d6 100644 --- a/akka-docs/scala/code/docs/transactor/TransactorDocSpec.scala +++ b/akka-docs/scala/code/docs/transactor/TransactorDocSpec.scala @@ -4,6 +4,8 @@ package docs.transactor +import language.postfixOps + import akka.actor._ import akka.transactor._ import akka.util.duration._ diff --git a/akka-docs/scala/code/docs/zeromq/ZeromqDocSpec.scala b/akka-docs/scala/code/docs/zeromq/ZeromqDocSpec.scala index 812e0edaaa..1d9b7c1442 100644 --- a/akka-docs/scala/code/docs/zeromq/ZeromqDocSpec.scala +++ b/akka-docs/scala/code/docs/zeromq/ZeromqDocSpec.scala @@ -3,6 +3,8 @@ */ package docs.zeromq +import language.postfixOps + import akka.actor.Actor import akka.actor.Props import akka.util.duration._ @@ -30,7 +32,7 @@ object ZeromqDocSpec { class HealthProbe extends Actor { - val pubSocket = context.system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1235")) + val pubSocket = ZeroMQExtension(context.system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1235")) val memory = ManagementFactory.getMemoryMXBean val os = ManagementFactory.getOperatingSystemMXBean val ser = SerializationExtension(context.system) @@ -64,7 +66,7 @@ object ZeromqDocSpec { //#logger class Logger extends Actor with ActorLogging { - context.system.newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health")) + ZeroMQExtension(context.system).newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health")) val ser = SerializationExtension(context.system) val timestampFormat = new SimpleDateFormat("HH:mm:ss.SSS") @@ -90,7 +92,7 @@ object ZeromqDocSpec { //#alerter class HeapAlerter extends Actor with ActorLogging { - context.system.newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health.heap")) + ZeroMQExtension(context.system).newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health.heap")) val ser = SerializationExtension(context.system) var count = 0 @@ -121,11 +123,6 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") { val pubSocket = ZeroMQExtension(system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21231")) //#pub-socket - //#pub-socket2 - import akka.zeromq._ - val pubSocket2 = system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21232")) - //#pub-socket2 - //#sub-socket import akka.zeromq._ val listener = system.actorOf(Props(new Actor { @@ -135,11 +132,11 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") { case _ ⇒ //... } })) - val subSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), SubscribeAll) + val subSocket = ZeroMQExtension(system).newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), SubscribeAll) //#sub-socket //#sub-topic-socket - val subTopicSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), Subscribe("foo.bar")) + val subTopicSocket = ZeroMQExtension(system).newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), Subscribe("foo.bar")) //#sub-topic-socket //#unsub-topic-socket @@ -155,7 +152,7 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") { system.stop(subTopicSocket) //#high-watermark - val highWatermarkSocket = system.newSocket( + val highWatermarkSocket = ZeroMQExtension(system).newSocket( SocketType.Router, Listener(listener), Bind("tcp://127.0.0.1:21233"), diff --git a/akka-docs/scala/zeromq.rst b/akka-docs/scala/zeromq.rst index d94ee81270..b9780b70d6 100644 --- a/akka-docs/scala/zeromq.rst +++ b/akka-docs/scala/zeromq.rst @@ -21,12 +21,8 @@ Sockets are always created using the ``akka.zeromq.ZeroMQExtension``, for exampl .. includecode:: code/docs/zeromq/ZeromqDocSpec.scala#pub-socket -or by importing the ``akka.zeromq._`` package to make newSocket method available on system, via an implicit conversion. -.. includecode:: code/docs/zeromq/ZeromqDocSpec.scala#pub-socket2 - - -Above examples will create a ZeroMQ Publisher socket that is Bound to the port 1234 on localhost. +Above examples will create a ZeroMQ Publisher socket that is Bound to the port 1233 on localhost. Similarly you can create a subscription socket, with a listener, that subscribes to all messages from the publisher using: diff --git a/akka-durable-mailboxes/akka-file-mailbox/src/test/scala/akka/actor/mailbox/FileBasedMailboxSpec.scala b/akka-durable-mailboxes/akka-file-mailbox/src/test/scala/akka/actor/mailbox/FileBasedMailboxSpec.scala index e3ad811b52..9c76571899 100644 --- a/akka-durable-mailboxes/akka-file-mailbox/src/test/scala/akka/actor/mailbox/FileBasedMailboxSpec.scala +++ b/akka-durable-mailboxes/akka-file-mailbox/src/test/scala/akka/actor/mailbox/FileBasedMailboxSpec.scala @@ -1,5 +1,7 @@ package akka.actor.mailbox +import language.postfixOps + import org.apache.commons.io.FileUtils import akka.dispatch.Mailbox diff --git a/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala b/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala index 966120583a..a0745b07e0 100644 --- a/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/NetworkFailureSpec.scala @@ -31,7 +31,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec ⇒ Thread.sleep(duration.toMillis) restoreIP } catch { - case e ⇒ + case e: Throwable ⇒ dead.set(true) e.printStackTrace } @@ -46,7 +46,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec ⇒ Thread.sleep(duration.toMillis) restoreIP } catch { - case e ⇒ + case e: Throwable ⇒ dead.set(true) e.printStackTrace } @@ -61,7 +61,7 @@ trait NetworkFailureSpec extends DefaultTimeout { self: AkkaSpec ⇒ Thread.sleep(duration.toMillis) restoreIP } catch { - case e ⇒ + case e: Throwable ⇒ dead.set(true) e.printStackTrace } diff --git a/akka-transactor/src/main/scala/akka/transactor/Transactor.scala b/akka-transactor/src/main/scala/akka/transactor/Transactor.scala index fd802e1f21..3df222fe4d 100644 --- a/akka-transactor/src/main/scala/akka/transactor/Transactor.scala +++ b/akka-transactor/src/main/scala/akka/transactor/Transactor.scala @@ -4,6 +4,8 @@ package akka.transactor +import language.postfixOps + import akka.actor.{ Actor, ActorRef } import scala.concurrent.stm.InTxn diff --git a/akka-transactor/src/test/scala/akka/transactor/FickleFriendsSpec.scala b/akka-transactor/src/test/scala/akka/transactor/FickleFriendsSpec.scala index 9deee7b9cc..ce2cf39811 100644 --- a/akka-transactor/src/test/scala/akka/transactor/FickleFriendsSpec.scala +++ b/akka-transactor/src/test/scala/akka/transactor/FickleFriendsSpec.scala @@ -4,18 +4,20 @@ package akka.transactor +import language.postfixOps + import org.scalatest.BeforeAndAfterAll import akka.actor._ import akka.dispatch.Await import akka.util.duration._ -import akka.util.Timeout import akka.testkit._ import akka.testkit.TestEvent.Mute import scala.concurrent.stm._ import scala.util.Random.{ nextInt ⇒ random } import java.util.concurrent.CountDownLatch import akka.pattern.{ AskTimeoutException, ask } +import akka.util.{ NonFatal, Timeout } object FickleFriends { case class FriendlyIncrement(friends: Seq[ActorRef], timeout: Timeout, latch: CountDownLatch) @@ -49,7 +51,7 @@ object FickleFriends { } } } catch { - case _ ⇒ () // swallow exceptions + case NonFatal(_) ⇒ () // swallow exceptions } } } diff --git a/akka-transactor/src/test/scala/akka/transactor/TransactorSpec.scala b/akka-transactor/src/test/scala/akka/transactor/TransactorSpec.scala index df9723ffd2..e71d3c1b3d 100644 --- a/akka-transactor/src/test/scala/akka/transactor/TransactorSpec.scala +++ b/akka-transactor/src/test/scala/akka/transactor/TransactorSpec.scala @@ -4,6 +4,8 @@ package akka.transactor +import language.postfixOps + import akka.actor._ import akka.dispatch.Await import akka.util.duration._ diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index a0bd3df897..c90cddb2b1 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -20,13 +20,15 @@ import Sphinx.{ sphinxDocs, sphinxHtml, sphinxLatex, sphinxPdf, sphinxPygments, object AkkaBuild extends Build { System.setProperty("akka.mode", "test") // Is there better place for this? + lazy val desiredScalaVersion = "2.10.0-M4" + lazy val buildSettings = Seq( organization := "com.typesafe.akka", version := "2.1-SNAPSHOT", //scalaVersion := "2.10.0-M4" scalaVersion := "2.10.0-SNAPSHOT", scalaVersion in update <<= (scalaVersion) apply { - case "2.10.0-SNAPSHOT" => "2.10.0-M4" + case "2.10.0-SNAPSHOT" => desiredScalaVersion case x => x } ) @@ -48,7 +50,7 @@ object AkkaBuild extends Build { sphinxLatex <<= sphinxLatex in LocalProject(docs.id), sphinxPdf <<= sphinxPdf in LocalProject(docs.id) ), - aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, akkaSbtPlugin, samples, tutorials, docs) + aggregate = Seq(actor, testkit, actorTests, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, /*akkaSbtPlugin,*/ samples, tutorials, docs) ) lazy val actor = Project( @@ -299,6 +301,7 @@ object AkkaBuild extends Build { override lazy val settings = super.settings ++ buildSettings ++ Seq( resolvers += "Sonatype Snapshot Repo" at "https://oss.sonatype.org/content/repositories/snapshots/", + resolvers += "Sonatype Releases Repo" at "https://oss.sonatype.org/content/repositories/releases/", shellPrompt := { s => Project.extract(s).currentProject.id + " > " } ) @@ -446,9 +449,7 @@ object AkkaBuild extends Build { object Dependencies { import Dependency._ - val actor = Seq( - config - ) + val actor = Seq(config) val testkit = Seq(Test.scalatest, Test.junit) @@ -480,28 +481,31 @@ object Dependencies { } object Dependency { + + def v(a: String): String = a+"_"+AkkaBuild.desiredScalaVersion + // Compile - val config = "com.typesafe" % "config" % "0.4.1" // ApacheV2 - val camelCore = "org.apache.camel" % "camel-core" % "2.8.0" // ApacheV2 - val netty = "io.netty" % "netty" % "3.5.0.Final" // ApacheV2 - val protobuf = "com.google.protobuf" % "protobuf-java" % "2.4.1" // New BSD - val scalaStm = "org.scala-tools" %% "scala-stm" % "0.5" // Modified BSD (Scala) - val slf4jApi = "org.slf4j" % "slf4j-api" % "1.6.4" // MIT - val zeroMQ = "org.zeromq" %% "zeromq-scala-binding" % "0.0.6" // ApacheV2 //FIXME SWITCH TO OFFICIAL VERSION - val uncommonsMath = "org.uncommons.maths" % "uncommons-maths" % "1.2.2a" // ApacheV2 + val config = "com.typesafe" % "config" % "0.4.1" // ApacheV2 + val camelCore = "org.apache.camel" % "camel-core" % "2.8.0" // ApacheV2 + val netty = "io.netty" % "netty" % "3.5.1.Final" // ApacheV2 + val protobuf = "com.google.protobuf" % "protobuf-java" % "2.4.1" // New BSD + val scalaStm = "org.scala-tools" % v("scala-stm") % "0.5" // Modified BSD (Scala) + val slf4jApi = "org.slf4j" % "slf4j-api" % "1.6.4" // MIT + val zeroMQ = "org.zeromq" % v("zeromq-scala-binding") % "0.0.6" // ApacheV2 //FIXME SWITCH TO OFFICIAL VERSION + val uncommonsMath = "org.uncommons.maths" % "uncommons-maths" % "1.2.2a" // ApacheV2 // Test object Test { - val commonsMath = "org.apache.commons" % "commons-math" % "2.1" % "test" // ApacheV2 - val commonsIo = "commons-io" % "commons-io" % "2.0.1" % "test" // ApacheV2 - val junit = "junit" % "junit" % "4.10" % "test" // Common Public License 1.0 - val logback = "ch.qos.logback" % "logback-classic" % "1.0.4" % "test" // EPL 1.0 / LGPL 2.1 - val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" // MIT - val scalatest = "org.scalatest" %% "scalatest" % "1.9-2.10.0-M4-B2" % "test" // ApacheV2 - val scalacheck = "org.scalacheck" %% "scalacheck" % "1.10.0-b1" % "test" // New BSD - val specs2 = "org.specs2" %% "specs2" % "1.11" % "test" // Modified BSD / ApacheV2 + val commonsMath = "org.apache.commons" % "commons-math" % "2.1" % "test" // ApacheV2 + val commonsIo = "commons-io" % "commons-io" % "2.0.1" % "test" // ApacheV2 + val junit = "junit" % "junit" % "4.10" % "test" // Common Public License 1.0 + val logback = "ch.qos.logback" % "logback-classic" % "1.0.4" % "test" // EPL 1.0 / LGPL 2.1 + val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" // MIT + val scalatest = "org.scalatest" % v("scalatest") % "1.9-2.10.0-M4-B2" % "test" // ApacheV2 + val scalacheck = "org.scalacheck" % v("scalacheck") % "1.10.0-b1" % "test" // New BSD + val specs2 = "org.specs2" % "specs2_2.10" % "1.11" % "test" // Modified BSD / ApacheV2 } }