From 901a4e183a82438717c12d6bbd0bdbd2bc5bf7cd Mon Sep 17 00:00:00 2001 From: stonio Date: Fri, 20 Jan 2017 18:27:59 +0100 Subject: [PATCH] Update SecurityContextHolder.java Use StringUtils.hasText --- .../security/core/context/SecurityContextHolder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/springframework/security/core/context/SecurityContextHolder.java b/core/src/main/java/org/springframework/security/core/context/SecurityContextHolder.java index 8b27e31bee..5cf052e545 100644 --- a/core/src/main/java/org/springframework/security/core/context/SecurityContextHolder.java +++ b/core/src/main/java/org/springframework/security/core/context/SecurityContextHolder.java @@ -17,6 +17,7 @@ package org.springframework.security.core.context; import org.springframework.util.ReflectionUtils; +import org.springframework.util.StringUtils; import java.lang.reflect.Constructor; @@ -93,7 +94,7 @@ public class SecurityContextHolder { } private static void initialize() { - if ((strategyName == null) || "".equals(strategyName)) { + if (!StringUtils.hasText(strategyName)) { // Set default strategyName = MODE_THREADLOCAL; }