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.
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?
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.