From 2996fb8279645b1329b38c5c7b6d81ba3c10612e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 6 Oct 2017 17:01:19 +0300 Subject: server-core: start using jsr305 server-web: getCurrentUser() is not nullable--- juick-server-web/src/main/java/com/juick/server/util/UserUtils.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'juick-server-web/src') 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()); -- cgit v1.2.3