From c5d9b7e6a99f253d6da941610c58d9d9e1a02925 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 28 Apr 2011 16:26:05 +0000 Subject: I wrote a warning when nullary methods return U... I wrote a warning when nullary methods return Unit. I wimped out of including it in this patch because we had about 200 of them, and that's what is fixed in this patch. I will add the warning to some kind of "-Xlint" feature after 2.9. This is motivated at least partly by the resolution of #4506, which indicates the distinction between "def foo()" and "def foo" will continue to jab its pointy stick into our eyes, so I believe we have a minimal duty of at least following our own advice about what they mean and not making a semirandom choice as to whether a method has parens or not. Review by community. --- src/actors/scala/actors/Actor.scala | 4 ++-- src/actors/scala/actors/Combinators.scala | 2 +- src/actors/scala/actors/IScheduler.scala | 2 +- src/actors/scala/actors/remote/TcpService.scala | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/actors') diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 059ab3abf7..25cfbf7865 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -95,7 +95,7 @@ object Actor extends Combinators { * This permits to re-use the current thread as an actor * even if its ActorProxy has died for some reason. */ - def resetProxy { + def resetProxy() { val a = tl.get if ((null ne a) && a.isInstanceOf[ActorProxy]) tl.set(new ActorProxy(Thread.currentThread, parentScheduler)) @@ -110,7 +110,7 @@ object Actor extends Combinators { * a thread pool). Permanent references in thread-local storage * are a potential memory leak. */ - def clearSelf { + def clearSelf() { tl.set(null) } diff --git a/src/actors/scala/actors/Combinators.scala b/src/actors/scala/actors/Combinators.scala index 9d63af61f9..5276c7843e 100644 --- a/src/actors/scala/actors/Combinators.scala +++ b/src/actors/scala/actors/Combinators.scala @@ -41,6 +41,6 @@ private[actors] trait Combinators { * of the next loop iteration when invoked inside the body of `loop` * or `loopWhile`. */ - def continue: Unit = throw new KillActorControl + def continue(): Unit = throw new KillActorControl } diff --git a/src/actors/scala/actors/IScheduler.scala b/src/actors/scala/actors/IScheduler.scala index 865ead58a0..2bb90a5fa7 100644 --- a/src/actors/scala/actors/IScheduler.scala +++ b/src/actors/scala/actors/IScheduler.scala @@ -77,6 +77,6 @@ trait IScheduler { def onLockup(millis: Int)(handler: () => Unit) {} @deprecated("this member is going to be removed in a future release", "2.7.7") - def printActorDump {} + def printActorDump() {} } diff --git a/src/actors/scala/actors/remote/TcpService.scala b/src/actors/scala/actors/remote/TcpService.scala index b310478457..d156443fcb 100644 --- a/src/actors/scala/actors/remote/TcpService.scala +++ b/src/actors/scala/actors/remote/TcpService.scala @@ -222,7 +222,7 @@ private[actors] class TcpServiceWorker(parent: TcpService, so: Socket) extends T parent.serializer.writeObject(dataout, parent.node) } - def readNode { + def readNode() { val node = parent.serializer.readObject(datain) node match { case n: Node => @@ -240,7 +240,7 @@ private[actors] class TcpServiceWorker(parent: TcpService, so: Socket) extends T var running = true - def halt = synchronized { + def halt() = synchronized { so.close() running = false } -- cgit v1.2.3