jsonp
  1. jsonp
  2. JSONP-3

JsonWriter closes the underlying output stream

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      I've the following code in a Servlet:

      PrintWriter out = response.getWriter();
      JsonObject jsonObject = new JsonObjectBuilder().build();
      new JsonWriter(out).writeObject(jsonObject);
      jsonObject = new JsonObjectBuilder()
      .add("apple", "red")
      .add("banana", "yellow")
      .build();
      new JsonWriter(out).writeObject(jsonObject);

      Only the first jsonObject is written to the output stream. If the call to first writeObject is commented then the second jsonObject is written to the stream as well.

      Seems like the underlying OutputStream is closed along with writeObject call.

        Activity

        Hide
        jitu added a comment -

        Fixed in the repo. Will be part of b04 promotion.

        Show
        jitu added a comment - Fixed in the repo. Will be part of b04 promotion.

          People

          • Assignee:
            jitu
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: