diff options
author | Vitaly Takmazov | 2017-10-06 17:01:19 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-10-06 17:03:11 +0300 |
commit | 2996fb8279645b1329b38c5c7b6d81ba3c10612e (patch) | |
tree | 56e73f9b7e116451193412ec3b60d481b444ef9a /juick-server-web/src/main/java/com | |
parent | 9cd6679f3f2804bc0b22cfb816f40b47846080cf (diff) |
server-core: start using jsr305
server-web: getCurrentUser() is not nullable
Diffstat (limited to 'juick-server-web/src/main/java/com')
-rw-r--r-- | juick-server-web/src/main/java/com/juick/server/util/UserUtils.java | 2 |
1 files changed, 2 insertions, 0 deletions
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()); |