[jboss-jira] [JBoss JIRA] Commented: (JBAOP-305) annotations not found for non-generic implementations of generic interface methods
Stale Pedersen (JIRA)
jira-events at lists.jboss.org
Fri Nov 23 10:41:18 EST 2007
[ http://jira.jboss.com/jira/browse/JBAOP-305?page=comments#action_12388938 ]
Stale Pedersen commented on JBAOP-305:
--------------------------------------
Ive implemented and tested the testcase but i cant find any problems with our aop code. Annotations do not inherit on method level only class level. So annotations defined in (abstract) classes thats inherited will not be available for the subclass.
In the testcase the methods that fail are whats called bridge methods in Java and they behave the same way with annotations. Look at http://java.sun.com/docs/books/jls/third_edition/html/expressions.html (search for bridge) for more information about bridge methods.
- if Ive overlooked something please let us know and we'll reopen the issue.
> annotations not found for non-generic implementations of generic interface methods
> ----------------------------------------------------------------------------------
>
> Key: JBAOP-305
> URL: http://jira.jboss.com/jira/browse/JBAOP-305
> Project: JBoss AOP
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 1.5.3.GA
> Reporter: Havoc Pennington
> Assigned To: Stale Pedersen
> Fix For: 2.0.0.CR1
>
> Attachments: aop-test.patch, GenericsBaseClass.java, GenericsSubClass.java, GenericsSubInterface.java, GenericsSuperInterface.java, SomethingOrOther.java
>
>
> I'm not sure if this is an AOP problem or a how-jboss-is-using-AOP-on-EJB3-session-beans problem, but I'll file it here to start.
> The original issue is TransactionAttribute(NEVER) being ignored on certain session bean methods, the test case / details on that are in this list post:
> http://groups.google.com/group/mugshot/browse_thread/thread/bc43e0dd34c8c5ab/9a7773a162f29bde#9a7773a162f29bde
> I made an AOP test case that either shows an AOP problem or shows a way jboss could easily misuse AOP.
> In the AOP test case, If there is an interface Foo<T> with method frobate(T t), then you look that up in AOP as resolveAnnotation("frobate", new Class[] { Object.class })
> But if you implement that interface ("class FooImpl implements Foo<Double>") then you have to look that up in AOP as
> resolveAnnotation("frobate", new Class[] { Double.class }) - looking it up with the erasure (Object.class arg) will not work, it returns null for the annotation.
> So if someone were iterating over methods in the interface, looking each one up on the implementing class, they would not get the annotation for any generic methods in the interface implemented in the class.
> The case that's going wrong in EJB3 is a little bit more complicated, so maybe there is some attempt at handling this that isn't catching all the cases.
> It looks like further investigation requires messing with jboss TxInterceptor etc. itself, which is a little bit more than I think I can bite off, but hopefully this info is a helpful start.
> Thanks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list