mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-27 14:22:47 +00:00
Sort ObjectPostProcessors prior to invoking them
Fixes gh-3572
This commit is contained in:
parent
3bbcbaae9c
commit
a366489c3c
@ -15,10 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.security.config.annotation;
|
package org.springframework.security.config.annotation;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.core.GenericTypeResolver;
|
import org.springframework.core.GenericTypeResolver;
|
||||||
|
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A base class for {@link SecurityConfigurer} that allows subclasses to only implement
|
* A base class for {@link SecurityConfigurer} that allows subclasses to only implement
|
||||||
@ -27,6 +29,7 @@ import org.springframework.core.GenericTypeResolver;
|
|||||||
* that is being configured.
|
* that is being configured.
|
||||||
*
|
*
|
||||||
* @author Rob Winch
|
* @author Rob Winch
|
||||||
|
* @author Wallace Wadge
|
||||||
*
|
*
|
||||||
* @param <O> The Object being built by B
|
* @param <O> The Object being built by B
|
||||||
* @param <B> The Builder that is building O and is configured by
|
* @param <B> The Builder that is building O and is configured by
|
||||||
@ -112,6 +115,7 @@ 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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user