Skip to content

Commit d3b8bac

Browse files
author
Steve Riesenberg
committed
Polish InterceptMethodsBeanDefinitionDecorator
1 parent ce67fb0 commit d3b8bac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

config/src/main/java/org/springframework/security/config/method/InterceptMethodsBeanDefinitionDecorator.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
*/
7070
public class InterceptMethodsBeanDefinitionDecorator implements BeanDefinitionDecorator {
7171

72-
private final InternalAuthorizationManagerInterceptMethodsBeanDefinitionDecorator authorizationManagerDelegate =
73-
new InternalAuthorizationManagerInterceptMethodsBeanDefinitionDecorator();
72+
private final InternalAuthorizationManagerInterceptMethodsBeanDefinitionDecorator authorizationManagerDelegate = new InternalAuthorizationManagerInterceptMethodsBeanDefinitionDecorator();
73+
7474
private final BeanDefinitionDecorator delegate = new InternalInterceptMethodsBeanDefinitionDecorator();
7575

7676
@Override
@@ -198,7 +198,8 @@ private boolean matches(String mappedName, String methodName) {
198198
}
199199

200200
private boolean prefixMatches(String mappedName, String methodName) {
201-
return mappedName.endsWith("*") && methodName.startsWith(mappedName.substring(0, mappedName.length() - 1));
201+
return mappedName.endsWith("*")
202+
&& methodName.startsWith(mappedName.substring(0, mappedName.length() - 1));
202203
}
203204

204205
private boolean suffixMatches(String mappedName, String methodName) {
@@ -218,7 +219,8 @@ private static class PointcutMatchingAuthorizationManager implements Authorizati
218219
@Override
219220
public AuthorizationDecision check(Supplier<Authentication> authentication, MethodInvocation object) {
220221
for (Map.Entry<Pointcut, AuthorizationManager<MethodInvocation>> entry : this.managers.entrySet()) {
221-
Class<?> targetClass = (object.getThis() != null) ? AopUtils.getTargetClass(object.getThis()) : null;
222+
Class<?> targetClass = (object.getThis() != null) ? AopUtils.getTargetClass(object.getThis())
223+
: null;
222224
if (entry.getKey().getClassFilter().matches(targetClass)
223225
&& entry.getKey().getMethodMatcher().matches(object.getMethod(), targetClass)) {
224226
return entry.getValue().check(authentication, object);
@@ -251,7 +253,9 @@ void setExpressionHandler(SecurityExpressionHandler<MethodInvocation> expression
251253
}
252254

253255
}
256+
254257
}
258+
255259
/**
256260
* This is the real class which does the work. We need access to the ParserContext in
257261
* order to do bean registration.

0 commit comments

Comments
 (0)