add -Xfuture option. fix warnings

view bounds and procedure syntax are deprecated
This commit is contained in:
xuwei-k
2018-04-01 22:43:47 +09:00
parent 4f92739d73
commit ac6fbd0bfa
7 changed files with 9 additions and 9 deletions

View File

@@ -72,7 +72,7 @@ libraryDependencies ++= Seq(
)
// Compiler settings
scalacOptions := Seq("-deprecation", "-language:postfixOps", "-opt:l:method")
scalacOptions := Seq("-deprecation", "-language:postfixOps", "-opt:l:method", "-Xfuture")
javacOptions in compile ++= Seq("-target", "8", "-source", "8")
javaOptions in Jetty += "-Dlogback.configurationFile=/logback-dev.xml"

View File

@@ -18,7 +18,7 @@ object Checksums {
val buf = new Array[Byte](bufferSize)
md.reset()
@tailrec
def loop() {
def loop(): Unit = {
val len = is read buf
if (len != -1) {
md update (buf, 0, len)

View File

@@ -9,7 +9,7 @@ import gitbucket.core.util.Directory
import org.scalatra._
class ScalatraBootstrap extends LifeCycle with SystemSettingsService {
override def init(context: ServletContext) {
override def init(context: ServletContext): Unit = {
val settings = loadSystemSettings()
if (settings.baseUrl.exists(_.startsWith("https://"))) {

View File

@@ -71,7 +71,7 @@ trait MergeService {
requestRepositoryName: String,
requestBranch: String,
issueId: Int
) {
): Unit = {
using(Git.open(getRepositoryDir(userName, repositoryName))) { git =>
git.fetch
.setRemote(getRepositoryDir(requestUserName, requestRepositoryName).toURI.toString)
@@ -246,7 +246,7 @@ object MergeService {
val mergeTipCommit = using(new RevWalk(repository))(_.parseCommit(mergeTip))
val committer = mergeTipCommit.getCommitterIdent
def _updateBranch(treeId: ObjectId, message: String, branchName: String) {
def _updateBranch(treeId: ObjectId, message: String, branchName: String): Unit = {
// creates merge commit
val mergeCommitId = createMergeCommit(treeId, committer, message)
Util.updateRefs(repository, branchName, mergeCommitId, true, committer)

View File

@@ -79,7 +79,7 @@ abstract class GitCommand extends Command with SessionAware {
this.in = in
}
override def setSession(serverSession: ServerSession) {
override def setSession(serverSession: ServerSession): Unit = {
this.authType = PublicKeyAuthenticator.getAuthType(serverSession)
}

View File

@@ -11,7 +11,7 @@ object SyntaxSugars {
def defining[A, B](value: A)(f: A => B): B = f(value)
def using[A <% { def close(): Unit }, B](resource: A)(f: A => B): B =
def using[A <: { def close(): Unit }, B](resource: A)(f: A => B): B =
try f(resource)
finally {
if (resource != null) {
@@ -21,7 +21,7 @@ object SyntaxSugars {
}
}
def using[A <% { def close(): Unit }, B <% { def close(): Unit }, C](resource1: A, resource2: B)(f: (A, B) => C): C =
def using[A <: { def close(): Unit }, B <: { def close(): Unit }, C](resource1: A, resource2: B)(f: (A, B) => C): C =
try f(resource1, resource2)
finally {
if (resource1 != null) {

View File

@@ -42,7 +42,7 @@ object GitSpecUtil {
autorName: String = "dummy",
autorEmail: String = "dummy@example.com",
message: String = "test commit"
) {
): Unit = {
val builder = DirCache.newInCore.builder()
val inserter = git.getRepository.newObjectInserter()
val headId = git.getRepository.resolve(branch + "^{commit}")