[
https://issues.apache.org/jira/browse/WW-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853240#comment-15853240
]
ASF GitHub Bot commented on WW-4694:
------------------------------------
GitHub user yasserzamani opened a pull request:
https://github.com/apache/struts/pull/117
[WW-4694] annotation processing improved
With these changes,
[AnnotationUtils](https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java)
can navigate around proxies, superclasses and interfaces.
known issue: for keep it simple, currently it does not support [Bridge
Methods](https://docs.oracle.com/javase/tutorial/java/generics/bridgeMethods.html).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/yasserzamani/struts WW-4694
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/struts/pull/117.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 #117
----
commit c84b7967e9eb2f6307466b1644977423831d2ef1
Author: Yasser Zamani <[email protected]>
Date: 2017-02-05T14:24:28Z
[WW-4694] annotation processing improved in order to navigate around
proxies, superclasses and interfaces
----
> AnnotationWorkflowInterceptor doesn't work with spring proxied action
> ---------------------------------------------------------------------
>
> Key: WW-4694
> URL: https://issues.apache.org/jira/browse/WW-4694
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Reporter: zhouyanming
> Fix For: 2.5.next
>
>
> {code:java}
> public String intercept(ActionInvocation invocation) throws Exception {
> final Object action = invocation.getAction();
> invocation.addPreResultListener(this);
> List<Method> methods = new
> ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(),
> Before.class));
> {code}
> if action is annotated with @Transactional ,
> AnnotationUtils.getAnnotatedMethods() will always return empty collection.
> here is my quick fix
> {code:java}
> public static Collection<Method> getAnnotatedMethods(Class clazz,
> Class<? extends Annotation>... annotation){
> if( SpringProxy.class.isAssignableFrom(clazz) )
> clazz = clazz.getSuperclass();
> {code}
> but it will add spring dependence, I hope there is an elegant way.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)