This content has been marked as final.
Show 2 replies
-
1. Re: ClassInfo::getAnnotations bug
flavia.rainone Oct 22, 2009 12:32 PM (in response to alesj)"Ales" wrote:
The fix for Managed could be:
* make @ManagementObject @Inherited
* check the whole hierarchy
I think there is a misunderstanding here. You said you wanted ClassInfo.getAnnotations to return only the declared annotations. I followed the nomenclature used on JDK, that says that declared annotations excludes inherited annotations. So, the way it is implemented now, it doesn't matter if @ManagementObject is inherited or not, because getAnnotations method is ignoring the inherited annotations.
Before we changed the getAnnotations implementation, this method was returning exactly all the annotations of that particular class plus the inherited ones, as it was delegating to Class<?>.getAnnotations. This was being tested and that's why I had to change the tests to make them pass with the new implementation."Ales" wrote:
I still prefer the way JDK does it. :-)
So maybe we should revert the changes and add a getDeclaredAnnotations method to AnnotatedInfo, similar to java.lang.reflect.AnnotatedElement interface? -
2. Re: ClassInfo::getAnnotations bug
alesj Oct 22, 2009 4:54 PM (in response to alesj)Forget about this post. :-)
Looks like there was several oversights from my side.
* @ManagementObject is already @Inherited.
* gave bad instructions to Flavia
* probably my Deployers failing test was a result of some bug in my mc-ann code.
I guess we could introduce declared annotations,
but since this only differs for classes,
in that case one can use my set intersection suggestion.