From 56487ad1b78af39487811fc8c99de4833a411519 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 17 May 2016 10:57:08 +0200 Subject: [PATCH] remove if-statement and return immediately the instanceof result Signed-off-by: Michael Hirsch --- .../org/eclipse/hawkbit/security/SystemSecurityContext.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java index 409e714a0..f849eb541 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java @@ -88,10 +88,7 @@ public class SystemSecurityContext { * code block. */ public boolean isCurrentThreadSystemCode() { - if (SecurityContextHolder.getContext().getAuthentication() instanceof SystemCodeAuthentication) { - return true; - } - return false; + return SecurityContextHolder.getContext().getAuthentication() instanceof SystemCodeAuthentication; } private static void setSystemContext() {