From 601f8c42490fba8487c93c256843b99fcecdc9b5 Mon Sep 17 00:00:00 2001 From: shimamoto Date: Sun, 3 Aug 2014 18:41:03 +0900 Subject: [PATCH] (refs #374) Fix compile error. --- src/main/scala/model/BasicTemplate.scala | 16 ++++++++-------- src/main/scala/model/Collaborator.scala | 2 +- src/main/scala/model/IssueComment.scala | 2 +- src/main/scala/model/IssueLabels.scala | 2 +- src/main/scala/model/SshKey.scala | 2 +- src/main/scala/model/WebHook.scala | 2 +- src/main/scala/service/AccountService.scala | 4 ++-- src/main/scala/service/IssuesService.scala | 2 +- src/main/scala/service/MilestonesService.scala | 2 +- src/main/scala/service/RepositoryService.scala | 2 +- src/main/scala/service/WebHookService.scala | 2 +- src/main/scala/util/Notifier.scala | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/scala/model/BasicTemplate.scala b/src/main/scala/model/BasicTemplate.scala index e0460a911..6266ebca9 100644 --- a/src/main/scala/model/BasicTemplate.scala +++ b/src/main/scala/model/BasicTemplate.scala @@ -8,40 +8,40 @@ protected[model] trait TemplateComponent { self: Profile => val repositoryName = column[String]("REPOSITORY_NAME") def byRepository(owner: String, repository: String) = - (userName is owner.bind) && (repositoryName is repository.bind) + (userName === owner.bind) && (repositoryName === repository.bind) def byRepository(userName: Column[String], repositoryName: Column[String]) = - (this.userName is userName) && (this.repositoryName is repositoryName) + (this.userName === userName) && (this.repositoryName === repositoryName) } trait IssueTemplate extends BasicTemplate { self: Table[_] => val issueId = column[Int]("ISSUE_ID") def byIssue(owner: String, repository: String, issueId: Int) = - byRepository(owner, repository) && (this.issueId is issueId.bind) + byRepository(owner, repository) && (this.issueId === issueId.bind) def byIssue(userName: Column[String], repositoryName: Column[String], issueId: Column[Int]) = - byRepository(userName, repositoryName) && (this.issueId is issueId) + byRepository(userName, repositoryName) && (this.issueId === issueId) } trait LabelTemplate extends BasicTemplate { self: Table[_] => val labelId = column[Int]("LABEL_ID") def byLabel(owner: String, repository: String, labelId: Int) = - byRepository(owner, repository) && (this.labelId is labelId.bind) + byRepository(owner, repository) && (this.labelId === labelId.bind) def byLabel(userName: Column[String], repositoryName: Column[String], labelId: Column[Int]) = - byRepository(userName, repositoryName) && (this.labelId is labelId) + byRepository(userName, repositoryName) && (this.labelId === labelId) } trait MilestoneTemplate extends BasicTemplate { self: Table[_] => val milestoneId = column[Int]("MILESTONE_ID") def byMilestone(owner: String, repository: String, milestoneId: Int) = - byRepository(owner, repository) && (this.milestoneId is milestoneId.bind) + byRepository(owner, repository) && (this.milestoneId === milestoneId.bind) def byMilestone(userName: Column[String], repositoryName: Column[String], milestoneId: Column[Int]) = - byRepository(userName, repositoryName) && (this.milestoneId is milestoneId) + byRepository(userName, repositoryName) && (this.milestoneId === milestoneId) } } diff --git a/src/main/scala/model/Collaborator.scala b/src/main/scala/model/Collaborator.scala index 1b96872fc..88311e188 100644 --- a/src/main/scala/model/Collaborator.scala +++ b/src/main/scala/model/Collaborator.scala @@ -10,7 +10,7 @@ trait CollaboratorComponent extends TemplateComponent { self: Profile => def * = (userName, repositoryName, collaboratorName) <> (Collaborator.tupled, Collaborator.unapply) def byPrimaryKey(owner: String, repository: String, collaborator: String) = - byRepository(owner, repository) && (collaboratorName is collaborator.bind) + byRepository(owner, repository) && (collaboratorName === collaborator.bind) } } diff --git a/src/main/scala/model/IssueComment.scala b/src/main/scala/model/IssueComment.scala index 8d5e2be71..4c8ca6e9f 100644 --- a/src/main/scala/model/IssueComment.scala +++ b/src/main/scala/model/IssueComment.scala @@ -17,7 +17,7 @@ trait IssueCommentComponent extends TemplateComponent { self: Profile => val updatedDate = column[java.util.Date]("UPDATED_DATE") def * = (userName, repositoryName, issueId, commentId, action, commentedUserName, content, registeredDate, updatedDate) <> (IssueComment.tupled, IssueComment.unapply) - def byPrimaryKey(commentId: Int) = this.commentId is commentId.bind + def byPrimaryKey(commentId: Int) = this.commentId === commentId.bind } } diff --git a/src/main/scala/model/IssueLabels.scala b/src/main/scala/model/IssueLabels.scala index d6b83c16b..5d422728a 100644 --- a/src/main/scala/model/IssueLabels.scala +++ b/src/main/scala/model/IssueLabels.scala @@ -8,7 +8,7 @@ trait IssueLabelComponent extends TemplateComponent { self: Profile => class IssueLabels(tag: Tag) extends Table[IssueLabel](tag, "ISSUE_LABEL") with IssueTemplate with LabelTemplate { def * = (userName, repositoryName, issueId, labelId) <> (IssueLabel.tupled, IssueLabel.unapply) def byPrimaryKey(owner: String, repository: String, issueId: Int, labelId: Int) = - byIssue(owner, repository, issueId) && (this.labelId is labelId.bind) + byIssue(owner, repository, issueId) && (this.labelId === labelId.bind) } } diff --git a/src/main/scala/model/SshKey.scala b/src/main/scala/model/SshKey.scala index d1d0aab5d..dcf346384 100644 --- a/src/main/scala/model/SshKey.scala +++ b/src/main/scala/model/SshKey.scala @@ -12,7 +12,7 @@ trait SshKeyComponent { self: Profile => val publicKey = column[String]("PUBLIC_KEY") def * = (userName, sshKeyId, title, publicKey) <> (SshKey.tupled, SshKey.unapply) - def byPrimaryKey(userName: String, sshKeyId: Int) = (this.userName is userName.bind) && (this.sshKeyId is sshKeyId.bind) + def byPrimaryKey(userName: String, sshKeyId: Int) = (this.userName === userName.bind) && (this.sshKeyId === sshKeyId.bind) } } diff --git a/src/main/scala/model/WebHook.scala b/src/main/scala/model/WebHook.scala index 8eb3719e1..4c13c8787 100644 --- a/src/main/scala/model/WebHook.scala +++ b/src/main/scala/model/WebHook.scala @@ -9,7 +9,7 @@ trait WebHookComponent extends TemplateComponent { self: Profile => val url = column[String]("URL") def * = (userName, repositoryName, url) <> (WebHook.tupled, WebHook.unapply) - def byPrimaryKey(owner: String, repository: String, url: String) = byRepository(owner, repository) && (this.url is url.bind) + def byPrimaryKey(owner: String, repository: String, url: String) = byRepository(owner, repository) && (this.url === url.bind) } } diff --git a/src/main/scala/service/AccountService.scala b/src/main/scala/service/AccountService.scala index d7e4eb774..b815c5411 100644 --- a/src/main/scala/service/AccountService.scala +++ b/src/main/scala/service/AccountService.scala @@ -75,10 +75,10 @@ trait AccountService { } def getAccountByUserName(userName: String, includeRemoved: Boolean = false)(implicit s: Session): Option[Account] = - Accounts filter(t => (t.userName === userName.bind) && (t.removed is false.bind, !includeRemoved)) firstOption + Accounts filter(t => (t.userName === userName.bind) && (t.removed === false.bind, !includeRemoved)) firstOption def getAccountByMailAddress(mailAddress: String, includeRemoved: Boolean = false)(implicit s: Session): Option[Account] = - Accounts filter(t => (t.mailAddress.toLowerCase === mailAddress.toLowerCase.bind) && (t.removed is false.bind, !includeRemoved)) firstOption + Accounts filter(t => (t.mailAddress.toLowerCase === mailAddress.toLowerCase.bind) && (t.removed === false.bind, !includeRemoved)) firstOption def getAllUsers(includeRemoved: Boolean = true)(implicit s: Session): List[Account] = if(includeRemoved){ diff --git a/src/main/scala/service/IssuesService.scala b/src/main/scala/service/IssuesService.scala index 55b60fb6c..292b93ae0 100644 --- a/src/main/scala/service/IssuesService.scala +++ b/src/main/scala/service/IssuesService.scala @@ -168,7 +168,7 @@ trait IssuesService { .foldLeft[Column[Boolean]](false) ( _ || _ ) && (t1.closed === (condition.state == "closed").bind) && (t1.milestoneId === condition.milestoneId.get.get.bind, condition.milestoneId.flatten.isDefined) && - (t1.milestoneId isEmpty, condition.milestoneId == Some(None)) && + (t1.milestoneId.? isEmpty, condition.milestoneId == Some(None)) && (t1.assignedUserName === filterUser("assigned").bind, filterUser.get("assigned").isDefined) && (t1.openedUserName === filterUser("created_by").bind, filterUser.get("created_by").isDefined) && (t1.openedUserName =!= filterUser("not_created_by").bind, filterUser.get("not_created_by").isDefined) && diff --git a/src/main/scala/service/MilestonesService.scala b/src/main/scala/service/MilestonesService.scala index e9b27becd..476e0c4bf 100644 --- a/src/main/scala/service/MilestonesService.scala +++ b/src/main/scala/service/MilestonesService.scala @@ -41,7 +41,7 @@ trait MilestonesService { def getMilestonesWithIssueCount(owner: String, repository: String)(implicit s: Session): List[(Milestone, Int, Int)] = { val counts = Issues - .filter { t => (t.byRepository(owner, repository)) && (t.milestoneId isNotNull) } + .filter { t => (t.byRepository(owner, repository)) && (t.milestoneId.? isDefined) } .groupBy { t => t.milestoneId -> t.closed } .map { case (t1, t2) => t1._1 -> t1._2 -> t2.length } .toMap diff --git a/src/main/scala/service/RepositoryService.scala b/src/main/scala/service/RepositoryService.scala index 9e340fe9a..8e204a867 100644 --- a/src/main/scala/service/RepositoryService.scala +++ b/src/main/scala/service/RepositoryService.scala @@ -102,7 +102,7 @@ trait RepositoryService { self: AccountService => }.map { t => t.activityId -> t.message }.list updateActivities.foreach { case (activityId, message) => - Activities.filter(_.activityId is activityId.bind).map(_.message).update( + Activities.filter(_.activityId === activityId.bind).map(_.message).update( message .replace(s"[repo:${oldUserName}/${oldRepositoryName}]" ,s"[repo:${newUserName}/${newRepositoryName}]") .replace(s"[branch:${oldUserName}/${oldRepositoryName}#" ,s"[branch:${newUserName}/${newRepositoryName}#") diff --git a/src/main/scala/service/WebHookService.scala b/src/main/scala/service/WebHookService.scala index 9f3f11ed9..20130174b 100644 --- a/src/main/scala/service/WebHookService.scala +++ b/src/main/scala/service/WebHookService.scala @@ -44,7 +44,7 @@ trait WebHookService { val httpClient = HttpClientBuilder.create.build webHookURLs.foreach { webHookUrl => - val f = future { + val f = Future { logger.debug(s"start web hook invocation for ${webHookUrl}") val httpPost = new HttpPost(webHookUrl.url) diff --git a/src/main/scala/util/Notifier.scala b/src/main/scala/util/Notifier.scala index ae6e25ceb..95ec6bf2f 100644 --- a/src/main/scala/util/Notifier.scala +++ b/src/main/scala/util/Notifier.scala @@ -69,7 +69,7 @@ class Mailer(private val smtp: Smtp) extends Notifier { (msg: String => String)(implicit context: Context) = { val database = Database(context.request.getServletContext) - val f = future { + val f = Future { database withSession { implicit session => getIssue(r.owner, r.name, issueId.toString) foreach { issue => defining(