Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: yasson on SpringBoot: IOException Stream Closed #604

Open
IndyNaessens opened this issue May 30, 2023 · 2 comments
Open

Regression: yasson on SpringBoot: IOException Stream Closed #604

IndyNaessens opened this issue May 30, 2023 · 2 comments
Labels
bug Something isn't working right

Comments

@IndyNaessens
Copy link

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.

@IndyNaessens IndyNaessens added the bug Something isn't working right label May 30, 2023
@Degubi
Copy link
Contributor

Degubi commented Jul 10, 2023

Seems to be caused by #586, reverting this fixes it for me

@jamezp
Copy link

jamezp commented Oct 6, 2023

#586 is the correct fix according the Jsonb.fromJson() JavaDoc.

stream - The stream is read as a JSON data. Upon a successful completion, the stream will be closed by this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

3 participants