채수원 2015-01-07
Merge branch 'upgrade/play-2.3' of dlab/hive
from pull-request 1377

* refs/heads/upgrade/play-2.3:
  Upgrade Play from 2.2.6 to 2.3.6
  ProjectApp: Fix the incorrect status code for label
  test: Fix url encoding bug
  test: Fix RuntimeExceptions
  Upgrade Play from 2.1.0 to 2.2.6

Reviewed-by: 이희구 
@94fa59f93b5593a7a747c206344b38e12b76eddf
README.md
--- README.md
+++ README.md
@@ -31,25 +31,25 @@
 
 JDK version 7(1.7) is required.
 
-### Download playframework
+### Download Play Activator
 
-    curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 or
 
-    wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 or using web browser (for windows)
 
-    http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 ### Unzip
 
-    unzip play-2.1.0.zip
+    unzip typesafe-activator-1.2.10-minimal.zip
 
 ### Change directory to unzipped directory
 
-    cd play-2.1.0
+    cd typesafe-activator-1.2.10-minimal
 
 ### Download Yobi
 
@@ -66,19 +66,19 @@
     
 **Caution! in case2, You might come across troubles when you try to upgrade Yobi.**
 
-> You can locate your own Yobi directory in any other place. Please note that you must add playframework home path to $PATH environment in that case.
+> You can locate your own Yobi directory in any other place. Please note that you must add Play Activator home path to $PATH environment in that case.
 
 ### Change directory to cloned Yobi directory (or cd to your unzipped file directory)
 
     cd yobi
 
-### Run play framework
+### Run Play Activator
 
-    ../play
+    ../activator
 
 or (for windows)
 
-    ..\play
+    ..\activator
 
 Required files will be download automatically. In the first time, it may take about 10 min or more.
 
@@ -94,7 +94,7 @@
 Also, you can configure start options.
 If your system's memory is over than 4G, we recommend to use follow options.
 
-    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
+    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
 
 ### Connect with browser
 
@@ -102,7 +102,7 @@
 
 If you want to change port, check your permission to use 80 port
 
-See [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production)
+See [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production)
 
 ### Upgrade Yobi
 
@@ -166,26 +166,25 @@
 
 JDK 7(1.7)이어야 합니다.
 
-### playframework 내려 받기
+### Play Activator 내려 받기
 
-    curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 혹은
 
-    wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 웹 브라우저에서 (이를테면, MS윈도우즈 사용자일 경우)
 
-    http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
-
+    http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 ### 압축풀기
 
-    unzip play-2.1.0.zip
+    unzip typesafe-activator-1.2.10-minimal.zip
 
 ### 압축을 푼 다음 하위 디렉터리로 이동
 
-    cd play-2.1.0
+    cd typesafe-activator-1.2.10-minimal
 
 ### Yobi 소스 내려 받기
 
@@ -199,20 +198,20 @@
     
 주의! case2의 경우, 업그레이드를 할 때 문제가 생길 수 있습니다.
 
-> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 play 실행파일이 있는 playframework 디렉터리를 $PATH 환경변수에 추가해 주세요.
+> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 activator 실행파일이 있는 Play Activator 디렉터리를 $PATH 환경변수에 추가해 주세요.
 
 ### clone 받은 Yobi 디렉터리로 이동 
 (혹은 압축을 해제한 디렉터리로 이동)
 
     cd yobi
 
-### 상단에 있는 play 실행파일 실행
+### 상단에 있는 activator 실행파일 실행
 
-    ../play
+    ../activator
 
 혹은 (윈도우 사용자일 경우)
 
-    ..\play
+    ..\activator
 
 실행하면 필요한 파일들을 web에서 내려받습니다. 첫 실행시 네트워크 상황에 따라 10여분 가까이 소요될 수 있습니다.
 
@@ -226,7 +225,7 @@
 시작 옵션은 조정가능합니다. 만약 시스템 메모리가 4기가 이상이라면
 아래 옵션으로 실행하는걸 권장합니다.
 
-    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
+    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
     
 
 ### 브라우저로 접속
@@ -234,7 +233,7 @@
     http://127.0.0.1:9000
 
 80 포트 등으로 포트를 변경하고 싶을 경우에는 해당 포트가 사용가능한지 확인 한 다음 80 포트를 사용할 수 있는 계정으로 실행합니다.
-관련해서는 [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production) 부분을 확인해 주세요.
+관련해서는 [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production) 부분을 확인해 주세요.
 
 ### 업그레이드 하기
 
app/Global.java
--- app/Global.java
+++ app/Global.java
@@ -43,6 +43,8 @@
 import play.data.Form;
 import play.mvc.*;
 import play.mvc.Http.RequestHeader;
+import play.mvc.Result;
+import play.libs.F.Promise;
 
 import utils.AccessControl;
 import utils.AccessLogger;
@@ -53,6 +55,7 @@
 import views.html.welcome.restart;
 import static play.data.Form.form;
 import static play.mvc.Results.badRequest;
+
 
 public class Global extends GlobalSettings {
     private static final String[] INITIAL_ENTITY_NAME = {"users", "roles", "siteAdmins"};
@@ -101,14 +104,14 @@
     private Action<Void> getDefaultAction(final Http.Request request) {
         final long start = System.currentTimeMillis();
         return new Action.Simple() {
-            public Result call(Http.Context ctx) throws Throwable {
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
                 UserApp.initTokenUser();
                 UserApp.updatePreferredLanguage();
                 ctx.response().setHeader("Date", DateUtils.formatDate(new Date()));
                 ctx.response().setHeader("Cache-Control", "no-cache");
-                Result result = delegate.call(ctx);
-                AccessLogger.log(request, result, start);
-                return result;
+                Promise<Result> promise = delegate.call(ctx);
+                AccessLogger.log(request, promise, start);
+                return promise;
             }
         };
     }
@@ -116,8 +119,8 @@
     private Action<Void> getRestartAction() {
         return new Action.Simple() {
             @Override
-            public Result call(Http.Context ctx) throws Throwable {
-                return ok(restart.render());
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
+                return Promise.pure((Result) ok(restart.render()));
             }
         };
     }
@@ -125,20 +128,20 @@
     private Action<Void> getConfigSecretAction() {
         return new Action.Simple() {
             @Override
-            public Result call(Http.Context ctx) throws Throwable {
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
                 if( ctx.request().method().toLowerCase().equals("post") ) {
                     Form<User> newSiteAdminUserForm = form(User.class).bindFromRequest();
 
                     if (hasError(newSiteAdminUserForm)) {
-                        return badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm));
+                        return Promise.pure((Result) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)));
                     }
 
                     User siteAdmin = SiteAdmin.updateDefaultSiteAdmin(newSiteAdminUserForm.get());
                     replaceSiteSecretKey(createSeed(siteAdmin.password));
                     isRestartRequired = true;
-                    return ok(restart.render());
+                    return Promise.pure((Result) ok(restart.render()));
                 } else {
-                    return ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class)));
+                    return Promise.pure((Result) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))));
                 }
             }
 
@@ -208,26 +211,26 @@
     }
 
     @Override
-    public Result onHandlerNotFound(RequestHeader request) {
+    public Promise<Result> onHandlerNotFound(RequestHeader request) {
         AccessLogger.log(request, null, Http.Status.NOT_FOUND);
-        return Results.notFound(ErrorViews.NotFound.render());
+        return Promise.pure((Result) Results.notFound(ErrorViews.NotFound.render()));
     }
 
     @Override
-    public Result onError(RequestHeader request, Throwable t) {
+    public Promise<Result> onError(RequestHeader request, Throwable t) {
         AccessLogger.log(request, null, Http.Status.INTERNAL_SERVER_ERROR);
 
         if (Play.isProd()) {
-            return Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError"));
+            return Promise.pure((Result) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")));
         } else {
             return super.onError(request, t);
         }
     }
 
     @Override
-    public Result onBadRequest(RequestHeader request, String error) {
+    public Promise<Result> onBadRequest(RequestHeader request, String error) {
         AccessLogger.log(request, null, Http.Status.BAD_REQUEST);
-        return badRequest(ErrorViews.BadRequest.render());
+        return Promise.pure((Result) badRequest(ErrorViews.BadRequest.render()));
     }
 
 }
app/actions/AbstractProjectCheckAction.java
--- app/actions/AbstractProjectCheckAction.java
+++ app/actions/AbstractProjectCheckAction.java
@@ -29,6 +29,8 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
 import utils.ErrorViews;
@@ -46,32 +48,38 @@
  */
 public abstract class AbstractProjectCheckAction<T> extends Action<T> {
     @Override
-    public final Result call(Context context) throws Throwable {
+    public final Promise<Result> call(Context context) throws Throwable {
         PathParser parser = new PathParser(context);
         String ownerLoginId = parser.getOwnerLoginId();
         String projectName = parser.getProjectName();
 
         Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
 
+        Promise<Result> promise;
+
         if (project == null) {
             if (UserApp.currentUser() == User.anonymous){
                 flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-                return AccessLogger.log(context.request(),
-                        forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null);
+                promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+            } else {
+                promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
             }
-            return AccessLogger.log(context.request(),
-                    forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")), null);
+
+            AccessLogger.log(context.request(), promise, null);
+
+            return promise;
         }
 
         if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) {
             flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-            return AccessLogger.log(context.request(),
-                    forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null);
+            promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         return call(project, context, parser);
     }
 
-    protected abstract Result call(Project project, Context context, PathParser parser)
+    protected abstract Promise<Result> call(Project project, Context context, PathParser parser)
             throws Throwable;
 }
app/actions/AnonymousCheckAction.java
--- app/actions/AnonymousCheckAction.java
+++ app/actions/AnonymousCheckAction.java
@@ -26,6 +26,8 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
 import utils.Constants;
@@ -40,7 +42,7 @@
 public class AnonymousCheckAction extends Action<AnonymousCheck> {
 
     @Override
-    public Result call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         if ((AccessControl.isAnonymousNotAllowed() || configuration.requiresLogin()) &&
                 UserApp.currentUser().isAnonymous()) {
             if (configuration.displaysFlashMessage()) {
@@ -48,7 +50,9 @@
             }
             String loginFormUrl = routes.UserApp.loginForm().url();
             loginFormUrl += "?redirectUrl=" + context.request().path();
-            return AccessLogger.log(context.request(), redirect(loginFormUrl), null);
+            Promise<Result> promise = Promise.pure(redirect(loginFormUrl));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
         return delegate.call(context);
     }
app/actions/DefaultProjectCheckAction.java
--- app/actions/DefaultProjectCheckAction.java
+++ app/actions/DefaultProjectCheckAction.java
@@ -24,6 +24,8 @@
 import models.Project;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 
 /**
  * Default implementation of {@link AbstractProjectCheckAction}.
@@ -34,7 +36,7 @@
  */
 public class DefaultProjectCheckAction extends AbstractProjectCheckAction<Void> {
     @Override
-    protected Result call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         return this.delegate.call(context);
     }
 }
app/actions/IsAllowedAction.java
--- app/actions/IsAllowedAction.java
+++ app/actions/IsAllowedAction.java
@@ -30,6 +30,8 @@
 import models.resource.ResourceConvertible;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
 import utils.ErrorViews;
@@ -47,19 +49,21 @@
  */
 public class IsAllowedAction extends AbstractProjectCheckAction<IsAllowed> {
     @Override
-    protected Result call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         ResourceType resourceType = this.configuration.resourceType();
         ResourceConvertible resourceObject = Resource.getResourceObject(parser, project, resourceType);
         Operation operation = this.configuration.value();
 
         if(resourceObject == null) {
-            return AccessLogger.log(context.request(),
-                    notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())) , null);
+            Promise<Result> promise = Promise.pure((Result) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         if(!AccessControl.isAllowed(UserApp.currentUser(), resourceObject.asResource(), operation)) {
-            return AccessLogger.log(context.request(),
-                    forbidden(ErrorViews.Forbidden.render("error.forbidden", project)), null);
+            Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         return this.delegate.call(context);
app/actions/IsCreatableAction.java
--- app/actions/IsCreatableAction.java
+++ app/actions/IsCreatableAction.java
@@ -24,6 +24,8 @@
 import models.User;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
 import utils.ErrorViews;
@@ -41,12 +43,12 @@
  */
 public class IsCreatableAction extends AbstractProjectCheckAction<IsCreatable> {
     @Override
-    protected Result call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         User currentUser = UserApp.currentUser();
         if (!AccessControl.isProjectResourceCreatable(currentUser, project, this.configuration.value())) {
-            return AccessLogger.log(context.request()
-                    , forbidden(ErrorViews.Forbidden.render("error.forbidden", project))
-                    , null);
+            Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         return this.delegate.call(context);
app/actions/IsOnlyGitAvailableAction.java
--- app/actions/IsOnlyGitAvailableAction.java
+++ app/actions/IsOnlyGitAvailableAction.java
@@ -25,6 +25,8 @@
 import models.Project;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessLogger;
 import utils.ErrorViews;
 
@@ -38,9 +40,11 @@
  */
 public class IsOnlyGitAvailableAction extends AbstractProjectCheckAction<IsOnlyGitAvailable> {
     @Override
-    protected Result call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         if(!project.isGit()) {
-            return AccessLogger.log(context.request(), badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")), null);
+            Promise<Result> promise = Promise.pure((Result) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")));
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         return this.delegate.call(context);
app/actions/NullProjectCheckAction.java
--- app/actions/NullProjectCheckAction.java
+++ app/actions/NullProjectCheckAction.java
@@ -28,6 +28,8 @@
 import play.mvc.Action;
 import play.mvc.Http;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 import utils.AccessLogger;
 import utils.ErrorViews;
 
@@ -43,7 +45,7 @@
 public class NullProjectCheckAction extends Action<Void> {
 
     @Override
-    public Result call(Http.Context context) throws Throwable {
+    public Promise<Result> call(Http.Context context) throws Throwable {
         PathParser parser = new PathParser(context);
         String ownerLoginId = parser.getOwnerLoginId();
         String projectName = parser.getProjectName();
@@ -51,13 +53,18 @@
         Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
 
         if (project == null) {
+            Promise<Result> promise;
+
             if (UserApp.currentUser() == User.anonymous){
                 flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-                return AccessLogger.log(context.request(),
-                        forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null);
+                promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+            } else {
+                promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
             }
-            return AccessLogger.log(context.request(),
-                    forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")), null);
+
+            AccessLogger.log(context.request(), promise, null);
+
+            return promise;
         }
 
         return this.delegate.call(context);
app/controllers/Application.java
--- app/controllers/Application.java
+++ app/controllers/Application.java
@@ -28,6 +28,7 @@
 import playRepository.RepositoryService;
 import views.html.error.notfound_default;
 import views.html.index.index;
+import jsmessages.JsMessages;
 
 import java.io.File;
 
@@ -56,8 +57,10 @@
         return redirect(routes.Application.index());
     }
 
+    static final JsMessages messages = JsMessages.create(play.Play.application());
+
     public static Result jsMessages() {
-        return ok(jsmessages.JsMessages.generate("Messages")).as("application/javascript");
+        return ok(messages.generate("Messages")).as("application/javascript");
     }
 
     private static void makeUploadFolder() {
app/controllers/AttachmentApp.java
--- app/controllers/AttachmentApp.java
+++ app/controllers/AttachmentApp.java
@@ -26,7 +26,7 @@
 import models.enumeration.Operation;
 import models.enumeration.ResourceType;
 import org.apache.commons.lang3.StringUtils;
-import org.codehaus.jackson.JsonNode;
+import com.fasterxml.jackson.databind.JsonNode;
 import play.Configuration;
 import play.Logger;
 import play.mvc.Controller;
app/controllers/BoardApp.java
--- app/controllers/BoardApp.java
+++ app/controllers/BoardApp.java
@@ -33,7 +33,7 @@
 import models.enumeration.ResourceType;
 
 import org.apache.commons.lang3.StringUtils;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 import play.data.Form;
 import play.db.ebean.Transactional;
app/controllers/CodeApp.java
--- app/controllers/CodeApp.java
+++ app/controllers/CodeApp.java
@@ -28,7 +28,7 @@
 import org.apache.commons.io.FilenameUtils;
 import org.apache.tika.Tika;
 import org.apache.tika.mime.MediaType;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.tmatesoft.svn.core.SVNException;
 import play.mvc.*;
@@ -100,7 +100,7 @@
         List<ObjectNode> recursiveData = new ArrayList<>();
         List<String> branches = repository.getBranchNames();
 
-        if(fileInfo.get("type").getTextValue().equals("folder") && !path.equals("")){
+        if(fileInfo.get("type").textValue().equals("folder") && !path.equals("")){
             recursiveData.addAll(RepositoryService.getMetaDataFromAncestorDirectories(repository, branch, path));
         }
         recursiveData.add(fileInfo);
app/controllers/IssueApp.java
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
@@ -33,8 +33,8 @@
 import models.enumeration.State;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.tika.Tika;
-import org.codehaus.jackson.node.ObjectNode;
-import play.api.templates.Html;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import play.twirl.api.Html;
 import play.data.Form;
 import play.data.validation.ValidationError;
 import play.db.ebean.Transactional;
app/controllers/OrganizationApp.java
--- app/controllers/OrganizationApp.java
+++ app/controllers/OrganizationApp.java
@@ -26,8 +26,8 @@
 import models.enumeration.Operation;
 import models.enumeration.RequestState;
 import models.enumeration.RoleType;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import play.data.Form;
 import play.data.validation.Validation;
 import play.db.ebean.Transactional;
app/controllers/ProjectApp.java
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
@@ -35,7 +35,7 @@
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.mail.HtmlEmail;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.NoHeadException;
 import org.tmatesoft.svn.core.SVNException;
@@ -102,7 +102,7 @@
             return notFound(ErrorViews.NotFound.render("error.notfound"));
         }
 
-        targetProject.overview = request().body().asJson().findPath("overview").getTextValue();
+        targetProject.overview = request().body().asJson().findPath("overview").textValue();
         targetProject.save();
 
         ObjectNode result = Json.newObject();
@@ -1064,14 +1064,13 @@
         if (label == null) {
             // Create new label if there is no label which has the given name.
             label = new Label(category, name);
-            label.projects.add(project);
             label.save();
             isCreated = true;
         }
 
         Boolean isAttached = project.attachLabel(label);
 
-        if (!isCreated && !isAttached) {
+        if (isCreated && !isAttached) {
             // Something is wrong. This case is not possible.
             play.Logger.warn(
                     "A label '" + label + "' is created but failed to attach to project '" + project + "'.");
app/controllers/PullRequestApp.java
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
@@ -23,34 +23,37 @@
 import actors.PullRequestMergingActor;
 import akka.actor.Props;
 import com.avaje.ebean.Page;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import controllers.annotation.AnonymousCheck;
 import controllers.annotation.IsAllowed;
 import controllers.annotation.IsCreatable;
 import controllers.annotation.IsOnlyGitAvailable;
+import errors.PullRequestException;
 import models.*;
 import models.enumeration.Operation;
 import models.enumeration.ResourceType;
 import models.enumeration.RoleType;
 import models.enumeration.State;
 import org.apache.commons.lang3.StringUtils;
-import org.codehaus.jackson.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.tmatesoft.svn.core.SVNException;
 import play.api.mvc.Call;
 import play.data.Form;
 import play.db.ebean.Transactional;
 import play.libs.Akka;
+import play.libs.F;
 import play.libs.F.Function;
 import play.libs.F.Promise;
 import play.libs.Json;
 import play.mvc.Controller;
 import play.mvc.Result;
+import play.mvc.Result;
 import playRepository.GitBranch;
 import playRepository.GitRepository;
 import playRepository.RepositoryService;
 import utils.*;
-import views.html.git.*;
 import views.html.error.notfound;
+import views.html.git.*;
 
 import javax.servlet.ServletException;
 import java.io.IOException;
@@ -60,7 +63,6 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Callable;
 
 @IsOnlyGitAvailable
 @AnonymousCheck
@@ -281,7 +283,7 @@
 
         PullRequestEventMessage message = new PullRequestEventMessage(
                 UserApp.currentUser(), request(), pullRequest);
-        Akka.system().actorOf(new Props(PullRequestMergingActor.class)).tell(message, null);
+        Akka.system().actorOf(Props.create(PullRequestMergingActor.class)).tell(message, null);
 
         return redirect(pullRequestCall);
     }
@@ -378,13 +380,13 @@
                                             long pullRequestNumber, String commitId) {
         Project project = Project.findByOwnerAndProjectName(userName, projectName);
         PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber);
-        return ok(viewChanges.render(project, pullRequest, commitId));
+        return ok(views.html.git.viewChanges.render(project, pullRequest, commitId));
     }
 
     @Transactional
     @AnonymousCheck(requiresLogin = true, displaysFlashMessage = true)
     @IsAllowed(value = Operation.ACCEPT, resourceType = ResourceType.PULL_REQUEST)
-    public static Result accept(final String userName, final String projectName,
+    public static Promise<Result> accept(final String userName, final String projectName,
                                 final long pullRequestNumber) {
         Project project = Project.findByOwnerAndProjectName(userName, projectName);
         final PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber);
@@ -397,27 +399,29 @@
                 UserApp.currentUser(), request(), project, pullRequest.toBranch);
 
         if(project.isUsingReviewerCount && !pullRequest.isReviewed()) {
-            return badRequest(ErrorViews.BadRequest.render("pullRequest.not.enough.review.point"));
+            return Promise.pure((Result) badRequest(
+                    ErrorViews.BadRequest.render("pullRequest.not.enough.review.point")));
         }
 
-        Promise<Void> promise = Akka.future(new Callable<Void>() {
-            @Override
-            public Void call() throws Exception {
-                pullRequest.merge(message);
-                // mark the end of the merge
-                pullRequest.endMerge();
-                pullRequest.update();
-                return null;
-            }
-        });
+        Promise<Void> promise = Promise.promise(
+                new F.Function0<Void>() {
+                    public Void apply() throws Exception {
+                        pullRequest.merge(message);
+                        // mark the end of the merge
+                        pullRequest.endMerge();
+                        pullRequest.update();
+                        return null;
+                    }
+                }
+        );
 
-        return async(promise.map(new Function<Void, Result>() {
+        return promise.map(new Function<Void, Result>() {
             @Override
             public Result apply(Void v) throws Throwable {
                 return redirect(routes.PullRequestApp.pullRequest(userName, projectName,
                         pullRequestNumber));
             }
-        }));
+        });
     }
 
     private static void addNotification(PullRequest pullRequest, State from, State to) {
@@ -460,7 +464,7 @@
 
         PullRequestEventMessage message = new PullRequestEventMessage(
                 UserApp.currentUser(), request(), pullRequest);
-        Akka.system().actorOf(new Props(PullRequestMergingActor.class)).tell(message, null);
+        Akka.system().actorOf(Props.create(PullRequestMergingActor.class)).tell(message, null);
 
         return redirect(call);
     }
app/controllers/UserApp.java
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
@@ -32,7 +32,7 @@
 import org.apache.shiro.crypto.SecureRandomNumberGenerator;
 import org.apache.shiro.crypto.hash.Sha256Hash;
 import org.apache.shiro.util.ByteSource;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import play.Configuration;
 import play.Logger;
 import play.Play;
app/models/Attachment.java
--- app/models/Attachment.java
+++ app/models/Attachment.java
@@ -54,7 +54,7 @@
 import play.db.ebean.Model;
 import play.libs.Akka;
 import scala.concurrent.duration.Duration;
-import scalax.file.NotDirectoryException;
+import java.nio.file.NotDirectoryException;
 import utils.FileUtil;
 import utils.JodaDateUtil;
 
app/models/Email.java
--- app/models/Email.java
+++ app/models/Email.java
@@ -106,7 +106,7 @@
         this.token = RandomStringUtils.randomNumeric(50);
         this.confirmUrl = Url.create(routes.UserApp.confirmEmail(this.id, this.token).url());
         update();
-        Akka.system().actorOf(new Props(ValidationEmailSender.class)).tell(this, null);
+        Akka.system().actorOf(Props.create(ValidationEmailSender.class)).tell(this, null);
     }
 
     public static Email findByEmail(String email, boolean isValid) {
app/models/Project.java
--- app/models/Project.java
+++ app/models/Project.java
@@ -427,14 +427,14 @@
     }
 
     public Boolean attachLabel(Label label) {
-        if (labels.contains(label)) {
+        if (label.projects.contains(this)) {
             // Return false if the label has been already attached.
             return false;
         }
 
-        // Attach new label.
-        labels.add(label);
-        update();
+        // Attach new label. I don't know why labels.add(label) does not work.
+        label.projects.add(this);
+        label.update();
 
         return true;
     }
app/models/PullRequest.java
--- app/models/PullRequest.java
+++ app/models/PullRequest.java
@@ -560,7 +560,7 @@
             NotificationEvent.afterPullRequestUpdated(sender, this, State.OPEN, State.MERGED);
             PullRequestEvent.addStateEvent(sender, this, State.MERGED);
 
-            Akka.system().actorOf(new Props(RelatedPullRequestMergingActor.class)).tell(message, null);
+            Akka.system().actorOf(Props.create(RelatedPullRequestMergingActor.class)).tell(message, null);
         }
     }
 
app/playRepository/GitRepository.java
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
@@ -33,8 +33,8 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.tika.Tika;
 import org.apache.tika.metadata.Metadata;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.api.LogCommand;
 import org.eclipse.jgit.api.errors.GitAPIException;
app/playRepository/PlayRepository.java
--- app/playRepository/PlayRepository.java
+++ app/playRepository/PlayRepository.java
@@ -22,7 +22,7 @@
 
 import models.resource.Resource;
 
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.lib.Repository;
 import org.tigris.subversion.javahl.ClientException;
app/playRepository/RepositoryService.java
--- app/playRepository/RepositoryService.java
+++ app/playRepository/RepositoryService.java
@@ -24,7 +24,7 @@
 import controllers.UserApp;
 import models.Project;
 import models.User;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.transport.*;
app/playRepository/SVNRepository.java
--- app/playRepository/SVNRepository.java
+++ app/playRepository/SVNRepository.java
@@ -28,7 +28,7 @@
 import models.resource.Resource;
 import org.apache.commons.io.FileUtils;
 import org.apache.tika.Tika;
-import org.codehaus.jackson.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.diff.RawText;
 import org.joda.time.format.DateTimeFormatter;
app/playRepository/hooks/IssueReferredFromCommitEvent.java
--- app/playRepository/hooks/IssueReferredFromCommitEvent.java
+++ app/playRepository/hooks/IssueReferredFromCommitEvent.java
@@ -47,6 +47,6 @@
     @Override
     public void onPostReceive(ReceivePack receivePack, Collection<ReceiveCommand> commands) {
         PostReceiveMessage message = new PostReceiveMessage(commands, project, user);
-        Akka.system().actorOf(new Props(IssueReferredFromCommitEventActor.class)).tell(message, null);
+        Akka.system().actorOf(Props.create(IssueReferredFromCommitEventActor.class)).tell(message, null);
     }
 }
app/playRepository/hooks/NotifyPushedCommits.java
--- app/playRepository/hooks/NotifyPushedCommits.java
+++ app/playRepository/hooks/NotifyPushedCommits.java
@@ -47,6 +47,6 @@
     @Override
     public void onPostReceive(ReceivePack receivePack, Collection<ReceiveCommand> commands) {
         PostReceiveMessage message = new PostReceiveMessage(commands, project, user);
-        Akka.system().actorOf(new Props(CommitsNotificationActor.class)).tell(message, null);
+        Akka.system().actorOf(Props.create(CommitsNotificationActor.class)).tell(message, null);
     }
 }
app/playRepository/hooks/PullRequestCheck.java
--- app/playRepository/hooks/PullRequestCheck.java
+++ app/playRepository/hooks/PullRequestCheck.java
@@ -54,7 +54,7 @@
         Set<String> branches = ReceiveCommandUtil.getUpdatedBranches(commands);
         for (String branch : branches) {
             PullRequestEventMessage message = new PullRequestEventMessage(user, request, project, branch);
-            Akka.system().actorOf(new Props(RelatedPullRequestMergingActor.class)).tell(message, null);
+            Akka.system().actorOf(Props.create(RelatedPullRequestMergingActor.class)).tell(message, null);
         }
 
         Set<String> deletedBranches = ReceiveCommandUtil.getDeletedBranches(commands);
app/utils/AccessLogger.java
--- app/utils/AccessLogger.java
+++ app/utils/AccessLogger.java
@@ -22,9 +22,6 @@
 
 import controllers.UserApp;
 import org.apache.commons.lang3.StringEscapeUtils;
-import play.api.mvc.AsyncResult;
-import play.api.mvc.PlainResult;
-import play.libs.Akka;
 import play.libs.F.Callback;
 import play.libs.F.Promise;
 import play.mvc.Http;
@@ -89,31 +86,16 @@
      * @see <a href="http://httpd.apache.org/docs/2.2/en/logs.html#combined">Combined Log Format - Apache HTTP Server</a>
      * @see <a href="http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats">Custom Log Formats - Apache HTTP Server</a>
      */
-    public static Result log(final Http.Request request, final Result result,
+    public static void log(final Http.Request request, final Promise<Result> promise,
             final Long startTimeMillis) {
-        if (result.getWrappedResult() instanceof PlainResult) {
-            int status = ((PlainResult) result.getWrappedResult()).header().status();
-            log(request, UserApp.currentUser().loginId, status, startTimeMillis);
-        } else if (result.getWrappedResult() instanceof AsyncResult) {
-            AsyncResult asyncResult = (AsyncResult) result.getWrappedResult();
-            Promise<play.api.mvc.Result> promise = Akka.asPromise(asyncResult.result());
-            promise.onRedeem(new Callback<play.api.mvc.Result>() {
-                @Override
-                public void invoke(final play.api.mvc.Result result) throws Throwable {
-                    log(request, wrapResult(result), startTimeMillis);
-                }
-            });
-        }
-        return result;
-    }
-
-    private static Result wrapResult(final play.api.mvc.Result result) {
-        return new Result() {
+        final String username = UserApp.currentUser().loginId;
+        promise.onRedeem(new Callback<Result>() {
             @Override
-            public play.api.mvc.Result getWrappedResult() {
-                return result;
+            public void invoke(final Result result) throws Throwable {
+                log(request, username, result.toScala().header().status(),
+                        startTimeMillis);
             }
-        };
+        });
     }
 
     /**
app/utils/BasicAuthAction.java
--- app/utils/BasicAuthAction.java
+++ app/utils/BasicAuthAction.java
@@ -29,6 +29,8 @@
 import play.mvc.Http.Request;
 import play.mvc.Http.Response;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 
 import java.io.UnsupportedEncodingException;
 
@@ -96,18 +98,18 @@
     }
 
     @Override
-    public Result call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         User user;
         try {
             user = authenticate(context.request());
         } catch (MalformedCredentialsException error) {
-            return AccessLogger.log(context.request()
-                    , badRequest()
-                    , null);
+            Promise<Result> promise = Promise.pure((Result) badRequest());
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         } catch (UnsupportedEncodingException e) {
-            return AccessLogger.log(context.request()
-                    , internalServerError()
-                    , null);
+            Promise<Result> promise = Promise.pure((Result) internalServerError());
+            AccessLogger.log(context.request(), promise, null);
+            return promise;
         }
 
         if (!user.isAnonymous()) {
app/utils/ErrorViews.java
--- app/utils/ErrorViews.java
+++ app/utils/ErrorViews.java
@@ -23,7 +23,7 @@
 import models.Organization;
 import models.Project;
 import models.User;
-import play.api.templates.Html;
+import play.twirl.api.Html;
 import views.html.index.index;
 
 
app/utils/PlayServletContext.java
--- app/utils/PlayServletContext.java
+++ app/utils/PlayServletContext.java
@@ -302,4 +302,7 @@
         throw new UnsupportedOperationException();
     }
 
+    public String getVirtualServerName() {
+        throw new UnsupportedOperationException();
+    }
 }
app/utils/PlayServletRequest.java
--- app/utils/PlayServletRequest.java
+++ app/utils/PlayServletRequest.java
@@ -115,6 +115,16 @@
         return Integer.parseInt(contentLength);
     }
 
+    public long getContentLengthLong() {
+        String contentLength = request.getHeader(Http.HeaderNames.CONTENT_LENGTH);
+
+        if (contentLength == null) {
+            return -1;
+        }
+
+        return Long.parseLong(contentLength);
+    }
+
     @Override
     public String getContentType() {
         return request.getHeader(Http.HeaderNames.CONTENT_TYPE);
@@ -172,6 +182,18 @@
             protected void finalize() throws Throwable {
                 close();
                 super.finalize();
+            }
+
+            public void setReadListener(javax.servlet.ReadListener readListener) {
+                throw new UnsupportedOperationException();
+            }
+
+            public boolean isReady() {
+                throw new UnsupportedOperationException();
+            }
+
+            public boolean isFinished() {
+                throw new UnsupportedOperationException();
             }
         };
     }
@@ -556,4 +578,14 @@
         throw new UnsupportedOperationException();
     }
 
+    public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> httpUpgradeHandlerClass)
+	    throws java.io.IOException,
+		   ServletException {
+        throw new UnsupportedOperationException();
+    }
+
+    public String changeSessionId() {
+        throw new UnsupportedOperationException();
+    }
+
 }
app/utils/PlayServletResponse.java
--- app/utils/PlayServletResponse.java
+++ app/utils/PlayServletResponse.java
@@ -101,6 +101,14 @@
             target.close();
             super.close();
         }
+
+        public void setWriteListener(WriteListener writeListener) {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean isReady() {
+            throw new UnsupportedOperationException();
+        }
     }
 
     public PlayServletResponse(Response response) throws IOException {
@@ -189,6 +197,10 @@
     @Override
     public void setContentLength(int length) {
         this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Integer.toString(length));
+    }
+
+    public void setContentLengthLong(long length) {
+        this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Long.toString(length));
     }
 
     @Override
@@ -380,4 +392,8 @@
         }
         return (encoding.trim());
     }
+
+    public String getVirtualServerName() {
+        throw new UnsupportedOperationException();
+    }
 }
app/utils/SiteManagerAuthAction.java
--- app/utils/SiteManagerAuthAction.java
+++ app/utils/SiteManagerAuthAction.java
@@ -24,17 +24,18 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
+import play.mvc.Result;
+import play.libs.F.Promise;
 
 /**
  * The Class SiteManagerAuthAction.
  */
 public class SiteManagerAuthAction extends Action.Simple {
     @Override
-    public Result call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         if (!UserApp.currentUser().isSiteManager()) {
-            return forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage"));
+            return Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")));
         }
         return delegate.call(context);
     }
-
 }
app/utils/TemplateHelper.scala
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
@@ -25,7 +25,7 @@
 import play.api.i18n.Lang
 import models.CodeCommentThread
 import models.CommentThread
-import play.api.templates.Html
+import play.twirl.api.Html
 
 object TemplateHelper {
 
@@ -364,12 +364,12 @@
     def shortId(commitId: String) = commitId.substring(0, Math.min(7, commitId.size))
 
     @tailrec
-    def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.api.templates.Html): play.api.templates.Html =
+    def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.twirl.api.Html): play.twirl.api.Html =
       threads match {
         case head :: tail =>
           head match {
             case (thread: models.NonRangedCodeCommentThread)
-              if commitId == null || commitId == thread.commitId => html += partial_comment_thread(thread)
+              if commitId == null || commitId == thread.commitId => new Html(List(html, partial_comment_thread(thread)))
             case _ => ;
           }
           renderNonRangedThreads(tail, commitId, html)
@@ -378,16 +378,16 @@
 
     @tailrec
     def _renderEventsOnPullRequest(pull: PullRequest, events: List[PullRequestEvent],
-                                   html: play.api.templates.Html): play.api.templates.Html =
+                                   html: play.twirl.api.Html): play.twirl.api.Html =
       events match {
         case head :: tail =>
-          html += partial_pull_request_event(pull, head)
+          new Html(List(html, partial_pull_request_event(pull, head)))
           _renderEventsOnPullRequest(pull, tail, html)
         case _ => html
       }
 
     def renderEventsOnPullRequest(pull: PullRequest) =
-      _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.api.templates.Html(""))
+      _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.twirl.api.Html(""))
 
     def urlToCommentThread(thread: CommentThread) = {
         urlToContainer(thread) + "#thread-" + thread.id
@@ -467,9 +467,9 @@
   }
 
   object CodeBrowser {
-    def fieldText(obj:org.codehaus.jackson.JsonNode, field:String):String = {
+    def fieldText(obj:com.fasterxml.jackson.databind.JsonNode, field:String):String = {
       if(obj.get(field) != null){
-        obj.get(field).getTextValue()
+        obj.get(field).textValue()
       } else {
         ""
       }
@@ -491,7 +491,7 @@
       }
     }
 
-    def getAvatar(file:org.codehaus.jackson.JsonNode):String = {
+    def getAvatar(file:com.fasterxml.jackson.databind.JsonNode):String = {
       val avatarURL = fieldText(file, "avatar")
 
       if(avatarURL != null){
@@ -501,7 +501,7 @@
       }
     }
 
-    def getFileClass(file:org.codehaus.jackson.JsonNode):String = {
+    def getFileClass(file:com.fasterxml.jackson.databind.JsonNode):String = {
       if(fieldText(file, "name") == ".."){
         "updir"
       } else {
@@ -512,12 +512,12 @@
       }
     }
 
-    def getFileDate(file:org.codehaus.jackson.JsonNode, field:String)(implicit lang:Lang):String = {
-      JodaDateUtil.momentFromNow(file.get(field).getLongValue, lang.language)
+    def getFileDate(file:com.fasterxml.jackson.databind.JsonNode, field:String)(implicit lang:Lang):String = {
+      JodaDateUtil.momentFromNow(file.get(field).longValue, lang.language)
     }
 
-    def getFileAgoOrDate(file:org.codehaus.jackson.JsonNode, field:String) = {
-      agoOrDateString(new java.util.Date(file.get(field).getLongValue))
+    def getFileAgoOrDate(file:com.fasterxml.jackson.databind.JsonNode, field:String) = {
+      agoOrDateString(new java.util.Date(file.get(field).longValue))
     }
 
     def getCorrectedPath(filePath:String, fileName:String):String = {
@@ -528,7 +528,7 @@
       }
     }
 
-    def getFileRev(vcsType:String, file:org.codehaus.jackson.JsonNode):String = {
+    def getFileRev(vcsType:String, file:com.fasterxml.jackson.databind.JsonNode):String = {
       vcsType match {
         case "GIT" => fieldText(file,"commitId")
         case "Subversion" => fieldText(file, "revisionNo")
app/views/board/create.scala.html
--- app/views/board/create.scala.html
+++ app/views/board/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
+@(title:String, form: play.data.Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
 
 @import utils.AccessControl._
 @import utils.TemplateHelper._
@@ -27,7 +27,7 @@
 @implicitField = @{ helper.FieldConstructor(simpleForm) }
 
 @readmeUpdateMessage = @{
-  if( request().getQueryString("readme") != null ) {
+  if( requestHeader.getQueryString("readme") != null ) {
       "Update README.md"
   }
 }
@@ -66,7 +66,7 @@
         @** end of fileUploader **@
 
         <div class="right-txt mt10 mb10">
-          @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
+          @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
           <label class="checkbox">
             <input type="checkbox" id="notice" name="notice">
             @Messages("post.notice.label")
@@ -74,9 +74,9 @@
           }
 
           @if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.COMMIT)){
-            @if(project.isGit && stringToBoolean(request().getQueryString("readme"))){
+            @if(project.isGit && stringToBoolean(requestHeader.getQueryString("readme").get)){
             <label class="checkbox">
-              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(request().getQueryString("readme"))>
+              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(requestHeader.getQueryString("readme"))>
               @Messages("post.readmefy")
             </label>
             }
app/views/board/edit.scala.html
--- app/views/board/edit.scala.html
+++ app/views/board/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[Posting], posting:Posting, number:Long,  project:Project, isAllowedToNotice:Boolean)
+@(title:String, form: play.data.Form[Posting], posting:Posting, number:Long,  project:Project, isAllowedToNotice:Boolean)
 
 @import utils.AccessControl._
 @import utils.TemplateHelper._
@@ -60,7 +60,7 @@
         @** end of fileUploader **@
 
         <div class="right-txt mt10 mb10">
-          @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
+          @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
             @helper.input(form("notice")){(id, name, value, args) =>
             <label class="checkbox">
               <input type="checkbox" id="notice" name="notice" @toHtmlArgs(args) @(if(value.equals(Some("true"))) "checked" else "")/>
app/views/board/view.scala.html
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(post:Posting, commentForm:Form[PostingComment],  project:Project)
+@(post:Posting, commentForm: play.data.Form[PostingComment],  project:Project)
 
 @import utils.JodaDateUtil
 @import utils.TemplateHelper._
@@ -28,7 +28,7 @@
 @import utils.Markdown
 @implicitField = @{ helper.FieldConstructor(simpleForm) }
 
-@urlToPostings = @{ urlToList(request.getHeader("Referer"), routes.BoardApp.posts(project.owner, project.name).toString()) }
+@urlToPostings = @{ urlToList(requestHeader.headers.get("Referer").get, routes.BoardApp.posts(project.owner, project.name).toString()) }
 
 @projectLayout(post.title, project, utils.MenuType.BOARD){
 @projectMenu(project, utils.MenuType.BOARD, "main-menu-only")
app/views/code/branches.scala.html
--- app/views/code/branches.scala.html
+++ app/views/code/branches.scala.html
@@ -57,7 +57,7 @@
                     <tbody>
                         @partial_branchrow(project, head, true)
 
-                        @for(branch <- branches.iterator()) {
+                        @for(branch <- branches.iterator) {
                             @partial_branchrow(project, branch, false)
                         }
                     </tbody>
app/views/code/diff.scala.html
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
@@ -151,7 +151,7 @@
                                     <p class="content">@thread.getFirstReviewComment().getContents()</p>
                                     <span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
                                         <span class="comments">
-                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
+                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
                                         </span>
                                         <span class="avatar-wrap smaller margin-right-5">
                                             <img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />
@@ -170,7 +170,7 @@
                                     <p class="content">@thread.getFirstReviewComment().getContents()</p>
                                     <span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
                                         <span class="comments">
-                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
+                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
                                         </span>
                                         <span class="avatar-wrap smaller margin-right-5">
                                             <img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />
app/views/code/history.scala.html
--- app/views/code/history.scala.html
+++ app/views/code/history.scala.html
@@ -77,7 +77,7 @@
 }
 
 @isHistoryExistAndHasParent(history: List[playRepository.Commit]) = @{
-    (history.size() > 0 && history.get(history.size() - 1).getParentCount() > 0)
+    (history.size > 0 && history.get(history.size - 1).getParentCount() > 0)
 }
 
 @projectLayout(Messages("title.commitHistory"), project, utils.MenuType.CODE) {
@@ -137,7 +137,7 @@
                             @if(history.isEmpty()){
                                 <tr><td colspan="5" class="warning-none">@Messages("code.nocommits")</td></tr>
                             }
-                            @for(commit <- history.iterator()) {
+                            @for(commit <- history.iterator) {
                             @defining(getShowCommitURL(project, commit, path)){ showCommitURL =>
                             <tr>
                                 <td class="commit-id">
app/views/code/nohead.scala.html
--- app/views/code/nohead.scala.html
+++ app/views/code/nohead.scala.html
@@ -21,12 +21,12 @@
 @(project: Project)
 
 @getCodeURL(project: Project) = @{
-    if(session == null){
+    if(requestHeader.session == null){
         CodeApp.getURL(project.owner, project.name)
     } else {
-        defining(ProjectUser.roleOf(session.get("loginId"), project)) { role =>
+        defining(ProjectUser.roleOf(UserApp.currentUser.loginId, project)) { role =>
             if(role == "manager" || role == "member"){
-                CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
+                CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
             } else {
                 CodeApp.getURL(project.owner, project.name)
             }
app/views/code/partial_view_file.scala.html
--- app/views/code/partial_view_file.scala.html
+++ app/views/code/partial_view_file.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(project:Project, files:org.codehaus.jackson.node.ObjectNode, branch:String, path:String)
+@(project:Project, files:com.fasterxml.jackson.databind.node.ObjectNode, branch:String, path:String)
 
 @import utils.TemplateHelper._
 @import utils.TemplateHelper.CodeBrowser._
@@ -58,7 +58,7 @@
             <span id="commitMessage" class="commitMsg">@fieldText(files,"commitMessage")</span>
         </div>
         <div class="pull-right">
-            @if(!files.get("isBinary").getBooleanValue()){
+            @if(!files.get("isBinary").booleanValue()){
             <a href="@filePath" class="ybtn" target="_blank">
                 <i class="yobicon-download-alt yobicon-white vmiddle"></i> Raw
             </a>
@@ -71,7 +71,7 @@
     </div>
 
     @** Binary File **@
-    @if(files.get("isBinary").getBooleanValue()){
+    @if(files.get("isBinary").booleanValue()){
     @if(fieldText(files, "mimeType").indexOf("image/") == 0){
     <div id="showImage" class="image-wrap"><img src="@filePath"></div>
     } else {
@@ -87,7 +87,7 @@
     @** Text(Code) **@
     @defining(files.get("data")) { data =>
       @data match {
-        case null if files.get("size") != null && files.get("size").getIntValue > 0 => {
+        case null if files.get("size") != null && files.get("size").intValue > 0 => {
           <p>
           @Messages("code.tooBigFileForCodeBrowser", playRepository.PlayRepository.MAX_FILE_SIZE_CAN_BE_VIEWED)
           @if(UserApp.currentUser.isSiteManager) {
app/views/code/partial_view_folder.scala.html
--- app/views/code/partial_view_folder.scala.html
+++ app/views/code/partial_view_folder.scala.html
@@ -18,12 +18,12 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(project:Project, files:org.codehaus.jackson.JsonNode, branch:String, listPath:String)
+@(project:Project, files:com.fasterxml.jackson.databind.JsonNode, branch:String, listPath:String)
 
 @import utils.TemplateHelper.CodeBrowser._
 @import java.net.URLEncoder
 
-@makeFileItem(file:org.codehaus.jackson.JsonNode, fileName:String, listPath:String) = {
+@makeFileItem(file:com.fasterxml.jackson.databind.JsonNode, fileName:String, listPath:String) = {
     @defining(routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, URLEncoder.encode(branch, "UTF-8"), listPath).toString()) { filePath =>
     @defining(fieldText(file, "type")) { fileType =>
     <div id="cb-@listPath@fileName" class="row-fluid listitem" data-path="@getDataPath(listPath, fileName)">
@@ -52,12 +52,12 @@
     </div>
 
     @** no files **@
-    @if(files.getFieldNames().hasNext == false){
+    @if(files.fieldNames().hasNext == false){
     <div class="alert alert-warning nm" style="border-top:0; padding-left:23px;">@Messages("code.nofiles")</div>
     }
 
     @** folders **@
-    @for(fileName <- files.getFieldNames()){
+    @for(fileName <- files.fieldNames()){
         @defining(files.get(fileName)) { file =>
             @if(fieldText(file, "type").eq("folder")){
                 @makeFileItem(file, fileName, listPath)
@@ -66,7 +66,7 @@
     }
 
     @** files **@
-    @for(fileName <- files.getFieldNames()){
+    @for(fileName <- files.fieldNames()){
         @defining(files.get(fileName)) { file =>
             @if(!fieldText(file, "type").eq("folder")){
                 @makeFileItem(file, fileName, listPath)
app/views/code/view.scala.html
--- app/views/code/view.scala.html
+++ app/views/code/view.scala.html
@@ -18,14 +18,14 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(project:Project, branches:List[String], recursiveData:List[org.codehaus.jackson.node.ObjectNode], branch:String, path:String)
+@(project:Project, branches:List[String], recursiveData:List[com.fasterxml.jackson.databind.node.ObjectNode], branch:String, path:String)
 
 @import utils.TemplateHelper._
 @import utils.TemplateHelper.Branches._
 @import utils.TemplateHelper.CodeBrowser._
 @import java.net.URLEncoder
 
-@parseFileInfo(files:org.codehaus.jackson.node.ObjectNode) = {
+@parseFileInfo(files:com.fasterxml.jackson.databind.node.ObjectNode) = {
     @fieldText(files, "type") match {
         case "folder" => {
             @partial_view_folder(project, files.get("data"), branch, fieldText(files, "path"))
app/views/common/commentForm.scala.html
--- app/views/common/commentForm.scala.html
+++ app/views/common/commentForm.scala.html
@@ -24,7 +24,7 @@
 @import models.enumeration.ResourceType
 @import utils.AccessControl._
 
-@if(isResourceCreatable(User.findByLoginId(session.get("loginId")), container, resourceType)){
+@if(isResourceCreatable(UserApp.currentUser, container, resourceType)){
 
     <form id="comment-form" action="@action" method="post" enctype="multipart/form-data">
         <div class="write-comment-box">
app/views/common/debug.scala.html
--- app/views/common/debug.scala.html
+++ app/views/common/debug.scala.html
@@ -22,5 +22,5 @@
 @import play.api.Play.current
 
 <div class="container">
-    lang = @lang.code
+    lang = @implicitJavaLang.code
 </div>
app/views/common/scripts.scala.html
--- app/views/common/scripts.scala.html
+++ app/views/common/scripts.scala.html
@@ -101,7 +101,7 @@
 
         // current language set!
         if (typeof window.moment == "function" && typeof window.moment.lang == "function") {
-            moment.lang("@lang.language");
+            moment.lang("@implicitJavaLang.language");
         }
 
      	// yobi.Dropdown
@@ -120,10 +120,15 @@
                 $(htInfo.welTarget.parents("form").get(0)).submit();
             }
         });
-        @if(session.contains("loginId")){
-            yobi.ShortcutKey.setKeymapLink({
-            "P": "@routes.UserApp.userInfo(session.get("loginId"))"
-        });
+        @requestHeader.session.get("loginId") match {
+            case Some(loginId) => { }
+            case None => { }
+        }
+        @requestHeader.session.get("loginId") match {
+            case Some(v) => { yobi.ShortcutKey.setKeymapLink({
+                "P": "@routes.UserApp.userInfo(v)"
+            }); }
+            case None => { }
         }
 
         // yobi.Files
@@ -168,14 +173,11 @@
         }
 
         // notify flash messages
-        @for(key <- flash.keys) {
-            @if(key != utils.Constants.TITLE &&
-                key != utils.Constants.DESCRIPTION){
-                $yobi.notify("@Messages(flash.get(key))", 3000);
+        @requestHeader.flash.get(utils.Constants.TITLE) match {
+            case Some(title) => { $yobi.alert("@Messages(title)", null, "@Messages(requestHeader.flash.get(utils.Constants.DESCRIPTION).get)"); }
+            case None => { @requestHeader.flash.data.foreach {
+                case (_, value) => { $yobi.notify("@Messages(value)", 3000); }
             }
-            @if(key == utils.Constants.TITLE){
-                $yobi.alert("@Messages(flash.get(key))", null,
-                            "@Messages(flash.get(utils.Constants.DESCRIPTION))");
             }
         }
 
app/views/common/select2.scala.html
--- app/views/common/select2.scala.html
+++ app/views/common/select2.scala.html
@@ -22,7 +22,7 @@
 <script src="@routes.Assets.at("javascripts/lib/select2/select2.js")"></script>
 <script src="@routes.Assets.at("javascripts/common/yobi.ui.Select2.js")"></script>
 @{
-    lang.language match {
+    implicitJavaLang.language match {
         case "ko" => {
             Html("<script src=\"" + routes.Assets.at("javascripts/lib/select2/select2_locale_ko.js") + "\"></script>")
         }
app/views/common/usermenu.scala.html
--- app/views/common/usermenu.scala.html
+++ app/views/common/usermenu.scala.html
@@ -22,105 +22,108 @@
 @import utils.TemplateHelper._
 @orderString = @{"createdDate DESC"}
 <ul class="gnb-usermenu">
-    @if(session.contains("loginId")){
-    <li class="gnb-usermenu-dropdown">
-        <a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
-            <i class="yobicon-plus"></i>
-            <span class="caret"></span>
-        </a>
-        <ul class="dropdown-menu flat right">
-            <li>
-                <a href="@routes.ProjectApp.newProjectForm()">
-                    @Messages("button.newProject")
-                </a>
-            </li>
-            <li>
-                <a href="@routes.OrganizationApp.newForm()">
-                    @Messages("title.newOrganization")
-                </a>
-            </li>
-        </ul>
-    </li>
-    @if(session.get("userId").equals("1")) {
-    <li class="gnb-usermenu-item">
-        <a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
-            <i class="yobicon-wrench"></i>
-        </a>
-    </li>
-    }
-    <li class="gnb-usermenu-dropdown">
-        <a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
-            <span class="avatar-wrap smaller">
-                <img src="@User.findByLoginId(session.get("loginId")).avatarUrl" />
-            </span>
-            <span class="caret"></span>
-        </a>
-        <ul class="dropdown-menu flat right">
-            <li class="title">
-                @User.findByLoginId(session.get("loginId")).name <span class="disabled">@{"@"}@session.get("loginId")</span>
-            </li>
-            <li>
-                <a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.userInfo(session.get("loginId"))">@Messages("userinfo.profile")</a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.editUserInfoForm()">
-                    @Messages("userinfo.accountSetting")
-                 </a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.logout()">
-                    @Messages("title.logout")
-                </a>
-            </li>
-            @defining(UserApp.currentUser.getOrganizations(5)) { groups =>
-                <li class="title">
-                    @Messages("title.organization")
-                    <span class="numberic">@groups.size</span>
+    @requestHeader.session.get("loginId") match {
+      case Some(loginId) => {
+        <li class="gnb-usermenu-dropdown">
+            <a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
+                <i class="yobicon-plus"></i>
+                <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu flat right">
+                <li>
+                    <a href="@routes.ProjectApp.newProjectForm()">
+                        @Messages("button.newProject")
+                    </a>
                 </li>
-                @if(groups.length > 0) {
-                    @for(organization <- groups){
-                        <li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
+                <li>
+                    <a href="@routes.OrganizationApp.newForm()">
+                        @Messages("title.newOrganization")
+                    </a>
+                </li>
+            </ul>
+        </li>
+        @if(requestHeader.session.get("userId").equals("1")) {
+        <li class="gnb-usermenu-item">
+            <a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
+                <i class="yobicon-wrench"></i>
+            </a>
+        </li>
+        }
+        <li class="gnb-usermenu-dropdown">
+            <a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
+                <span class="avatar-wrap smaller">
+                    <img src="@User.findByLoginId(loginId).avatarUrl" />
+                </span>
+                <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu flat right">
+                <li class="title">
+                    @User.findByLoginId(loginId).name <span class="disabled">@{"@"}@loginId</span>
+                </li>
+                <li>
+                    <a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.userInfo(loginId)">@Messages("userinfo.profile")</a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.editUserInfoForm()">
+                        @Messages("userinfo.accountSetting")
+                    </a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.logout()">
+                        @Messages("title.logout")
+                    </a>
+                </li>
+                @defining(UserApp.currentUser.getOrganizations(5)) { groups =>
+                    <li class="title">
+                        @Messages("title.organization")
+                        <span class="numberic">@groups.size</span>
+                    </li>
+                    @if(groups.size > 0) {
+                        @for(organization <- groups){
+                            <li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
+                        }
+                    } else {
+                        <li class="empty">@Messages("organization.is.empty")</li>
                     }
-                } else {
-                    <li class="empty">@Messages("organization.is.empty")</li>
                 }
-            }
-            @defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
-                <li class="title">
-                    @Messages("project.recently.visited")
-                    <span class="numberic">@visitedProjects.size</span>
-                </li>
-                @if(visitedProjects.length > 0) {
-                    @for(visited <- visitedProjects){
-                        <li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
-                    }
-                } else {
-                    @defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
-                        @if(myProjects.length > 0) {
-                            @for(project <- myProjects){
-                                <li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
+                @defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
+                    <li class="title">
+                        @Messages("project.recently.visited")
+                        <span class="numberic">@visitedProjects.size</span>
+                    </li>
+                    @if(visitedProjects.size > 0) {
+                        @for(visited <- visitedProjects){
+                            <li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
+                        }
+                    } else {
+                        @defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
+                            @if(myProjects.size > 0) {
+                                @for(project <- myProjects){
+                                    <li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
+                                }
+                            } else {
+                                <li class="empty">@Messages("project.is.empty")</li>
                             }
-                        } else {
-                            <li class="empty">@Messages("project.is.empty")</li>
                         }
                     }
                 }
-            }
-        </ul>
-    </li>
-    } else {
-    <li>
-        <a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
-            @Messages("title.signup")
-        </a>
-    </li>
-    <li class="gnb-usermenu-item">
-        <a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
-            @Messages("title.login")
-        </a>
-    </li>
+            </ul>
+        </li>
+      }
+      case None => {
+        <li>
+            <a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
+                @Messages("title.signup")
+            </a>
+        </li>
+        <li class="gnb-usermenu-item">
+            <a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
+                @Messages("title.login")
+            </a>
+        </li>
+      }
     }
 </ul>
app/views/error/forbidden.scala.html
--- app/views/error/forbidden.scala.html
+++ app/views/error/forbidden.scala.html
@@ -28,7 +28,7 @@
       <i class="ico ico-err2"></i>
       <p>@Messages(messageKey)</p>
       @if(UserApp.currentUser.isAnonymous){
-      <a href="@routes.UserApp.loginForm?redirectUrl=@request.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
+      <a href="@routes.UserApp.loginForm?redirectUrl=@requestHeader.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
       }
     </div>
   </div>
app/views/git/create.scala.html
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[PullRequest], project:Project, projects:List[Project],
+@(title:String, form: play.data.Form[PullRequest], project:Project, projects:List[Project],
   fromProject:Project, toProject:Project,
   fromBranches:List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
   pullRequest:models.PullRequest)
app/views/git/edit.scala.html
--- app/views/git/edit.scala.html
+++ app/views/git/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[PullRequest], project:Project,
+@(title:String, form: play.data.Form[PullRequest], project:Project,
   fromBranches: List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
   pullRequest:models.PullRequest)
 
app/views/git/fork.scala.html
--- app/views/git/fork.scala.html
+++ app/views/git/fork.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: Form[Project], orgUserList:List[OrganizationUser])
+@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: play.data.Form[Project], orgUserList:List[OrganizationUser])
 
 @import utils.TemplateHelper._
 @import controllers.UserApp
app/views/git/partial_list.scala.html
--- app/views/git/partial_list.scala.html
+++ app/views/git/partial_list.scala.html
@@ -25,8 +25,8 @@
 @import org.apache.commons.lang3.StringUtils
 
 <ul class="post-list-wrap">
-@if(page.getList.size()> 0){
-    @for(req <- page.getList.iterator()) {
+@if(page.getList.size> 0){
+    @for(req <- page.getList.iterator) {
     @defining(User.findByLoginId(req.contributor.loginId)){ user =>
         <li class="post-item">
             <div class="span10">
app/views/git/partial_pull_request_event.scala.html
--- app/views/git/partial_pull_request_event.scala.html
+++ app/views/git/partial_pull_request_event.scala.html
@@ -55,7 +55,7 @@
             @if(event.newValue == PullRequestReviewAction.DONE.name) {
             <li class="event" id="comment-@event.id">
                 <span class="state changed">@Messages("pullRequest.review")</span>
-                @Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.name)))
+                @Html(Messages("notification.pullrequestHeader.reviewed",linkToUser(user.loginId, user.name)))
                 <span class="date">
                     <a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
                 </span>
@@ -63,7 +63,7 @@
             } else {
             <li class="event" id="comment-@event.id">
                 <span class="state changed">@Messages("pullRequest.unreview")</span>
-                @Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.name)))
+                @Html(Messages("notification.pullrequestHeader.unreviewed", linkToUser(user.loginId, user.name)))
                 <span class="date">
                     <a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
                 </span>
app/views/git/partial_reviewlist.scala.html
--- app/views/git/partial_reviewlist.scala.html
+++ app/views/git/partial_reviewlist.scala.html
@@ -32,7 +32,7 @@
             @thread.getFirstReviewComment().getContents()
         </p>
         <p class="info">
-            @defining(thread.reviewComments.size()-1) { numberOfComments =>
+            @defining(thread.reviewComments.size-1) { numberOfComments =>
                 @if(numberOfComments > 0) {
                     <span class="comments pull-left">
                         <i class="yobicon-comments"></i> @numberOfComments
app/views/git/partial_state.scala.html
--- app/views/git/partial_state.scala.html
+++ app/views/git/partial_state.scala.html
@@ -28,7 +28,7 @@
 
 @getCodeURL(project: Project) = @{
     if(ProjectUser.isMember(project.id, UserApp.currentUser().id)){
-        CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
+        CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
     } else {
         CodeApp.getURL(project.owner, project.name)
     }
app/views/git/viewChanges.scala.html
--- app/views/git/viewChanges.scala.html
+++ app/views/git/viewChanges.scala.html
@@ -47,7 +47,7 @@
                 </div>
             </div>
 
-            <div class="codediff-wrap mt10 @if(request.cookies.get("diffs-only") != null){diffs-only}">
+            <div class="codediff-wrap mt10 @if(requestHeader.cookies.get("diffs-only") != null){diffs-only}">
                 <button type="button" class="ybtn ybtn-default btn-show-reviewcards">
                     <i class="yobicon-restore"></i>
                 </button>
@@ -158,8 +158,8 @@
                         </button>
 
                         <ul class="nav nav-tabs" style="margin-bottom:10px;">
-                            <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size()</a></li>
-                            <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size()</a></li>
+                            <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size</a></li>
+                            <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size</a></li>
                         </ul>
 
                         <div class="tab-content review-list">
app/views/help/keymap.scala.html
--- app/views/help/keymap.scala.html
+++ app/views/help/keymap.scala.html
@@ -20,7 +20,7 @@
 **@
 @(section:String, project:Project)(implicit request: play.api.mvc.RequestHeader)
 
-@isMac = @{request.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
+@isMac = @{requestHeader.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
 @ctrl = @{if(isMac){"⌘"}else{"CTRL"}}
 
 <div class="pull-right" style="padding:10px 0;">
app/views/index/partial_notifications.scala.html
--- app/views/index/partial_notifications.scala.html
+++ app/views/index/partial_notifications.scala.html
@@ -51,7 +51,7 @@
 }
 
 @defining(NotificationEvent.findByReceiver(UserApp.currentUser, from, size)){ notifications =>
-    @if(notifications.size() == 0){
+    @if(notifications.size == 0){
     <div class="warning-none">
         <i class="yobicon-danger"></i> @Messages("notification.none")
     </div>
app/views/issue/create.scala.html
--- app/views/issue/create.scala.html
+++ app/views/issue/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, issueForm:Form[Issue], project:Project)
+@(title:String, issueForm: play.data.Form[Issue], project:Project)
 @import helper._
 @import scala.collection.mutable.Map
 @import models.enumeration.ResourceType
app/views/issue/edit.scala.html
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, issueForm:Form[Issue], issue:Issue,  project:Project)
+@(title:String, issueForm: play.data.Form[Issue], issue:Issue,  project:Project)
 @import helper._
 @import scala.collection.mutable.Map
 @import models.enumeration.ResourceType
app/views/issue/my_partial_list.scala.html
--- app/views/issue/my_partial_list.scala.html
+++ app/views/issue/my_partial_list.scala.html
@@ -70,13 +70,13 @@
                 </span>
                 }
 
-                @if(issue.comments.size()>0 || issue.voters.size()>0) {
+                @if(issue.comments.size>0 || issue.voters.size>0) {
                 <span class="infos-item item-count-groups">
-                    @if(issue.comments.size()>0){
-                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
+                    @if(issue.comments.size>0){
+                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
                     }
-                    @if(issue.voters.size()>0){
-                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
+                    @if(issue.voters.size>0){
+                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
                     }
                 </span>
                 }
app/views/issue/my_partial_list_quicksearch.scala.html
--- app/views/issue/my_partial_list_quicksearch.scala.html
+++ app/views/issue/my_partial_list_quicksearch.scala.html
@@ -25,7 +25,7 @@
     <li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
             data-author-id=""
-            data-assignee-id="@User.findByLoginId(session.get("loginId")).id"
+            data-assignee-id="@UserApp.currentUser.id"
             data-milestone-id="@param.milestoneId"
             data-mention-id="">
             @Messages("issue.list.assignedToMe")
@@ -33,7 +33,7 @@
     </li>
     <li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
-            data-author-id="@User.findByLoginId(session.get("loginId")).id"
+            data-author-id="@UserApp.currentUser.id"
             data-assignee-id=""
             data-milestone-id="@param.milestoneId"
             data-mention-id="">