Java 8: Collections.sort() can be replaced with List.sort()
This commit is contained in:
parent
25c06be1eb
commit
3a5d8ba696
|
@ -134,7 +134,7 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
||||||
private boolean addObjectPostProcessor(
|
private boolean addObjectPostProcessor(
|
||||||
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
||||||
boolean result = this.postProcessors.add(objectPostProcessor);
|
boolean result = this.postProcessors.add(objectPostProcessor);
|
||||||
Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE);
|
postProcessors.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class AuthenticationConfiguration {
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
public void setGlobalAuthenticationConfigurers(
|
public void setGlobalAuthenticationConfigurers(
|
||||||
List<GlobalAuthenticationConfigurerAdapter> configurers) throws Exception {
|
List<GlobalAuthenticationConfigurerAdapter> configurers) throws Exception {
|
||||||
Collections.sort(configurers, AnnotationAwareOrderComparator.INSTANCE);
|
configurers.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||||
this.globalAuthConfigurers = configurers;
|
this.globalAuthConfigurers = configurers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2327,7 +2327,7 @@ public final class HttpSecurity extends
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DefaultSecurityFilterChain performBuild() throws Exception {
|
protected DefaultSecurityFilterChain performBuild() throws Exception {
|
||||||
Collections.sort(filters, comparator);
|
filters.sort(comparator);
|
||||||
return new DefaultSecurityFilterChain(requestMatcher, filters);
|
return new DefaultSecurityFilterChain(requestMatcher, filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
|
||||||
webSecurity.debug(debugEnabled);
|
webSecurity.debug(debugEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.sort(webSecurityConfigurers, AnnotationAwareOrderComparator.INSTANCE);
|
webSecurityConfigurers.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||||
|
|
||||||
Integer previousOrder = null;
|
Integer previousOrder = null;
|
||||||
Object previousConfig = null;
|
Object previousConfig = null;
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
|
||||||
unorderedFilterChain.addAll(authBldr.getFilters());
|
unorderedFilterChain.addAll(authBldr.getFilters());
|
||||||
unorderedFilterChain.addAll(buildCustomFilterList(element, pc));
|
unorderedFilterChain.addAll(buildCustomFilterList(element, pc));
|
||||||
|
|
||||||
Collections.sort(unorderedFilterChain, new OrderComparator());
|
unorderedFilterChain.sort(new OrderComparator());
|
||||||
checkFilterChainOrder(unorderedFilterChain, pc, pc.extractSource(element));
|
checkFilterChainOrder(unorderedFilterChain, pc, pc.extractSource(element));
|
||||||
|
|
||||||
// The list of filter beans
|
// The list of filter beans
|
||||||
|
|
Loading…
Reference in New Issue