diff --git a/core/src/main/java/org/acegisecurity/config/LogoutHandlerOrderResolver.java b/core/src/main/java/org/acegisecurity/config/LogoutHandlerOrderResolver.java index 04037c21a3..587715131e 100644 --- a/core/src/main/java/org/acegisecurity/config/LogoutHandlerOrderResolver.java +++ b/core/src/main/java/org/acegisecurity/config/LogoutHandlerOrderResolver.java @@ -68,20 +68,22 @@ public class LogoutHandlerOrderResolver implements BeanFactoryPostProcessor { RootBeanDefinition definition = (RootBeanDefinition) beanFactory.getBeanDefinition(names[i]); if (Ordered.class.isAssignableFrom(definition.getBeanClass())) { - definition.getPropertyValues().addPropertyValue("order", getOrder(definition.getBeanClass())); - list.add(definition); + definition.getPropertyValues().addPropertyValue("order", new Integer(getOrder(definition.getBeanClass()))); + } else { + definition.getPropertyValues().addPropertyValue("order", new Integer(Integer.MAX_VALUE)); } + list.add(definition); } Collections.sort(list, new OrderComparator()); return list; } - + private int getOrder(Class clazz) { if (clazz.getName().equals(TokenBasedRememberMeServices.class.getName())) { - return 0; + return 100; } if (clazz.getName().equals(SecurityContextLogoutHandler.class.getName())) { - return 1; + return 200; } return Integer.MAX_VALUE; } diff --git a/core/src/main/java/org/acegisecurity/config/PrincipalRepositoryBeanDefinitionParser.java b/core/src/main/java/org/acegisecurity/config/PrincipalRepositoryBeanDefinitionParser.java index 01c4258147..581c95f74f 100644 --- a/core/src/main/java/org/acegisecurity/config/PrincipalRepositoryBeanDefinitionParser.java +++ b/core/src/main/java/org/acegisecurity/config/PrincipalRepositoryBeanDefinitionParser.java @@ -197,10 +197,10 @@ public class PrincipalRepositoryBeanDefinitionParser extends AbstractBeanDefinit String propertyValue = element.getAttribute(ENABLED); if (StringUtils.hasText(propertyValue)) { if (propertyValue.equals("true")) { - userAttribute.setEnabled(Boolean.TRUE); + userAttribute.setEnabled(true); } else { - userAttribute.setEnabled(Boolean.FALSE); + userAttribute.setEnabled(false); } } }