users@jsonp.java.net

Re: JsonWriter is missing flush() method

From: Jitendra Kotamraju <jitendra.kotamraju_at_oracle.com>
Date: Fri, 01 Nov 2013 12:17:42 -0700

On 11/1/13 8:27 AM, Przemysław Bielicki wrote:
> Hi Jitu,
>
> thanks for your comments.
>
> I'm using 1.0.4-SNAPSHOT but I have to pull latest changes.
I verified on GlassFish, without closing the JsonWriter, the contents
are written in HTTP response. It works for both character stream and
byte stream. I will check-in the app to the workspace.
>
> In (not only) my opinion JsonWriter should be extending also Flushable
> interface (in addition to (Auto)Closable). This is the cleanest and
> most obvious solution - workarounds proposed are ugly and should not
> apply for this newly developed JSONP API. I know that this is a
> modification of a public API but I'm not sure this API is already
> approved or it's still under development. Even if it's approved it
> could be a patch or (1.0.1 release :)
>
> Please note that all the other solution proposed either by me or you
> are implementation dependent. This small change in API makes it
> flexible and available for all possible implementations.
>
> I will open a JIRA issue beg next week.
>
> Have a nice weekend!
> Przemyslaw