Michal Olsza created CXF-7440:
---------------------------------
Summary: 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
Priority: Minor
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)