aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-server-core/build.gradle1
-rw-r--r--juick-server-web/src/main/java/com/juick/server/util/UserUtils.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/juick-server-core/build.gradle b/juick-server-core/build.gradle
index 83a02452..fa7883ba 100644
--- a/juick-server-core/build.gradle
+++ b/juick-server-core/build.gradle
@@ -17,6 +17,7 @@ dependencies {
compile "rocks.xmpp:xmpp-extensions-client:0.7.4"
compile "javax.inject:javax.inject:1"
+ compile 'com.google.code.findbugs:jsr305:3.0.2'
testCompile "junit:junit:${rootProject.junitVersion}"
testCompile "org.hamcrest:hamcrest-all:${rootProject.hamcrestVersion}"
diff --git a/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java b/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java
index e6dc5fa2..ab5c320b 100644
--- a/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java
+++ b/juick-server-web/src/main/java/com/juick/server/util/UserUtils.java
@@ -20,6 +20,7 @@ package com.juick.server.util;
import com.juick.User;
import com.juick.server.helpers.AnonymousUser;
import com.juick.service.security.entities.JuickUser;
+import javax.annotation.Nonnull;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
@@ -39,6 +40,7 @@ public class UserUtils {
return authentication == null ? null : authentication.getPrincipal();
}
+ @Nonnull
public static User getCurrentUser() {
Object principal = getPrincipal(getAuthentication());