[jboss-jira] [JBoss JIRA] (WFWIP-77) smallrye-config: Converter Priority is not upheld

Jeff Mesnil (JIRA) issues at jboss.org
Wed Aug 1 13:27:00 EDT 2018


    [ https://issues.jboss.org/browse/WFWIP-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13613419#comment-13613419 ] 

Jeff Mesnil commented on WFWIP-77:
----------------------------------

The issue seems related to the test fixture.

When the converters comes from a module dependency, the @Priority annotation is not found on the class and smallrye-config uses the default value (100) at https://github.com/smallrye/smallrye-config/blob/b7d0b9fbdf14151ec89507b4f3475e8641a2fd8c/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java#L175

When I modify the test fixture so that the converters are bundled with the deployment, the test passes.
It is a bug that the annotation is missing from the class when it is loaded through modules but that's done outside of smallrye-config or the subsystem.


> smallrye-config: Converter Priority is not upheld
> -------------------------------------------------
>
>                 Key: WFWIP-77
>                 URL: https://issues.jboss.org/browse/WFWIP-77
>             Project: WildFly WIP
>          Issue Type: Bug
>          Components: MP Config
>            Reporter: Michal Jurc
>            Assignee: Jeff Mesnil
>            Priority: Blocker
>
> Consider a scenario with two {{Coverter}} services available in service loader:
> {code}@Priority(101)
> public class Return101Converter implements Converter<Integer> {
>     @Override
>     public Integer convert(String value) {
>         return 101;
>     }
> }
> {code}
> {code}@Priority(102)
> public class Return102Converter implements Converter<Integer> {
>     @Override
>     public Integer convert(String value) {
>         return 102;
>     }
> }
> {code}
> The {{@Priority}} of the {{Converter}} services is not considered, instead, their order in provider configuration file is - the first implementation will always be preferred.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list