Skip to content

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

@jamezp

Description

@jamezp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions