Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7440

VariantListBuilderImpl build() don't work without add method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.8
    • 3.0.15, 3.1.13, 3.2.0
    • JAX-RS
    • None
    • Unknown

    Description

      Problem is within the class: org.apache.cxf.jaxrs.impl.VariantListBuilderImpl

      After calling:

      List<Variant> variants = Variant.mediaTypes(MediaType.APPLICATION_XML_TYPE, MediaType.APPLICATION_JSON_TYPE).build();
      

      The variants list is empty. To get the expected result you need to call add() before build(). But API states that there should be no need for that. Even example from the API doesn't add the "German" variant.

      List list = VariantListBuilder.newInstance()
               .languages(Locale.ENGLISH, Locale.FRENCH).encodings("zip", "identity").add()
               .languages(Locale.GERMAN).mediaTypes(MediaType.TEXT_PLAIN_TYPE)
               .build()
      

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            molsza Michal Olsza
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: