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(
|
||||
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
||||
boolean result = this.postProcessors.add(objectPostProcessor);
|
||||
Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE);
|
||||
postProcessors.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class AuthenticationConfiguration {
|
|||
@Autowired(required = false)
|
||||
public void setGlobalAuthenticationConfigurers(
|
||||
List<GlobalAuthenticationConfigurerAdapter> configurers) throws Exception {
|
||||
Collections.sort(configurers, AnnotationAwareOrderComparator.INSTANCE);
|
||||
configurers.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||
this.globalAuthConfigurers = configurers;
|
||||
}
|
||||
|
||||
|
|
|
@ -2327,7 +2327,7 @@ public final class HttpSecurity extends
|
|||
|
||||
@Override
|
||||
protected DefaultSecurityFilterChain performBuild() throws Exception {
|
||||
Collections.sort(filters, comparator);
|
||||
filters.sort(comparator);
|
||||
return new DefaultSecurityFilterChain(requestMatcher, filters);
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
|
|||
webSecurity.debug(debugEnabled);
|
||||
}
|
||||
|
||||
Collections.sort(webSecurityConfigurers, AnnotationAwareOrderComparator.INSTANCE);
|
||||
webSecurityConfigurers.sort(AnnotationAwareOrderComparator.INSTANCE);
|
||||
|
||||
Integer previousOrder = null;
|
||||
Object previousConfig = null;
|
||||
|
|
|
@ -164,7 +164,7 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
|
|||
unorderedFilterChain.addAll(authBldr.getFilters());
|
||||
unorderedFilterChain.addAll(buildCustomFilterList(element, pc));
|
||||
|
||||
Collections.sort(unorderedFilterChain, new OrderComparator());
|
||||
unorderedFilterChain.sort(new OrderComparator());
|
||||
checkFilterChainOrder(unorderedFilterChain, pc, pc.extractSource(element));
|
||||
|
||||
// The list of filter beans
|
||||
|
|
Loading…
Reference in New Issue