|
@@ -142,15 +142,17 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
|
|
Collections.sort(webSecurityConfigurers, AnnotationAwareOrderComparator.INSTANCE);
|
|
Collections.sort(webSecurityConfigurers, AnnotationAwareOrderComparator.INSTANCE);
|
|
|
|
|
|
Integer previousOrder = null;
|
|
Integer previousOrder = null;
|
|
|
|
+ Object previousConfig = null;
|
|
for (SecurityConfigurer<Filter, WebSecurity> config : webSecurityConfigurers) {
|
|
for (SecurityConfigurer<Filter, WebSecurity> config : webSecurityConfigurers) {
|
|
Integer order = AnnotationAwareOrderComparator.lookupOrder(config);
|
|
Integer order = AnnotationAwareOrderComparator.lookupOrder(config);
|
|
if (previousOrder != null && previousOrder.equals(order)) {
|
|
if (previousOrder != null && previousOrder.equals(order)) {
|
|
throw new IllegalStateException(
|
|
throw new IllegalStateException(
|
|
"@Order on WebSecurityConfigurers must be unique. Order of "
|
|
"@Order on WebSecurityConfigurers must be unique. Order of "
|
|
- + order + " was already used, so it cannot be used on "
|
|
|
|
|
|
+ + order + " was already used on " + previousConfig + ", so it cannot be used on "
|
|
+ config + " too.");
|
|
+ config + " too.");
|
|
}
|
|
}
|
|
previousOrder = order;
|
|
previousOrder = order;
|
|
|
|
+ previousConfig = config;
|
|
}
|
|
}
|
|
for (SecurityConfigurer<Filter, WebSecurity> webSecurityConfigurer : webSecurityConfigurers) {
|
|
for (SecurityConfigurer<Filter, WebSecurity> webSecurityConfigurer : webSecurityConfigurers) {
|
|
webSecurity.apply(webSecurityConfigurer);
|
|
webSecurity.apply(webSecurityConfigurer);
|