diff --git a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java index 904b1243e1..f4bed75b0e 100644 --- a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java +++ b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java @@ -181,7 +181,7 @@ public class JavaFutureTests { })); } - Future result = fold("", 15000,listFutures, new Function2(){ + Future result = fold("", 15000,listFutures, new Function2() { public String apply(String r, String t) { return r + t; } @@ -203,7 +203,7 @@ public class JavaFutureTests { })); } - Future result = reduce(listFutures, 15000, new Function2(){ + Future result = reduce(listFutures, 15000, new Function2() { public String apply(String r, String t) { return r + t; } @@ -221,7 +221,7 @@ public class JavaFutureTests { listStrings.add("test"); } - Future> result = traverse(listStrings, new Function>(){ + Future> result = traverse(listStrings, new Function>() { public Future apply(final String r) { return future(new Callable() { public String call() { diff --git a/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala b/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala index 5e51e2366a..a4f1953176 100644 --- a/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/AkkaExceptionSpec.scala @@ -22,7 +22,7 @@ class AkkaExceptionSpec extends WordSpec with MustMatchers { } } - def verify(clazz: java.lang.Class[_]): Unit = { + def verify(clazz: java.lang.Class[_]) { clazz.getConstructor(Array(classOf[String]): _*) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala b/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala index 15235b134a..e1b619e6e7 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala @@ -121,7 +121,7 @@ object IOActorSpec { var socket: SocketHandle = _ - override def preStart: Unit = { + override def preStart { socket = connect(ioManager, host, port) } 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 c9abd7d31e..f6d287f123 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 @@ -334,7 +334,7 @@ abstract class ActorModelSpec extends JUnitSuite { } @Test - def dispatcherShouldProcessMessagesInParallel: Unit = { + def dispatcherShouldProcessMessagesInParallel { implicit val dispatcher = newInterceptedDispatcher val aStart, aStop, bParallel = new CountDownLatch(1) val a, b = newTestActor diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala index 2c4117f778..0bfca51053 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala @@ -21,7 +21,7 @@ class Report( val legendTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm") val fileTimestampFormat = new SimpleDateFormat("yyyyMMddHHmmss") - def html(statistics: Seq[Stats]): Unit = { + def html(statistics: Seq[Stats]) { val current = statistics.last val sb = new StringBuilder diff --git a/akka-actor/src/main/java/akka/event/JavaEventHandler.java b/akka-actor/src/main/java/akka/event/JavaEventHandler.java index 608877e24a..f6e0224ed3 100644 --- a/akka-actor/src/main/java/akka/event/JavaEventHandler.java +++ b/akka-actor/src/main/java/akka/event/JavaEventHandler.java @@ -12,23 +12,23 @@ import akka.actor.ActorRef; public class JavaEventHandler { - public static void notify(Object message){ + public static void notify(Object message) { EventHandler$.MODULE$.notify(message); } - public static void debug(ActorRef instance, Object message){ + public static void debug(ActorRef instance, Object message) { EventHandler$.MODULE$.debug(instance, message); } - public static void info(ActorRef instance, Object message){ + public static void info(ActorRef instance, Object message) { EventHandler$.MODULE$.info(instance,message); } - public static void warning(ActorRef instance, Object message){ + public static void warning(ActorRef instance, Object message) { EventHandler$.MODULE$.warning(instance,message); } - public static void error(ActorRef instance, Object message){ + public static void error(ActorRef instance, Object message) { EventHandler$.MODULE$.debug(instance,message); } diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index 9b40954a4b..2db25c8e54 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -366,7 +366,7 @@ object Actor { * } * */ - def spawn(body: ⇒ Unit)(implicit dispatcher: MessageDispatcher = Dispatchers.defaultGlobalDispatcher): Unit = { + def spawn(body: ⇒ Unit)(implicit dispatcher: MessageDispatcher = Dispatchers.defaultGlobalDispatcher) { actorOf(Props(self ⇒ { case "go" ⇒ try { body } finally { self.stop() } }).withDispatcher(dispatcher)) ! "go" } } diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 80bbc5539d..a26cfc162a 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -104,7 +104,7 @@ private[akka] class ActorCell( @volatile var mailbox: Mailbox = _ - def start(): Unit = { + def start() { if (props.supervisor.isDefined) props.supervisor.get.link(self) mailbox = dispatcher.createMailbox(this) Actor.registry.register(self) @@ -200,7 +200,7 @@ private[akka] class ActorCell( case msg ⇒ msg.channel } - def systemInvoke(envelope: SystemEnvelope): Unit = { + def systemInvoke(envelope: SystemEnvelope) { def create(recreation: Boolean): Unit = try { actor.get() match { case null ⇒ @@ -226,7 +226,7 @@ private[akka] class ActorCell( def resume(): Unit = dispatcher resume this - def terminate(): Unit = { + def terminate() { receiveTimeout = None cancelReceiveTimeout Actor.provider.evict(self.address) @@ -279,7 +279,7 @@ private[akka] class ActorCell( } } - def invoke(messageHandle: Envelope): Unit = { + def invoke(messageHandle: Envelope) { guard.lock.lock() try { if (!mailbox.isClosed) { @@ -320,7 +320,7 @@ private[akka] class ActorCell( } } - def handleFailure(fail: Failed): Unit = { + def handleFailure(fail: Failed) { props.faultHandler match { case AllForOnePermanentStrategy(trapExit, maxRetries, within) if trapExit.exists(_.isAssignableFrom(fail.cause.getClass)) ⇒ restartLinkedActors(fail.cause, maxRetries, within) @@ -426,7 +426,7 @@ private[akka] class ActorCell( denied == false // if we weren't denied, we have a go } - protected[akka] def restartLinkedActors(reason: Throwable, maxNrOfRetries: Option[Int], withinTimeRange: Option[Int]): Unit = { + protected[akka] def restartLinkedActors(reason: Throwable, maxNrOfRetries: Option[Int], withinTimeRange: Option[Int]) { props.faultHandler.lifeCycle match { case Temporary ⇒ val i = _linkedActors.values.iterator @@ -466,7 +466,7 @@ private[akka] class ActorCell( def clearActorContext(): Unit = setActorContext(null) - def setActorContext(newContext: ActorContext): Unit = { + def setActorContext(newContext: ActorContext) { @tailrec def lookupAndSetSelfFields(clazz: Class[_], actor: Actor, newContext: ActorContext): Boolean = { val success = try { diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index bbffb6c0bc..2915c66f20 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -345,7 +345,7 @@ private[akka] case class RemoteActorRef private[akka] ( protected[akka] override def timeout: Long = _timeout - def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit = { + def postMessageToMailbox(message: Any, channel: UntypedChannel) { val chSender = if (channel.isInstanceOf[ActorRef]) Some(channel.asInstanceOf[ActorRef]) else None Actor.remote.send[Any](message, chSender, None, remoteAddress, timeout, true, this, loader) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRegistry.scala b/akka-actor/src/main/scala/akka/actor/ActorRegistry.scala index 00a322cd31..a04038b40c 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRegistry.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRegistry.scala @@ -60,12 +60,12 @@ private[actor] final class ActorRegistry private[actor] () extends ListenerManag notifyListeners(ActorRegistered(address, actor)) } - private[akka] def registerTypedActor(actorRef: ActorRef, proxy: AnyRef): Unit = { + private[akka] def registerTypedActor(actorRef: ActorRef, proxy: AnyRef) { if (typedActorsByUuid.putIfAbsent(actorRef.uuid, proxy) eq null) notifyListeners(TypedActorRegistered(actorRef.address, actorRef, proxy)) } - private[akka] def unregisterTypedActor(actorRef: ActorRef, proxy: AnyRef): Unit = { + private[akka] def unregisterTypedActor(actorRef: ActorRef, proxy: AnyRef) { if (typedActorsByUuid.remove(actorRef.uuid, proxy)) notifyListeners(TypedActorUnregistered(actorRef.address, actorRef, proxy)) } diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index a8482369a5..fd3c9ab2e3 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -487,12 +487,12 @@ trait FSM[S, D] extends ListenerManagement { } } - private def processMsg(value: Any, source: AnyRef): Unit = { + private def processMsg(value: Any, source: AnyRef) { val event = Event(value, currentState.stateData) processEvent(event, source) } - private[akka] def processEvent(event: Event, source: AnyRef): Unit = { + private[akka] def processEvent(event: Event, source: AnyRef) { val stateFunc = stateFunctions(currentState.stateName) val nextState = if (stateFunc isDefinedAt event) { stateFunc(event) @@ -503,7 +503,7 @@ trait FSM[S, D] extends ListenerManagement { applyState(nextState) } - private[akka] def applyState(nextState: State): Unit = { + private[akka] def applyState(nextState: State) { nextState.stopReason match { case None ⇒ makeTransition(nextState) case _ ⇒ @@ -513,7 +513,7 @@ trait FSM[S, D] extends ListenerManagement { } } - private[akka] def makeTransition(nextState: State): Unit = { + private[akka] def makeTransition(nextState: State) { if (!stateFunctions.contains(nextState.stateName)) { terminate(stay withStopReason Failure("Next state %s does not exist".format(nextState.stateName))) } else { @@ -535,7 +535,7 @@ trait FSM[S, D] extends ListenerManagement { override def postStop() { terminate(stay withStopReason Shutdown) } - private def terminate(nextState: State): Unit = { + private def terminate(nextState: State) { if (!currentState.stopReason.isDefined) { val reason = nextState.stopReason.get reason match { diff --git a/akka-actor/src/main/scala/akka/actor/IO.scala b/akka-actor/src/main/scala/akka/actor/IO.scala index 15c25ee800..86b879ccff 100644 --- a/akka-actor/src/main/scala/akka/actor/IO.scala +++ b/akka-actor/src/main/scala/akka/actor/IO.scala @@ -196,7 +196,7 @@ trait IO { // only reinvoke messages from the original message to avoid stack overflow private var reinvoked = false - private def reinvoke(): Unit = { + private def reinvoke() { if (!reinvoked && (_next eq Idle) && _messages.nonEmpty) { try { reinvoked = true @@ -208,7 +208,7 @@ trait IO { } @tailrec - private def run(): Unit = { + private def run() { _next match { case ByteStringLength(continuation, handle, message, waitingFor) ⇒ context.currentMessage = message @@ -256,7 +256,7 @@ class IOManager(bufferSize: Int = 8192) extends Actor { var worker: IOWorker = _ - override def preStart: Unit = { + override def preStart { worker = new IOWorker(self, bufferSize) worker.start() } @@ -279,7 +279,7 @@ class IOManager(bufferSize: Int = 8192) extends Actor { case IO.Close(handle) ⇒ worker(Close(handle)) } - override def postStop: Unit = { + override def postStop { worker(Shutdown) } @@ -324,7 +324,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { private val buffer = ByteBuffer.allocate(bufferSize) private val thread = new Thread("io-worker") { - override def run(): Unit = { + override def run() { while (selector.isOpen) { selector select () val keys = selector.selectedKeys.iterator @@ -359,7 +359,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } } - private def process(key: SelectionKey): Unit = { + private def process(key: SelectionKey) { val handle = key.attachment.asInstanceOf[IO.Handle] try { if (key.isConnectable) key.channel match { @@ -387,7 +387,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } } - private def cleanup(handle: IO.Handle, cause: Option[Exception]): Unit = { + private def cleanup(handle: IO.Handle, cause: Option[Exception]) { handle match { case server: IO.ServerHandle ⇒ accepted -= server case writable: IO.WriteHandle ⇒ writes -= writable @@ -409,19 +409,19 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { private def setOps(handle: IO.Handle, ops: Int): Unit = channels(handle) keyFor selector interestOps ops - private def addOps(handle: IO.Handle, ops: Int): Unit = { + private def addOps(handle: IO.Handle, ops: Int) { val key = channels(handle) keyFor selector val cur = key.interestOps key interestOps (cur | ops) } - private def removeOps(handle: IO.Handle, ops: Int): Unit = { + private def removeOps(handle: IO.Handle, ops: Int) { val key = channels(handle) keyFor selector val cur = key.interestOps key interestOps (cur - (cur & ops)) } - private def connect(socket: IO.SocketHandle, channel: SocketChannel): Unit = { + private def connect(socket: IO.SocketHandle, channel: SocketChannel) { if (channel.finishConnect) { removeOps(socket, OP_CONNECT) socket.owner ! IO.Connected(socket) @@ -431,7 +431,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } @tailrec - private def accept(server: IO.ServerHandle, channel: ServerSocketChannel): Unit = { + private def accept(server: IO.ServerHandle, channel: ServerSocketChannel) { val socket = channel.accept if (socket ne null) { socket configureBlocking false @@ -442,7 +442,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } @tailrec - private def read(handle: IO.ReadHandle, channel: ReadChannel): Unit = { + private def read(handle: IO.ReadHandle, channel: ReadChannel) { buffer.clear val readLen = channel read buffer if (readLen == -1) { @@ -455,7 +455,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } @tailrec - private def write(handle: IO.WriteHandle, channel: WriteChannel): Unit = { + private def write(handle: IO.WriteHandle, channel: WriteChannel) { val queue = writes(handle) if (queue.nonEmpty) { val (buf, bufs) = queue.dequeue @@ -473,7 +473,7 @@ private[akka] class IOWorker(ioManager: ActorRef, val bufferSize: Int) { } @tailrec - private def addRequest(req: Request): Unit = { + private def addRequest(req: Request) { val requests = _requests.get if (_requests compareAndSet (requests, req :: requests)) selector wakeup () diff --git a/akka-actor/src/main/scala/akka/actor/Supervisor.scala b/akka-actor/src/main/scala/akka/actor/Supervisor.scala index 8a626cfe5f..57e69625fd 100644 --- a/akka-actor/src/main/scala/akka/actor/Supervisor.scala +++ b/akka-actor/src/main/scala/akka/actor/Supervisor.scala @@ -166,7 +166,7 @@ sealed class Supervisor(handler: FaultHandlingStrategy, maxRestartsHandler: (Act */ final class SupervisorActor private[akka] (maxRestartsHandler: (ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached) ⇒ Unit) extends Actor { - override def postStop(): Unit = { + override def postStop() { val i = linkedActors.iterator while (i.hasNext) { val ref = i.next diff --git a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala index 6688374dc5..f383bdf300 100644 --- a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala @@ -99,7 +99,7 @@ class BalancingDispatcher( registerForExecution(buddy.mailbox, false, false) } - protected[akka] override def shutdown(): Unit = { + protected[akka] override def shutdown() { super.shutdown() buddies.clear() } diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala index b7fc334adb..40303b0015 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala @@ -102,7 +102,7 @@ class Dispatcher( registerForExecution(mbox, false, true) } - protected[akka] def executeTask(invocation: TaskInvocation): Unit = { + protected[akka] def executeTask(invocation: TaskInvocation) { try { executorService.get() execute invocation } catch { diff --git a/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala b/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala index 2da4f78a8b..0b572bb177 100644 --- a/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala +++ b/akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala @@ -44,7 +44,7 @@ abstract class Mailbox extends MessageQueue with SystemMessageQueue with Runnabl * Internal method to enforce a volatile write of the status */ @tailrec - final def acknowledgeStatus(): Unit = { + final def acknowledgeStatus() { val s = _status.get() if (_status.compareAndSet(s, s)) () else acknowledgeStatus() @@ -112,7 +112,7 @@ abstract class Mailbox extends MessageQueue with SystemMessageQueue with Runnabl } } - def processAllSystemMessages(): Unit = { + def processAllSystemMessages() { var nextMessage = systemDequeue() while (nextMessage ne null) { nextMessage.invoke() diff --git a/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala b/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala index c77def592c..fc610426a3 100644 --- a/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala +++ b/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala @@ -36,7 +36,7 @@ final case class SystemEnvelope(val receiver: ActorCell, val message: SystemMess /** * @return whether to proceed with processing other messages */ - final def invoke(): Unit = { + final def invoke() { receiver systemInvoke this } } @@ -105,7 +105,7 @@ abstract class MessageDispatcher extends Serializable { /** * Attaches the specified actor instance to this dispatcher */ - final def attach(actor: ActorCell): Unit = { + final def attach(actor: ActorCell) { guard.lock.lock() try { startIfUnstarted() @@ -118,7 +118,7 @@ abstract class MessageDispatcher extends Serializable { /** * Detaches the specified actor instance from this dispatcher */ - final def detach(actor: ActorCell): Unit = { + final def detach(actor: ActorCell) { guard withGuard { unregister(actor) if (uuids.isEmpty && _tasks.get == 0) { @@ -134,11 +134,11 @@ abstract class MessageDispatcher extends Serializable { } } - protected final def startIfUnstarted(): Unit = { + protected final def startIfUnstarted() { if (active.isOff) guard withGuard { active.switchOn { start() } } } - protected[akka] final def dispatchTask(block: () ⇒ Unit): Unit = { + protected[akka] final def dispatchTask(block: () ⇒ Unit) { _tasks.getAndIncrement() try { startIfUnstarted() @@ -170,7 +170,7 @@ abstract class MessageDispatcher extends Serializable { * Only "private[akka] for the sake of intercepting calls, DO NOT CALL THIS OUTSIDE OF THE DISPATCHER, * and only call it under the dispatcher-guard, see "attach" for the only invocation */ - protected[akka] def register(actor: ActorCell): Unit = { + protected[akka] def register(actor: ActorCell) { if (uuids add actor.uuid) { systemDispatch(SystemEnvelope(actor, Create, NullChannel)) //FIXME should this be here or moved into ActorCell.start perhaps? } else System.err.println("Couldn't register: " + actor) @@ -180,7 +180,7 @@ abstract class MessageDispatcher extends Serializable { * Only "private[akka] for the sake of intercepting calls, DO NOT CALL THIS OUTSIDE OF THE DISPATCHER, * and only call it under the dispatcher-guard, see "detach" for the only invocation */ - protected[akka] def unregister(actor: ActorCell): Unit = { + protected[akka] def unregister(actor: ActorCell) { if (uuids remove actor.uuid) { val mailBox = actor.mailbox mailBox.become(Mailbox.Closed) @@ -193,7 +193,7 @@ abstract class MessageDispatcher extends Serializable { * Overridable callback to clean up the mailbox for a given actor, * called when an actor is unregistered. */ - protected def cleanUpMailboxFor(actor: ActorCell, mailBox: Mailbox): Unit = { + protected def cleanUpMailboxFor(actor: ActorCell, mailBox: Mailbox) { if (mailBox.hasSystemMessages) { var envelope = mailBox.systemDequeue() diff --git a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala index a4a78bf8ba..508ec8f267 100644 --- a/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala +++ b/akka-actor/src/main/scala/akka/dispatch/PromiseStream.scala @@ -53,7 +53,7 @@ trait PromiseStreamIn[A] { final def enqueue(elem: Future[A]): Unit = elem foreach (enqueue(_)) - final def enqueue(elem1: Future[A], elem2: Future[A], elems: Future[A]*): Unit = { + final def enqueue(elem1: Future[A], elem2: Future[A], elems: Future[A]*) { this += elem1 += elem2 elems foreach (enqueue(_)) } diff --git a/akka-actor/src/main/scala/akka/event/DeathWatch.scala b/akka-actor/src/main/scala/akka/event/DeathWatch.scala index a2ba6c3670..41d73f197b 100644 --- a/akka-actor/src/main/scala/akka/event/DeathWatch.scala +++ b/akka-actor/src/main/scala/akka/event/DeathWatch.scala @@ -29,7 +29,7 @@ trait Supervision { self: DeathWatch => val activeEntries = new ConcurrentHashMap[ActorRef, ActiveEntry](1024) val passiveEntries = new ConcurrentHashMap[ActorRef, PassiveEntry](1024) - def registerMonitorable(monitor: ActorRef, monitorsSupervisor: Option[ActorRef], faultHandlingStrategy: FaultHandlingStrategy): Unit = { + def registerMonitorable(monitor: ActorRef, monitorsSupervisor: Option[ActorRef], faultHandlingStrategy: FaultHandlingStrategy) { read.lock() try { activeEntries.putIfAbsent(monitor, ActiveEntry(strategy = faultHandlingStrategy)) @@ -39,7 +39,7 @@ trait Supervision { self: DeathWatch => } } - def deregisterMonitorable(monitor: ActorRef): Unit = { + def deregisterMonitorable(monitor: ActorRef) { read.lock() try { activeEntries.remove(monitor) diff --git a/akka-actor/src/main/scala/akka/util/BoundedBlockingQueue.scala b/akka-actor/src/main/scala/akka/util/BoundedBlockingQueue.scala index d198a81984..5b17ca5c7d 100644 --- a/akka-actor/src/main/scala/akka/util/BoundedBlockingQueue.scala +++ b/akka-actor/src/main/scala/akka/util/BoundedBlockingQueue.scala @@ -27,7 +27,7 @@ class BoundedBlockingQueue[E <: AnyRef]( private val notEmpty = lock.newCondition() private val notFull = lock.newCondition() - def put(e: E): Unit = { //Blocks until not full + def put(e: E) { //Blocks until not full if (e eq null) throw new NullPointerException lock.lock() try { @@ -157,7 +157,7 @@ class BoundedBlockingQueue[E <: AnyRef]( } } - override def clear(): Unit = { + override def clear() { lock.lock() try { backing.clear @@ -273,7 +273,7 @@ class BoundedBlockingQueue[E <: AnyRef]( elements(last).asInstanceOf[E] } - def remove(): Unit = { + def remove() { if (last < 0) throw new IllegalStateException val target = elements(last) last = -1 //To avoid 2 subsequent removes without a next in between diff --git a/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala b/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala index dba1e05997..9d034b86fd 100644 --- a/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala +++ b/akka-camel-typed/src/test/scala/akka/camel/TypedConsumerPublishRequestorTest.scala @@ -20,7 +20,7 @@ class TypedConsumerPublishRequestorTest extends JUnitSuite { r1.method.getName < r2.method.getName @Before - def setUp: Unit = { + def setUp{ publisher = actorOf(new TypedConsumerPublisherMock) requestor = actorOf(new TypedConsumerPublishRequestor) requestor ! InitPublishRequestor(publisher) diff --git a/akka-camel/src/main/scala/akka/camel/Producer.scala b/akka-camel/src/main/scala/akka/camel/Producer.scala index 7f9e82290d..a78b8ee118 100644 --- a/akka-camel/src/main/scala/akka/camel/Producer.scala +++ b/akka-camel/src/main/scala/akka/camel/Producer.scala @@ -92,7 +92,7 @@ trait ProducerSupport { this: Actor ⇒ * @param msg message to produce * @param pattern exchange pattern */ - protected def produce(msg: Any, pattern: ExchangePattern): Unit = { + protected def produce(msg: Any, pattern: ExchangePattern) { val cmsg = Message.canonicalize(msg) val exchange = createExchange(pattern).fromRequestMessage(cmsg) processor.process(exchange, new AsyncCallback { @@ -101,7 +101,7 @@ trait ProducerSupport { this: Actor ⇒ // later by another thread. val replyChannel = channel - def done(doneSync: Boolean): Unit = { + def done(doneSync: Boolean) { (doneSync, exchange.isFailed) match { case (true, true) ⇒ dispatchSync(exchange.toFailureMessage(cmsg.headers(headersToCopy))) case (true, false) ⇒ dispatchSync(exchange.toResponseMessage(cmsg.headers(headersToCopy))) diff --git a/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala b/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala index 68fb071ec7..1bfd13fa4f 100644 --- a/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala +++ b/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala @@ -281,7 +281,7 @@ private[akka] class AsyncCallbackAdapter(exchange: Exchange, callback: AsyncCall def resume(): Unit = () - def stop(): Unit = { + def stop() { running = false } diff --git a/akka-camel/src/test/scala/akka/camel/ConsumerPublishRequestorTest.scala b/akka-camel/src/test/scala/akka/camel/ConsumerPublishRequestorTest.scala index 7bfb28afb6..e52295e26b 100644 --- a/akka-camel/src/test/scala/akka/camel/ConsumerPublishRequestorTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ConsumerPublishRequestorTest.scala @@ -17,7 +17,7 @@ class ConsumerPublishRequestorTest extends JUnitSuite { var consumer: LocalActorRef = _ @Before - def setUp: Unit = { + def setUp{ publisher = actorOf(new ConsumerPublisherMock) requestor = actorOf(new ConsumerPublishRequestor) requestor ! InitPublishRequestor(publisher) diff --git a/akka-camel/src/test/scala/akka/camel/component/ActorProducerTest.scala b/akka-camel/src/test/scala/akka/camel/component/ActorProducerTest.scala index 27fa751c63..f8e4aeec0a 100644 --- a/akka-camel/src/test/scala/akka/camel/component/ActorProducerTest.scala +++ b/akka-camel/src/test/scala/akka/camel/component/ActorProducerTest.scala @@ -208,7 +208,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test - def shouldThrowExceptionWhenIdNotSet: Unit = { + def shouldThrowExceptionWhenIdNotSet{ val actor = actorOf[Tester1] val latch = (actor ? SetExpectedMessageCount(1)).as[CountDownLatch].get val endpoint = actorEndpoint("actor:id:") @@ -218,7 +218,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test - def shouldThrowExceptionWhenUuidNotSet: Unit = { + def shouldThrowExceptionWhenUuidNotSet{ val actor = actorOf[Tester1] val latch = (actor ? SetExpectedMessageCount(1)).as[CountDownLatch].get val endpoint = actorEndpoint("actor:uuid:") @@ -228,7 +228,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test - def shouldSendMessageToActorAndTimeout(): Unit = { + def shouldSendMessageToActorAndTimeout() { val actor = actorOf(Props[Tester3].withTimeout(Timeout(1))) val endpoint = actorEndpoint("actor:uuid:%s" format actor.uuid) val exchange = endpoint.createExchange(ExchangePattern.InOut) diff --git a/akka-cluster/src/main/java/akka/cluster/LocalBookKeeper.java b/akka-cluster/src/main/java/akka/cluster/LocalBookKeeper.java index e358ff8ae4..413b9a3154 100644 --- a/akka-cluster/src/main/java/akka/cluster/LocalBookKeeper.java +++ b/akka-cluster/src/main/java/akka/cluster/LocalBookKeeper.java @@ -46,7 +46,7 @@ public class LocalBookKeeper { numberOfBookies = 3; } - public LocalBookKeeper(int numberOfBookies){ + public LocalBookKeeper(int numberOfBookies) { this(); this.numberOfBookies = numberOfBookies; } @@ -87,7 +87,7 @@ public class LocalBookKeeper { boolean b = waitForServerUp(HOSTPORT, CONNECTION_TIMEOUT); } - public void initializeZookeper(){ + public void initializeZookeper() { //initialize the zk client with values try { zkc = new ZooKeeper("127.0.0.1", ZooKeeperDefaultPort, new emptyWatcher()); @@ -107,7 +107,7 @@ public class LocalBookKeeper { tmpDirs = new File[numberOfBookies]; bs = new BookieServer[numberOfBookies]; - for(int i = 0; i < numberOfBookies; i++){ + for(int i = 0; i < numberOfBookies; i++) { tmpDirs[i] = File.createTempFile("bookie" + Integer.toString(i), "test"); tmpDirs[i].delete(); tmpDirs[i].mkdir(); @@ -119,7 +119,7 @@ public class LocalBookKeeper { } public static void main(String[] args) throws IOException, InterruptedException { - if(args.length < 1){ + if(args.length < 1) { usage(); System.exit(-1); } @@ -127,7 +127,7 @@ public class LocalBookKeeper { lb.runZookeeper(1000); lb.initializeZookeper(); lb.runBookies(); - while (true){ + while (true) { Thread.sleep(5000); } } diff --git a/akka-cluster/src/main/java/akka/cluster/zookeeper/DistributedQueue.java b/akka-cluster/src/main/java/akka/cluster/zookeeper/DistributedQueue.java index 6dc1d05062..7bb87bc414 100644 --- a/akka-cluster/src/main/java/akka/cluster/zookeeper/DistributedQueue.java +++ b/akka-cluster/src/main/java/akka/cluster/zookeeper/DistributedQueue.java @@ -50,10 +50,10 @@ public class DistributedQueue { private final String prefix = "qn-"; - public DistributedQueue(ZooKeeper zookeeper, String dir, List acl){ + public DistributedQueue(ZooKeeper zookeeper, String dir, List acl) { this.dir = dir; - if(acl != null){ + if(acl != null) { this.acl = acl; } this.zookeeper = zookeeper; @@ -73,21 +73,21 @@ public class DistributedQueue { List childNames = null; try{ childNames = zookeeper.getChildren(dir, watcher); - }catch (KeeperException.NoNodeException e){ + }catch (KeeperException.NoNodeException e) { throw e; } - for(String childName : childNames){ + for(String childName : childNames) { try{ //Check format - if(!childName.regionMatches(0, prefix, 0, prefix.length())){ + if(!childName.regionMatches(0, prefix, 0, prefix.length())) { LOG.warn("Found child node with improper name: " + childName); continue; } String suffix = childName.substring(prefix.length()); Long childId = new Long(suffix); orderedChildren.put(childId,childName); - }catch(NumberFormatException e){ + }catch(NumberFormatException e) { LOG.warn("Found child node with improper format : " + childName + " " + e,e); } } @@ -107,31 +107,31 @@ public class DistributedQueue { try{ childNames = zookeeper.getChildren(dir, false); - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { LOG.warn("Caught: " +e,e); return null; } - for(String childName : childNames){ + for(String childName : childNames) { try{ //Check format - if(!childName.regionMatches(0, prefix, 0, prefix.length())){ + if(!childName.regionMatches(0, prefix, 0, prefix.length())) { LOG.warn("Found child node with improper name: " + childName); continue; } String suffix = childName.substring(prefix.length()); long childId = Long.parseLong(suffix); - if(childId < minId){ + if(childId < minId) { minId = childId; minName = childName; } - }catch(NumberFormatException e){ + }catch(NumberFormatException e) { LOG.warn("Found child node with improper format : " + childName + " " + e,e); } } - if(minId < Long.MAX_VALUE){ + if(minId < Long.MAX_VALUE) { return minName; }else{ return null; @@ -153,19 +153,19 @@ public class DistributedQueue { // Since other clients are remove()ing and take()ing nodes concurrently, // the child with the smallest sequence number in orderedChildren might be gone by the time we check. // We don't call getChildren again until we have tried the rest of the nodes in sequence order. - while(true){ + while(true) { try{ orderedChildren = orderedChildren(null); - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { throw new NoSuchElementException(); } if(orderedChildren.size() == 0 ) throw new NoSuchElementException(); - for(String headNode : orderedChildren.values()){ - if(headNode != null){ + for(String headNode : orderedChildren.values()) { + if(headNode != null) { try{ return zookeeper.getData(dir+"/"+headNode, false, null); - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { //Another client removed the node first, try next } } @@ -185,21 +185,21 @@ public class DistributedQueue { public byte[] remove() throws NoSuchElementException, KeeperException, InterruptedException { TreeMap orderedChildren; // Same as for element. Should refactor this. - while(true){ + while(true) { try{ orderedChildren = orderedChildren(null); - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { throw new NoSuchElementException(); } if(orderedChildren.size() == 0) throw new NoSuchElementException(); - for(String headNode : orderedChildren.values()){ + for(String headNode : orderedChildren.values()) { String path = dir +"/"+headNode; try{ byte[] data = zookeeper.getData(path, false, null); zookeeper.delete(path, -1); return data; - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { // Another client deleted the node first. } } @@ -211,11 +211,11 @@ public class DistributedQueue { CountDownLatch latch; - public LatchChildWatcher(){ + public LatchChildWatcher() { latch = new CountDownLatch(1); } - public void process(WatchedEvent event){ + public void process(WatchedEvent event) { LOG.debug("Watcher fired on path: " + event.getPath() + " state: " + event.getState() + " type " + event.getType()); latch.countDown(); @@ -235,26 +235,26 @@ public class DistributedQueue { public byte[] take() throws KeeperException, InterruptedException { TreeMap orderedChildren; // Same as for element. Should refactor this. - while(true){ + while(true) { LatchChildWatcher childWatcher = new LatchChildWatcher(); try{ orderedChildren = orderedChildren(childWatcher); - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { zookeeper.create(dir, new byte[0], acl, CreateMode.PERSISTENT); continue; } - if(orderedChildren.size() == 0){ + if(orderedChildren.size() == 0) { childWatcher.await(); continue; } - for(String headNode : orderedChildren.values()){ + for(String headNode : orderedChildren.values()) { String path = dir +"/"+headNode; try{ byte[] data = zookeeper.getData(path, false, null); zookeeper.delete(path, -1); return data; - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { // Another client deleted the node first. } } @@ -267,11 +267,11 @@ public class DistributedQueue { * @return true if data was successfully added */ public boolean offer(byte[] data) throws KeeperException, InterruptedException{ - for(;;){ + for(;;) { try{ zookeeper.create(dir+"/"+prefix, data, acl, CreateMode.PERSISTENT_SEQUENTIAL); return true; - }catch(KeeperException.NoNodeException e){ + }catch(KeeperException.NoNodeException e) { zookeeper.create(dir, new byte[0], acl, CreateMode.PERSISTENT); } } @@ -287,7 +287,7 @@ public class DistributedQueue { public byte[] peek() throws KeeperException, InterruptedException{ try{ return element(); - }catch(NoSuchElementException e){ + }catch(NoSuchElementException e) { return null; } } @@ -302,7 +302,7 @@ public class DistributedQueue { public byte[] poll() throws KeeperException, InterruptedException { try{ return remove(); - }catch(NoSuchElementException e){ + }catch(NoSuchElementException e) { return null; } } diff --git a/akka-cluster/src/main/scala/akka/cluster/TransactionLog.scala b/akka-cluster/src/main/scala/akka/cluster/TransactionLog.scala index f2ebceb7f8..d8f5e49716 100644 --- a/akka-cluster/src/main/scala/akka/cluster/TransactionLog.scala +++ b/akka-cluster/src/main/scala/akka/cluster/TransactionLog.scala @@ -393,7 +393,7 @@ object TransactionLog { /** * Starts up the transaction log. */ - def start(): Unit = { + def start() { isConnected switchOn { bookieClient = new BookKeeper(zooKeeperServers) zkClient = new AkkaZkClient(zooKeeperServers, sessionTimeout, connectionTimeout) diff --git a/akka-cluster/src/main/scala/akka/cluster/metrics/LocalNodeMetricsManager.scala b/akka-cluster/src/main/scala/akka/cluster/metrics/LocalNodeMetricsManager.scala index f2d4575688..3267671fba 100644 --- a/akka-cluster/src/main/scala/akka/cluster/metrics/LocalNodeMetricsManager.scala +++ b/akka-cluster/src/main/scala/akka/cluster/metrics/LocalNodeMetricsManager.scala @@ -158,7 +158,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add /* * Refreshes locally cached metrics from ZooKeeper, and invokes plugged monitors */ - private[akka] def refresh(): Unit = { + private[akka] def refresh() { storeMetricsInZK(getLocalMetrics) refreshMetricsCacheFromZK() @@ -172,7 +172,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add /* * Refreshes metrics manager cache from ZooKeeper */ - private def refreshMetricsCacheFromZK(): Unit = { + private def refreshMetricsCacheFromZK() { val allMetricsFromZK = getAllMetricsFromZK localNodeMetricsCache.keySet.foreach { key ⇒ diff --git a/akka-docs/java/futures.rst b/akka-docs/java/futures.rst index 8eb3d37758..2715ff33d1 100644 --- a/akka-docs/java/futures.rst +++ b/akka-docs/java/futures.rst @@ -204,7 +204,7 @@ The ``traverse`` method is similar to ``sequence``, but it takes a sequence of ` Iterable listStrings = ... //Just a sequence of Strings - Future> result = traverse(listStrings, new Function>(){ + Future> result = traverse(listStrings, new Function>() { public Future apply(final String r) { return future(new Callable() { public String call() { @@ -229,7 +229,7 @@ Then there's a method that's called ``fold`` that takes a start-value, a sequenc Iterable> futures = ... //A sequence of Futures, in this case Strings - Future result = fold("", 15000, futures, new Function2(){ //Start value is the empty string, timeout is 15 seconds + Future result = fold("", 15000, futures, new Function2() { //Start value is the empty string, timeout is 15 seconds public String apply(String r, String t) { return r + t; //Just concatenate } @@ -251,7 +251,7 @@ If the sequence passed to ``fold`` is empty, it will return the start-value, in Iterable> futures = ... //A sequence of Futures, in this case Strings - Future result = reduce(futures, 15000, new Function2(){ //Timeout is 15 seconds + Future result = reduce(futures, 15000, new Function2() { //Timeout is 15 seconds public String apply(String r, String t) { return r + t; //Just concatenate } diff --git a/akka-docs/scala/remote-actors.rst b/akka-docs/scala/remote-actors.rst index 0ea20ff9e1..3eac81323c 100644 --- a/akka-docs/scala/remote-actors.rst +++ b/akka-docs/scala/remote-actors.rst @@ -466,7 +466,7 @@ The API for server managed remote typed actors is nearly the same as for untyped .. code-block:: scala class RegistrationServiceImpl extends TypedActor with RegistrationService { - def registerUser(user: User): Unit = { + def registerUser(user: User) { ... // register user } } @@ -489,7 +489,7 @@ They are also useful if you need to perform some cleanup when a client disconnec .. code-block:: scala class RegistrationServiceImpl extends TypedActor with RegistrationService { - def registerUser(user: User): Unit = { + def registerUser(user: User) { ... // register user } } diff --git a/akka-docs/scala/typed-actors.rst b/akka-docs/scala/typed-actors.rst index f68567745e..0518d6142f 100644 --- a/akka-docs/scala/typed-actors.rst +++ b/akka-docs/scala/typed-actors.rst @@ -38,7 +38,7 @@ If you have a POJO with an interface implementation separation like this: .. code-block:: scala public class RegistrationServiceImpl extends TypedActor with RegistrationService { - def register(user: User, cred: Credentials): Unit = { + def register(user: User, cred: Credentials) { ... // register user } diff --git a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/Journal.scala b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/Journal.scala index 9b1973357f..6244171fce 100644 --- a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/Journal.scala +++ b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/Journal.scala @@ -62,15 +62,15 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { private val CMD_CONFIRM_REMOVE = 6 private val CMD_ADD_XID = 7 - private def open(file: File): Unit = { + private def open(file: File) { writer = new FileOutputStream(file, true).getChannel } - def open(): Unit = { + def open() { open(queueFile) } - def roll(xid: Int, openItems: List[QItem], queue: Iterable[QItem]): Unit = { + def roll(xid: Int, openItems: List[QItem], queue: Iterable[QItem]) { writer.close val tmpFile = new File(queuePath + "~~" + System.currentTimeMillis) open(tmpFile) @@ -89,13 +89,13 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { open } - def close(): Unit = { + def close() { writer.close for (r ← reader) r.close reader = None } - def erase(): Unit = { + def erase() { try { close() queueFile.delete @@ -108,7 +108,7 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { def isReplaying(): Boolean = replayer.isDefined - private def add(allowSync: Boolean, item: QItem): Unit = { + private def add(allowSync: Boolean, item: QItem) { val blob = ByteBuffer.wrap(item.pack()) size += write(false, CMD_ADDX.toByte, blob.limit) do { @@ -136,7 +136,7 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { size += write(true, CMD_REMOVE.toByte) } - private def removeTentative(allowSync: Boolean): Unit = { + private def removeTentative(allowSync: Boolean) { size += write(allowSync, CMD_REMOVE_TENTATIVE.toByte) } @@ -155,14 +155,14 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { size += write(true, CMD_CONFIRM_REMOVE.toByte, xid) } - def startReadBehind(): Unit = { + def startReadBehind() { val pos = if (replayer.isDefined) replayer.get.position else writer.position val rj = new FileInputStream(queueFile).getChannel rj.position(pos) reader = Some(rj) } - def fillReadBehind(f: QItem ⇒ Unit): Unit = { + def fillReadBehind(f: QItem ⇒ Unit) { val pos = if (replayer.isDefined) replayer.get.position else writer.position for (rj ← reader) { if (rj.position == pos) { @@ -178,7 +178,7 @@ class Journal(queuePath: String, syncJournal: ⇒ Boolean) { } } - def replay(name: String)(f: JournalItem ⇒ Unit): Unit = { + def replay(name: String)(f: JournalItem ⇒ Unit) { size = 0 var lastUpdate = 0L val TEN_MB = 10L * 1024 * 1024 diff --git a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/PersistentQueue.scala b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/PersistentQueue.scala index 3bc24e48d0..d5d7043791 100644 --- a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/PersistentQueue.scala +++ b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/PersistentQueue.scala @@ -270,7 +270,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con * Return a transactionally-removed item to the queue. This is a rolled- * back transaction. */ - def unremove(xid: Int): Unit = { + def unremove(xid: Int) { synchronized { if (!closed) { if (keepJournal()) journal.unremove(xid) @@ -279,7 +279,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con } } - def confirmRemove(xid: Int): Unit = { + def confirmRemove(xid: Int) { synchronized { if (!closed) { if (keepJournal()) journal.confirmRemove(xid) @@ -288,7 +288,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con } } - def flush(): Unit = { + def flush() { while (remove(false).isDefined) {} } @@ -324,7 +324,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con xidCounter } - private final def fillReadBehind(): Unit = { + private final def fillReadBehind() { // if we're in read-behind mode, scan forward in the journal to keep memory as full as // possible. this amortizes the disk overhead across all reads. while (keepJournal() && journal.inReadBehind && _memoryBytes < maxMemorySize()) { @@ -338,7 +338,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con } } - def replayJournal(): Unit = { + def replayJournal() { if (!keepJournal()) return EventHandler.debug(this, "Replaying transaction journal for '%s'".format(name)) @@ -380,7 +380,7 @@ class PersistentQueue(persistencePath: String, val name: String, val config: Con // ----- internal implementations - private def _add(item: QItem): Unit = { + private def _add(item: QItem) { discardExpired if (!journal.inReadBehind) { queue += item diff --git a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/QueueCollection.scala b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/QueueCollection.scala index 36ce3c6d8d..0947cf5b45 100644 --- a/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/QueueCollection.scala +++ b/akka-durable-mailboxes/akka-file-mailbox/src/main/scala/akka/actor/mailbox/filequeue/QueueCollection.scala @@ -127,7 +127,7 @@ class QueueCollection(queueFolder: String, private var queueConfigs: Configurati * Retrieve an item from a queue and pass it to a continuation. If no item is available within * the requested time, or the server is shutting down, None is passed. */ - def remove(key: String, timeout: Int, transaction: Boolean, peek: Boolean)(f: Option[QItem] ⇒ Unit): Unit = { + def remove(key: String, timeout: Int, transaction: Boolean, peek: Boolean)(f: Option[QItem] ⇒ Unit) { queue(key) match { case None ⇒ queueMisses.incr diff --git a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala index 4d653b557d..af7ab12983 100644 --- a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala +++ b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala @@ -90,7 +90,7 @@ case class DurableDispatcher( override def createMailbox(actorRef: LocalActorRef): AnyRef = _storage.createFor(actorRef) - protected[akka] override def dispatch(invocation: MessageInvocation): Unit = { + protected[akka] override def dispatch(invocation: MessageInvocation) { if (invocation.channel.isInstanceOf[ActorPromise]) throw new IllegalArgumentException("Durable mailboxes do not support Future-based messages from ?") super.dispatch(invocation) @@ -125,7 +125,7 @@ case class DurablePinnedDispatcher( override def createMailbox(actorRef: LocalActorRef): AnyRef = _storage.createFor(actorRef) - protected[akka] override def dispatch(invocation: MessageInvocation): Unit = { + protected[akka] override def dispatch(invocation: MessageInvocation) { if (invocation.channel.isInstanceOf[ActorPromise]) throw new IllegalArgumentException("Actor has a durable mailbox that does not support ?") super.dispatch(invocation) diff --git a/akka-kernel/src/main/scala/akka/kernel/EmbeddedAppServer.scala b/akka-kernel/src/main/scala/akka/kernel/EmbeddedAppServer.scala index b3a26f3936..84d0006ea6 100644 --- a/akka-kernel/src/main/scala/akka/kernel/EmbeddedAppServer.scala +++ b/akka-kernel/src/main/scala/akka/kernel/EmbeddedAppServer.scala @@ -50,7 +50,7 @@ trait EmbeddedAppServer extends Bootable { server = Option(configuration.configure.asInstanceOf[Server]) map { s ⇒ //Set the correct classloader to our contexts applicationLoader foreach { loader ⇒ //We need to provide the correct classloader to the servlets - def setClassLoader(handlers: Seq[Handler]): Unit = { + def setClassLoader(handlers: Seq[Handler]) { handlers foreach { case c: ContextHandler ⇒ c.setClassLoader(loader) case c: HandlerCollection ⇒ setClassLoader(c.getHandlers) diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 860bca8439..809adb5c62 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -60,6 +60,7 @@ class RemoteActorRefProvider extends ActorRefProvider { } case deploy ⇒ None // non-remote actor + } } catch { case e: Exception ⇒ newFuture completeWithException e // so the other threads gets notified of error diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index d5d51ea428..888291e9cc 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -812,7 +812,7 @@ trait NettyRemoteServerModule extends RemoteServerModule { *

* NOTE: You need to call this method if you have registered an actor by a custom ID. */ - def unregisterPerSession(id: String): Unit = { + def unregisterPerSession(id: String) { if (_isRunning.isOn) { EventHandler.info(this, "Unregistering server side remote actor with id [%s]".format(id)) @@ -890,10 +890,10 @@ class RemoteServerHandler( val sessionActors = new ChannelLocal[ConcurrentHashMap[String, ActorRef]]() //Writes the specified message to the specified channel and propagates write errors to listeners - private def write(channel: Channel, payload: AkkaRemoteProtocol): Unit = { + private def write(channel: Channel, payload: AkkaRemoteProtocol) { channel.write(payload).addListener( new ChannelFutureListener { - def operationComplete(future: ChannelFuture): Unit = { + def operationComplete(future: ChannelFuture) { if (future.isCancelled) { //Not interesting at the moment } else if (!future.isSuccess) { diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/MultiJvmSync.scala b/akka-remote/src/multi-jvm/scala/akka/remote/MultiJvmSync.scala index eb157d4898..26c10b4ea4 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/MultiJvmSync.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/MultiJvmSync.scala @@ -18,14 +18,14 @@ trait MultiJvmSync extends WordSpec with MustMatchers with BeforeAndAfterAll { MultiJvmSync.start(getClass.getName, nodes) } - def onStart(): Unit = {} + def onStart() {} override def afterAll() = { MultiJvmSync.end(getClass.getName, nodes) onEnd() } - def onEnd(): Unit = {} + def onEnd() {} def barrier(name: String, timeout: Duration = FileBasedBarrier.DefaultTimeout) = { MultiJvmSync.barrier(name, nodes, getClass.getName, timeout) diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/QuietReporter.scala b/akka-remote/src/multi-jvm/scala/akka/remote/QuietReporter.scala index 005b423b04..f69b7908bd 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/QuietReporter.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/QuietReporter.scala @@ -16,5 +16,5 @@ class QuietReporter(inColor: Boolean) extends StandardOutReporter(false, inColor case _ ⇒ super.apply(event) } - override def makeFinalReport(resourceName: String, duration: Option[Long], summaryOption: Option[Summary]): Unit = {} + override def makeFinalReport(resourceName: String, duration: Option[Long], summaryOption: Option[Summary]) {} } diff --git a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala index a1e15b01b3..5a19bf5cdf 100644 --- a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala +++ b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala @@ -45,7 +45,7 @@ class HttpConcurrencyTestStress extends JUnitSuite { object HttpConcurrencyTestStress { @BeforeClass - def beforeClass: Unit = { + def beforeClass{ startCamelService val workers = for (i ← 1 to 8) yield actorOf[HttpServerWorker] diff --git a/akka-spring/src/test/scala/ScalaDom.scala b/akka-spring/src/test/scala/ScalaDom.scala index a479bdf104..45dc940e55 100644 --- a/akka-spring/src/test/scala/ScalaDom.scala +++ b/akka-spring/src/test/scala/ScalaDom.scala @@ -16,7 +16,7 @@ object ScalaDom { .getDOMImplementation .createDocument(null, null, null) - def build(node: Node, parent: JNode): Unit = { + def build(node: Node, parent: JNode) { val jnode: JNode = node match { case e: Elem ⇒ { val jn = doc.createElement(e.label) diff --git a/akka-stm/src/main/scala/akka/agent/Agent.scala b/akka-stm/src/main/scala/akka/agent/Agent.scala index 37598b49ab..c279cba8e5 100644 --- a/akka-stm/src/main/scala/akka/agent/Agent.scala +++ b/akka-stm/src/main/scala/akka/agent/Agent.scala @@ -110,7 +110,7 @@ class Agent[T](initialValue: T) { /** * Dispatch a function to update the internal state. */ - def send(f: T ⇒ T): Unit = { + def send(f: T ⇒ T) { def dispatch = updater ! Update(f) if (Stm.activeTransaction) { get; deferred(dispatch) } else dispatch diff --git a/akka-stm/src/main/scala/akka/transactor/UntypedTransactor.scala b/akka-stm/src/main/scala/akka/transactor/UntypedTransactor.scala index 39a29c24b8..e299bdd1c1 100644 --- a/akka-stm/src/main/scala/akka/transactor/UntypedTransactor.scala +++ b/akka-stm/src/main/scala/akka/transactor/UntypedTransactor.scala @@ -26,7 +26,7 @@ abstract class UntypedTransactor extends UntypedActor { * Implement a general pattern for using coordinated transactions. */ @throws(classOf[Exception]) - final def onReceive(message: Any): Unit = { + final def onReceive(message: Any) { message match { case coordinated @ Coordinated(message) ⇒ { val others = coordinate(message) @@ -87,19 +87,19 @@ abstract class UntypedTransactor extends UntypedActor { * A Receive block that runs before the coordinated transaction is entered. */ @throws(classOf[Exception]) - def before(message: Any): Unit = {} + def before(message: Any) {} /** * The Receive block to run inside the coordinated transaction. */ @throws(classOf[Exception]) - def atomically(message: Any): Unit = {} + def atomically(message: Any) {} /** * A Receive block that runs after the coordinated transaction. */ @throws(classOf[Exception]) - def after(message: Any): Unit = {} + def after(message: Any) {} /** * Bypass transactionality and behave like a normal actor. diff --git a/akka-testkit/src/main/scala/akka/testkit/TestBarrier.scala b/akka-testkit/src/main/scala/akka/testkit/TestBarrier.scala index 98fd94a57a..4c6c59f5f5 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestBarrier.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestBarrier.scala @@ -26,7 +26,7 @@ class TestBarrier(count: Int) { def await(): Unit = await(TestBarrier.DefaultTimeout) - def await(timeout: Duration): Unit = { + def await(timeout: Duration) { try { barrier.await(Testing.testTime(timeout.toNanos), TimeUnit.NANOSECONDS) } catch { diff --git a/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala b/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala index 49481d723f..23109d2bee 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala @@ -96,7 +96,7 @@ class TestEventListener extends EventHandler.DefaultListener { def addFilter(filter: EventFilter): Unit = filters ::= filter - def removeFilter(filter: EventFilter): Unit = { + def removeFilter(filter: EventFilter) { @scala.annotation.tailrec def removeFirst(list: List[EventFilter], zipped: List[EventFilter] = Nil): List[EventFilter] = list match { case head :: tail if head == filter ⇒ tail.reverse_:::(zipped) diff --git a/project/sbt7/build/AkkaProject.scala b/project/sbt7/build/AkkaProject.scala index dfaadf6dc0..2a38c2ab22 100644 --- a/project/sbt7/build/AkkaProject.scala +++ b/project/sbt7/build/AkkaProject.scala @@ -560,7 +560,7 @@ class AkkaParentProject(info: ProjectInfo) extends ParentProject(info) with Exec case s if s.startsWith("akka-") => Iterator.single(s.drop(5)) case _ => Iterator.empty } - val (repos, configs) = (project.moduleConfigurations ++ extraConfigs).foldLeft((Set.empty[String], Set.empty[String])){ + val (repos, configs) = (project.moduleConfigurations ++ extraConfigs).foldLeft((Set.empty[String], Set.empty[String])) { case ((repos, configs), ModuleConfiguration(org, name, ver, MavenRepository(repoName, repoPath))) => val repoId = repoName.replaceAll("""[^a-zA-Z]""", "_") val configId = org.replaceAll("""[^a-zA-Z]""", "_") + diff --git a/project/sbt7/build/MultiJvmTests.scala b/project/sbt7/build/MultiJvmTests.scala index 46d3956d62..7f6b1ca2bf 100644 --- a/project/sbt7/build/MultiJvmTests.scala +++ b/project/sbt7/build/MultiJvmTests.scala @@ -249,7 +249,7 @@ object JvmIO { def ignoreOutputStream = (out: OutputStream) => () - def transfer(in: InputStream, out: OutputStream): Unit = { + def transfer(in: InputStream, out: OutputStream) { try { val buffer = new Array[Byte](BufferSize) def read {