diff --git a/project/build.scala b/project/build.scala index df7b368..8e33829 100644 --- a/project/build.scala +++ b/project/build.scala @@ -1,8 +1,6 @@ import sbt._ import Keys._ import org.scalatra.sbt._ -import org.scalatra.sbt.PluginKeys._ -import sbt.ScalaVersion import twirl.sbt.TwirlPlugin._ import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys @@ -25,7 +23,7 @@ Classpaths.typesafeReleases, "amateras-repo" at "http://amateras.sourceforge.jp/mvn/" ), - scalacOptions := Seq("-deprecation"), + scalacOptions := Seq("-deprecation", "-language:postfixOps"), libraryDependencies ++= Seq( "org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "3.0.0.201306101825-r", "org.scalatra" %% "scalatra" % ScalatraVersion, @@ -43,7 +41,7 @@ "com.h2database" % "h2" % "1.3.173", "ch.qos.logback" % "logback-classic" % "1.0.13" % "runtime", "org.eclipse.jetty" % "jetty-webapp" % "8.1.8.v20121106" % "container;provided", - "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")), + "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;provided;test" artifacts Artifact("javax.servlet", "jar", "jar"), "junit" % "junit" % "4.11" % "test" ), EclipseKeys.withSource := true, diff --git a/src/main/scala/util/ControlUtil.scala b/src/main/scala/util/ControlUtil.scala index 3e3fd5e..17958c1 100644 --- a/src/main/scala/util/ControlUtil.scala +++ b/src/main/scala/util/ControlUtil.scala @@ -4,6 +4,7 @@ import org.eclipse.jgit.revwalk.RevWalk import org.eclipse.jgit.treewalk.TreeWalk import org.eclipse.jgit.transport.RefSpec +import scala.language.reflectiveCalls /** * Provides control facilities. @@ -24,12 +25,12 @@ } def using[T](git: Git)(f: Git => T): T = - try f(git) finally git.getRepository.close + try f(git) finally git.getRepository.close() def using[T](git1: Git, git2: Git)(f: (Git, Git) => T): T = try f(git1, git2) finally { - git1.getRepository.close - git2.getRepository.close + git1.getRepository.close() + git2.getRepository.close() } def using[T](revWalk: RevWalk)(f: RevWalk => T): T =