Skip to content

Commit

Permalink
What is the contract for of JsonGenerator#close() on error? jakartaee…
Browse files Browse the repository at this point in the history
…#156

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Oct 4, 2021
1 parent d166d5d commit d9445cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/main/java/jakarta/json/stream/JsonGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ public interface JsonGenerator extends Flushable, /*Auto*/Closeable {
* Closes this generator and frees any resources associated with it.
* This method closes the underlying output source.
*
* The underlying stream is closed only if complete JSON object is written. In case
* of incomplete object JsonGenerationException is thrown and underlying stream is
* not closed.
*
* @throws jakarta.json.JsonException if an i/o error occurs (IOException
* would be cause of JsonException)
* @throws JsonGenerationException if an incomplete JSON is generated
Expand Down

0 comments on commit d9445cb

Please sign in to comment.