Style of void methods
It is described in section 4.1.2 “Void” Method of style guide
http://davetron5000.github.com/scala-style/ScalaStyleGuide.pdf
In akka we have a lot that is not using that convention. Examples:
def sendOneWay(message: AnyRef): Unit = {
def shutdown(): Unit = supervisor.stop()
def boot(withBanner: Boolean, b: Bootable): Unit = hasBooted switchOn {
def parseArgs(args: List[String]): Unit = args match {
http://davetron5000.github.com/scala-style/ScalaStyleGuide.pdf
In akka we have a lot that is not using that convention. Examples:
def sendOneWay(message: AnyRef): Unit = {
def shutdown(): Unit = supervisor.stop()
def boot(withBanner: Boolean, b: Bootable): Unit = hasBooted switchOn {
def parseArgs(args: List[String]): Unit = args match {
Leave a comment
After some discussion with Jonas, Viktor, Heiko and Martin we decided to not go with the style guide for this. We stick to explicit : Unit declaration, and also encourage usage of explicit return type on public (user facing) api, to avoid api changes by mistake changing last line.
Updating tickets (#1129, #1132, #1138, #1149, #1153, #1154, #1157, #1161, #1163, #1168, #1170, #1171, #1172, #1176, #1177, #1178, #1180, #1199, #1217, #1218, #1219, #1237, #1238, #1239, #1244, #1246, #1249, #1250, #1251, #1252, #1256, #1301, #1302, #1306, #1395, #1396, #1409, #1418, #455, #891, #895, #912, #956, #972, #1031, #1374, #880, #1125, #1146)