|
@@ -17,8 +17,6 @@
|
|
|
package org.springframework.security.web.method.annotation;
|
|
|
|
|
|
import java.lang.annotation.Annotation;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
import org.springframework.core.MethodParameter;
|
|
|
import org.springframework.expression.BeanResolver;
|
|
@@ -98,8 +96,6 @@ public final class AuthenticationPrincipalArgumentResolver implements HandlerMet
|
|
|
private SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder
|
|
|
.getContextHolderStrategy();
|
|
|
|
|
|
- private final Map<MethodParameter, Annotation> cachedAttributes = new ConcurrentHashMap<>();
|
|
|
-
|
|
|
private ExpressionParser parser = new SpelExpressionParser();
|
|
|
|
|
|
private SecurityAnnotationScanner<AuthenticationPrincipal> scanner = SecurityAnnotationScanners
|
|
@@ -179,8 +175,7 @@ public final class AuthenticationPrincipalArgumentResolver implements HandlerMet
|
|
|
*/
|
|
|
@SuppressWarnings("unchecked")
|
|
|
private <T extends Annotation> T findMethodAnnotation(MethodParameter parameter) {
|
|
|
- return (T) this.cachedAttributes.computeIfAbsent(parameter,
|
|
|
- (methodParameter) -> this.scanner.scan(methodParameter.getParameter()));
|
|
|
+ return (T) this.scanner.scan(parameter.getParameter());
|
|
|
}
|
|
|
|
|
|
}
|