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

Clarify for the jsonb.fromJson() methods should close the InputStream or Reader arguments #350

Closed
jamezp opened this issue Oct 17, 2023 · 1 comment

Comments

@jamezp
Copy link

jamezp commented Oct 17, 2023

The JavaDoc for Jsonb.fromJson() is inconsistent between the Reader and InputStream arguments.

The Jsonb.fromJson(InputStream, ?) states the following for the stream argument.

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

The Reader versions do not state the reader will be closed. I would argue the correct behavior should be the stream is not closed. As pointed out in, not closing the stream would be consistent with Properties.load() and KeyStore.load().

There is also no description of what should happen on an unsuccessful completion.

In either case, it seems the Reader and InputStream methods should behave the same. If the decision to close the streams is made, there needs to be some clarification on what happens with an unsuccessful completion.

@jamezp
Copy link
Author

jamezp commented Oct 17, 2023

Oops, I missed #346 this is a duplicate. Sorry about that.

@jamezp jamezp closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant