[ http://issues.apache.org/jira/browse/BEEHIVE-257?page=all ] James Song closed BEEHIVE-257: ------------------------------
Test is added by r191519 and passes. > control inheritance: annotation on a jcx not inherited correctly > ---------------------------------------------------------------- > > Key: BEEHIVE-257 > URL: http://issues.apache.org/jira/browse/BEEHIVE-257 > Project: Beehive > Type: Bug > Components: Controls > Versions: V1Beta > Reporter: James Song > Assignee: James Song > Fix For: V1Beta > > This is reported by David Read, and might blocks OAM developments. > The inheritance hirachey: > The JCX hierarchy looks like: > ===================== > TopLevelJcx extends InheritanceTest > ^ > FirstLevelJcx extends TopLevelJcx > ^ > SecondLevelJcx extends FirstLevelJcx > The annotation: > @PropertySet(externalConfig = true) > @Retention(RetentionPolicy.RUNTIME) > @Inherited > public @interface MyAnnotation > { > String value() default "DEFAULT"; > } > The annotation exists on TopLevelJcx and on SecondLevelJcx, but not in the > "middle" (FirstLevelJcx). The "client side is a JPF that has two fields for > each type ... one with no annotation on the field and one with an annotation > on the field. > > I see the field overrides working and the override where there is an > annotation on the JCX (SecondLevelJcx). It's the one in the middle that > seems busted. What's odd is that the value that is returned from the context > is the default value for the property. I would have expected a null value > for the annotation itself. It's like it's stuck half way between being there > and not being there. > > Ken's comment on this: > "I thought this might have been done as part of the general "support > inheritance" work, but looking at the code I can believe it doesn't work :). > > Dave, what's your example look like from the client access perspective? Ie, > how are you attempting to get the inherited annotation? > > Seems like the right place to do this is in > AnnotatedElementMap.getProperty(), where today we just call getAnnotation() > on the java.lang.reflect.AnnotatedElement (which, per docs, will not walk up > the interface tree), we need to manually do a breadth-first walk up." -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira