struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (WW-4744) AnnotationWorkflowInterceptor should supports non-public annotated methods
Date Sun, 19 Mar 2017 16:16:41 GMT


ASF GitHub Bot commented on WW-4744:

GitHub user yasserzamani opened a pull request:

    WW-4744: AnnotationUtils supports non-public methods

    With these changes, AnnotationUtils also has equipped with an internal cache. Mainly,
getAnnotatedMethods and all it's usages have improved and equipped with enough unit tests
(also all findAnnotation usages have equipped).
    To avoid reinventing the wheel, I copied from Spring framework, So, I copied their license
and authors as well where needed :)

You can merge this pull request into a Git repository by running:

    $ git pull WW-4744

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #124
commit e1bb1a70c089b80b3924391da9d0268b5bcc29f3
Author: Yasser Zamani <>
Date:   2017-03-19T15:32:45Z

    WW-4744: AnnotationUtils supports non-public methods


> AnnotationWorkflowInterceptor should supports non-public annotated methods
> --------------------------------------------------------------------------
>                 Key: WW-4744
>                 URL:
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>            Reporter: zhouyanming
>             Fix For:
> {code:java}
> @Before
> protected String prepare(){
>     //TODO
>     return null;
> }
> {code}
> []
> {code:java}
> List<Method> methods = new ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(),
> {code}
> []
> {code:java}
> for (Method m : clazz.getMethods()) 
> {code}
> clazz.getMethods() only return public methods, so method "prepare" will be excluded,
and protected modifier is a good practice for intercept method.We should improve AnnotationUtils.getAnnotatedMethods()
to return all methods. Perhaps use an ConcurrentHashMap as cache is much better.

This message was sent by Atlassian JIRA

View raw message