mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 19:45:57 +01:00
add -Xfuture option. fix warnings
view bounds and procedure syntax are deprecated
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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://"))) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user