Description
AutoCloseable::close
documentation mentions: “While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.”
Would you consider modifying the declaration of close() in Jsonb::close
(currently not declared thus inheriting from AutoCloseable
) as throwing JsonbException
?
Relatedly, the documentation of Jsonb
mentions: “Calling Closable.close() method will cleanup all CDI managed components (such as adapters with CDI dependencies) created during interaction with Jsonb.” Can I conclude that, if using Jsonb in Java SE (and no CDI), it is safe to not close the jsonb instances I create? If so, would you consider documenting that fact?