You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2017/11/28 10:43:17 UTC

[jira] [Closed] (CXF-7440) VariantListBuilderImpl build() don't work without add method

     [ https://issues.apache.org/jira/browse/CXF-7440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh closed CXF-7440.
------------------------------------

> VariantListBuilderImpl build() don't work without add method
> ------------------------------------------------------------
>
>                 Key: CXF-7440
>                 URL: https://issues.apache.org/jira/browse/CXF-7440
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.8
>            Reporter: Michal Olsza
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 3.0.15, 3.1.13, 3.2.0
>
>
> Problem is within the class: {{org.apache.cxf.jaxrs.impl.VariantListBuilderImpl}}
> After calling:
> {code}
> List<Variant> variants = Variant.mediaTypes(MediaType.APPLICATION_XML_TYPE, MediaType.APPLICATION_JSON_TYPE).build();
> {code}
> The {{variants}} list is empty. To get the expected result you need to call {{add()}} before {{build()}}. But [API states|http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Variant.VariantListBuilder.html#build--] that there should be no need for that. Even example from the API doesn't add the "German" variant.
> {code}
> List list = VariantListBuilder.newInstance()
>          .languages(Locale.ENGLISH, Locale.FRENCH).encodings("zip", "identity").add()
>          .languages(Locale.GERMAN).mediaTypes(MediaType.TEXT_PLAIN_TYPE)
>          .build()
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)