[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates
wolfc
do-not-reply at jboss.com
Tue Aug 19 06:11:27 EDT 2008
"adrian at jboss.org" wrote : The idea of DeclaredMethodSignature is to get something working.
|
| I'd much rather use MethodSignature, it's just a case of finding a way to
| do it without adding performance penalities to (or even worse breaking)
| existing code.
|
| Like I said in an earlier post, once we know how to do that, we can retrofit
| DeclaredMethodSignature to be:
|
|
| | @Deprecated // legacy hack
| | public class DeclaredMethodSignature extends MethodSignature { ... }
| |
|
Although I agree, I don't see how that's possible. MethodSignature only works if you know the class hierarchy.
class A { void postConstruct() {} }
| class B extends A { void postConstruct() {} }
For object A1: MethodSignature postConstruct equals DeclaredMethodSignature A.postConstruct.
For object B1: MethodSignature postConstruct equals DeclaredMethodSignature B.postConstruct.
If I had @PostConstruct on A.postConstruct:
For object A1: has annotation @PostConstruct on MethodSignature postConstruct
For object B1: has no annotation @PostConstruct on MethodSignature postConstruct
while both MethodSignatures are equal.
I would say:
m1 = memoryMetaDataLoaderA.getComponentSignature(methodSignaturePostConstruct);
| m2 = memoryMetaDataLoaderA.getComponentSignature(declaredMethodSignatureAPostConstruct);
| assert m1.equals(m2);
and
m1 = memoryMetaDataLoaderB.getComponentSignature(methodSignaturePostConstruct);
| m2 = memoryMetaDataLoaderB.getComponentSignature(declaredMethodSignatureAPostConstruct);
| m3 = memoryMetaDataLoaderB.getComponentSignature(declaredMethodSignatureBPostConstruct);
| assert !m1.equals(m2);
| assert m1.equals(m3);
Right?
"adrian at jboss.org" wrote : Add it if you want, or raise a JIRA issue.
The assertion only highlights the problem, it doesn't solve anything.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171213#4171213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171213
More information about the jboss-dev-forums
mailing list