Describe the bug
It seems there is a regression on the following issue #389. I originally reported the issue here spring-projects/spring-boot#35651.
To Reproduce
FileWriter writer = new FileWriter("output.json");
Jsonb jsonb = JsonbBuilder.create();
jsonb.toJson(Collections.singletonMap("a", "alpha"), writer);
jsonb.toJson(Collections.singletonMap("a", "alpha"), writer);
Expected behavior
toJson not closing the writer.
System information:
- OS: Windows
- Java Version: 17
- Yasson Version: 3.0.3
Additional context
This issue seems to be introduced with version 3.0.3. Version 3.0.2 and below work as expected.