Skip to content

Commit

Permalink
Minor fix from #4324 (auto-close of SegmentedStringWriter)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 17, 2024
1 parent b16046a commit 47daacb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4035,8 +4035,8 @@ public String writeValueAsString(Object value)
throws JsonProcessingException
{
// alas, we have to pull the recycler directly here...
SegmentedStringWriter sw = new SegmentedStringWriter(_jsonFactory._getBufferRecycler());
try {
try (SegmentedStringWriter sw = new SegmentedStringWriter(_jsonFactory._getBufferRecycler());
){
_writeValueAndClose(createGenerator(sw), value);
return sw.getAndClear();
} catch (JsonProcessingException e) {
Expand Down

0 comments on commit 47daacb

Please sign in to comment.