[ 
https://issues.apache.org/jira/browse/WW-4744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15934141#comment-15934141
 ] 

ASF GitHub Bot commented on WW-4744:
------------------------------------

Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/124#discussion_r107079345
  
    --- Diff: 
core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java ---
    @@ -37,13 +40,25 @@
      * @author Rainer Hermanns
      * @author Zsolt Szasz, zsolt at lorecraft dot com
      * @author Dan Oxlade, dan d0t oxlade at gmail d0t c0m
    + * @author Rob Harrop
    + * @author Juergen Hoeller
    + * @author Sam Brannen
    + * @author Mark Fisher
    + * @author Chris Beams
    + * @author Phillip Webb
    --- End diff --
    
    I'm not sure if adding those authors here makes any sense, in most cases we 
(at ASF) trying to remove the `@author` tag also asking those users about this 
class can confuse them.


> AnnotationWorkflowInterceptor should supports non-public annotated methods
> --------------------------------------------------------------------------
>
>                 Key: WW-4744
>                 URL: https://issues.apache.org/jira/browse/WW-4744
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Interceptors
>            Reporter: zhouyanming
>             Fix For: 2.5.next
>
>
> {code:java}
> @Before
> protected String prepare(){
>     //TODO
>     return null;
> }
> {code}
> [https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationWorkflowInterceptor.java#L115]
> {code:java}
> List<Method> methods = new 
> ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(), 
> Before.class));
> {code}
> [https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java#L123]
> {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
(v6.3.15#6346)

Reply via email to