|
@@ -15,13 +15,13 @@
|
|
*/
|
|
*/
|
|
package org.springframework.security.config.annotation;
|
|
package org.springframework.security.config.annotation;
|
|
|
|
|
|
-import org.springframework.core.GenericTypeResolver;
|
|
|
|
-import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
|
|
|
-
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import org.springframework.core.GenericTypeResolver;
|
|
|
|
+import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* A base class for {@link SecurityConfigurer} that allows subclasses to only implement
|
|
* A base class for {@link SecurityConfigurer} that allows subclasses to only implement
|
|
* the methods they are interested in. It also provides a mechanism for using the
|
|
* the methods they are interested in. It also provides a mechanism for using the
|
|
@@ -115,7 +115,6 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
public Object postProcess(Object object) {
|
|
public Object postProcess(Object object) {
|
|
- Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE);
|
|
|
|
for (ObjectPostProcessor opp : postProcessors) {
|
|
for (ObjectPostProcessor opp : postProcessors) {
|
|
Class<?> oppClass = opp.getClass();
|
|
Class<?> oppClass = opp.getClass();
|
|
Class<?> oppType = GenericTypeResolver.resolveTypeArgument(oppClass,
|
|
Class<?> oppType = GenericTypeResolver.resolveTypeArgument(oppClass,
|
|
@@ -134,7 +133,9 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|
*/
|
|
*/
|
|
private boolean addObjectPostProcessor(
|
|
private boolean addObjectPostProcessor(
|
|
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
|
ObjectPostProcessor<? extends Object> objectPostProcessor) {
|
|
- return this.postProcessors.add(objectPostProcessor);
|
|
|
|
|
|
+ boolean result = this.postProcessors.add(objectPostProcessor);
|
|
|
|
+ Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE);
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|