Polishing

This commit is contained in:
rstoyanchev
2024-11-20 14:38:17 +00:00
parent c10e23387d
commit 263e7f007c

View File

@@ -48,16 +48,8 @@ public class ActionPropertyAccessor implements PropertyAccessor {
@Override
public boolean canRead(EvaluationContext context, Object target, String name) {
// Ensure the target is an Action.
if (!(target instanceof Action)) {
return false;
}
// Ensure the method adheres to the signature required by:
// Action: execute(RequestContext)
// or
// MultiAction: <method name>(RequestContext)
Method method = ReflectionUtils.findMethod(target.getClass(), name, RequestContext.class);
return (method != null);
return (target instanceof Action &&
ReflectionUtils.findMethod(target.getClass(), name, RequestContext.class) != null);
}
@Override