[
https://issues.apache.org/jira/browse/WW-4744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16057214#comment-16057214
]
ASF GitHub Bot commented on WW-4744:
------------------------------------
GitHub user yasserzamani opened a pull request:
https://github.com/apache/struts/pull/144
WW-4744 WW-4694 Removes annotation search to commons lang 3.6
During resolution of WW-4744 and WW-4694, I duplicated some works with
annotations into Apache commons lang. Now, they just released them 😃 So this PR
removes them from S2 which make it more light and decreases it's tests
execution time 👌
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/yasserzamani/struts WW-4744
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/struts/pull/144.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #144
----
commit 33e1eeb386c98beeaeff51504a2ff156098f2c01
Author: Yasser Zamani <[email protected]>
Date: 2017-06-21T08:58:45Z
WW-4744 WW-4694 Removes annotation search to commons lang 3.6
----
> 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.4.14#64029)