Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Nov 20, 2024
1 parent c10e233 commit 263e7f0
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,8 @@ public Class<?>[] getSpecificTargetClasses() {

@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
Expand Down

0 comments on commit 263e7f0

Please sign in to comment.