jersey
  1. jersey
  2. JERSEY-1415

WebTarget#matrixParam(name, null) removes too much

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m07
    • Fix Version/s: 2.0-m09, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Suppose this:

      WebTarget createWebTarget() throws Fault {
      	Client client = ClientFactory.newClient();
      	WebTarget target = client.target(URL);
      	return target;
      }
      
      WebTarget target = createWebTarget();
      target = target.matrixParam("matrix1", "segment1");
      target = target.path("path1");
      target = target.matrixParam("matrix2", "segment1");
      target = target.matrixParam("matrix2", new Object[] { null });
      target = target.path("path2");
      target = target.matrixParam("matrix1", "segment1");
      target = target.matrixParam("matrix1", new Object[] { null });
      target = target.path("path3");
      URI uri = target.getUri();
      

      Here, I'd assume uri shall be URL + ";matrix1=segment1/path1/path2/path3", but it is only URL + "path3".
      It not only removed matrix params from different segments, it also removed the path.
      The javadoc says:

      In case a single null value is entered, all parameters with that name in the current final path segment are removed (if present) from the collection of last segment matrix parameters inherited from the current target.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Miroslav Fuksa
            Reporter:
            jan.supol
          • 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 - 4 hours
              4h