jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-45

Variant requires you to call add prior to call build

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.1
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      When you create a list of variants, you are required to call add to generate an intermediate list prior to calling build to generate the actual returned list. This can be confusing and easily missed and also seems unnecessary.

      for example:
      List<Variant> vs = Variant.mediaTypes("a/xml", "a/json").languages("en", "fr").build();
      results in an empty list, whereas
      List<Variant> vs = Variant.mediaTypes("a/xml", "a/json").languages("en", "fr").add().build();
      actually builds the list. All other similar structure with the spec simply use build to generate the result.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Marek Potociar
            Reporter:
            jsl123
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour
              1h