New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify inheritance semantics of annotations ProviderType and ConsumerType #643
Comments
@kwin We discussed the whole thing for half an hour and have some ideas. Just to help us along a bit: Can you provide a small dummy class example to make this easier to grasp? the issue |
The Annotations are not marked with It would make sense to mention this in the javadoc. |
I added an example with README in https://github.com/kwin/providerconsumerexample which outlines the inconsistencies here. |
There is no inheritance for these annotations. |
Currently it is not clear from the javadoc of either ProviderType or ConsumerType which role annotation wins in case multiple ones apply (from the same package).
According to Bnd it is nearest wins, so in case you have class
A
extendingB
. AndB
extendingC
, the role ofB
overwrites the role ofC
(i.e. ifC
is marked as ProviderType butB
is not having any role annotation at all it is assumed to be the default (i.e. ConsumerType) andA
has a broad import-package version range).Also if you have
A
both extendingB
as well as implementingZ
andZ
is a ProviderType, the ProviderType role wins (only relevant ifZ
andB
are located in the same package).The text was updated successfully, but these errors were encountered: