SEC-271: Replaced Java 5 specific code with pre Java 5
This commit is contained in:
parent
e67bff61a0
commit
84a3c87ea4
|
@ -68,20 +68,22 @@ public class LogoutHandlerOrderResolver implements BeanFactoryPostProcessor {
|
||||||
RootBeanDefinition definition = (RootBeanDefinition) beanFactory.getBeanDefinition(names[i]);
|
RootBeanDefinition definition = (RootBeanDefinition) beanFactory.getBeanDefinition(names[i]);
|
||||||
|
|
||||||
if (Ordered.class.isAssignableFrom(definition.getBeanClass())) {
|
if (Ordered.class.isAssignableFrom(definition.getBeanClass())) {
|
||||||
definition.getPropertyValues().addPropertyValue("order", getOrder(definition.getBeanClass()));
|
definition.getPropertyValues().addPropertyValue("order", new Integer(getOrder(definition.getBeanClass())));
|
||||||
list.add(definition);
|
} else {
|
||||||
|
definition.getPropertyValues().addPropertyValue("order", new Integer(Integer.MAX_VALUE));
|
||||||
}
|
}
|
||||||
|
list.add(definition);
|
||||||
}
|
}
|
||||||
Collections.sort(list, new OrderComparator());
|
Collections.sort(list, new OrderComparator());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getOrder(Class clazz) {
|
private int getOrder(Class clazz) {
|
||||||
if (clazz.getName().equals(TokenBasedRememberMeServices.class.getName())) {
|
if (clazz.getName().equals(TokenBasedRememberMeServices.class.getName())) {
|
||||||
return 0;
|
return 100;
|
||||||
}
|
}
|
||||||
if (clazz.getName().equals(SecurityContextLogoutHandler.class.getName())) {
|
if (clazz.getName().equals(SecurityContextLogoutHandler.class.getName())) {
|
||||||
return 1;
|
return 200;
|
||||||
}
|
}
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,10 +197,10 @@ public class PrincipalRepositoryBeanDefinitionParser extends AbstractBeanDefinit
|
||||||
String propertyValue = element.getAttribute(ENABLED);
|
String propertyValue = element.getAttribute(ENABLED);
|
||||||
if (StringUtils.hasText(propertyValue)) {
|
if (StringUtils.hasText(propertyValue)) {
|
||||||
if (propertyValue.equals("true")) {
|
if (propertyValue.equals("true")) {
|
||||||
userAttribute.setEnabled(Boolean.TRUE);
|
userAttribute.setEnabled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
userAttribute.setEnabled(Boolean.FALSE);
|
userAttribute.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue