Skip to content

Commit

Permalink
Added parentheses to methods with side effects
Browse files Browse the repository at this point in the history
When there are side effects, it should be distinguished
by giving parentheses to the method.
  • Loading branch information
magnolia-k committed Aug 11, 2018
1 parent 9677cb5 commit 58393a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -21,7 +21,7 @@ object ScalatraBroadcasterFactory {
this.cfg = Some(cfg)
}

def clearDefaults = {
def clearDefaults() = {
broadcasterFactory = None
cfg = None
}
Expand Down
4 changes: 2 additions & 2 deletions auth/src/main/scala/org/scalatra/auth/ScentrySupport.scala
Expand Up @@ -28,7 +28,7 @@ trait ScentrySupport[UserType <: AnyRef] extends Initializable {
readStrategiesFromConfig(config)
}

private def initializeScentry = {
private def initializeScentry() = {
val store = new ScentryAuthStore.SessionAuthStore(this)
request.setAttribute(Scentry.ScentryRequestKey, new Scentry[UserType](self, toSession, fromSession, store))
}
Expand All @@ -38,7 +38,7 @@ trait ScentrySupport[UserType <: AnyRef] extends Initializable {
config.context.getInitParameter("scentry.strategies").blankOption map (s (s split ";").toList) getOrElse Nil
}

private def registerStrategiesFromConfig = _strategiesFromConfig foreach { strategyClassName
private def registerStrategiesFromConfig() = _strategiesFromConfig foreach { strategyClassName
val strategy = Class.forName(strategyClassName).getDeclaredConstructor().newInstance().asInstanceOf[ScentryStrategy[UserType]]
strategy registerWith scentry
}
Expand Down

0 comments on commit 58393a9

Please sign in to comment.