Ver código fonte

SEC-817: NPE in org.springframework.security.config.FilterChainProxyPostProcessor
Reversed order of beanName.equals() call as suggested.

Luke Taylor 17 anos atrás
pai
commit
301d021bf5

+ 1 - 1
core/src/main/java/org/springframework/security/config/FilterChainProxyPostProcessor.java

@@ -44,7 +44,7 @@ public class FilterChainProxyPostProcessor implements BeanPostProcessor, BeanFac
     private ListableBeanFactory beanFactory;
     
     public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
-        if(!beanName.equals(BeanIds.FILTER_CHAIN_PROXY)) {
+        if(!BeanIds.FILTER_CHAIN_PROXY.equals(beanName)) {
             return bean;
         }
         

+ 1 - 1
core/src/main/java/org/springframework/security/config/MethodSecurityInterceptorPostProcessor.java

@@ -23,7 +23,7 @@ public class MethodSecurityInterceptorPostProcessor implements BeanPostProcessor
     private BeanFactory beanFactory;
 
     public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
-        if(!beanName.equals(BeanIds.METHOD_SECURITY_INTERCEPTOR)) {
+        if(!BeanIds.METHOD_SECURITY_INTERCEPTOR.equals(beanName)) {
             return bean;
         }
 

+ 1 - 1
core/src/main/java/org/springframework/security/config/RememberMeServicesInjectionBeanPostProcessor.java

@@ -33,7 +33,7 @@ public class RememberMeServicesInjectionBeanPostProcessor implements BeanPostPro
                 logger.info("Setting RememberMeServices on bean " + beanName);
                 pf.setRememberMeServices(getRememberMeServices());
             }
-        } else if (beanName.equals(BeanIds.BASIC_AUTHENTICATION_FILTER)) {
+        } else if (BeanIds.BASIC_AUTHENTICATION_FILTER.equals(beanName)) {
             // NB: For remember-me to be sent back, a user must submit a "_spring_security_remember_me" with their login request.
             // Most of the time a user won't present such a parameter with their BASIC authentication request.
             // In the future we might support setting the AbstractRememberMeServices.alwaysRemember = true, but I am reluctant to