You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 2.x, JsonParser and JsonGenerator enable JsonParser.Feature.AUTO_CLOSE_SOURCE and JsonGenerator.Feature.AUTO_CLOSE_TARGET by default. I think it is too intrusive and aggressive to enable these features by default since they operate on input/output stream not owned by parser/generator as the javadoc states.
Besides this, I found YAMLGenerator closes input/output stream always without consulting these features. This makes me can't use ObjectMapper.writeValue(OutputStream out, Object value) to write yaml content embedded in another stream, say zipped file stream.
PS: I saw these features are migrated to StreamReadFeature and StreamWriteFeature in master.
The text was updated successfully, but these errors were encountered:
was the issue; fixed now in 2.9.8. It's a good idea to report these directly for project.
We can definitely consider default settings for 3.0, but the reason for these settings is that I experienced the opposite pain when frameworks like Stax (XML API) did the opposite and left hanging file handles, sometimes running out and causing service failures. So there is a reason why default is that way.
Same is true for some other features, such as "fail on unknown properties": debugging problems when nothing matches is annoying. But I can see how the opposite setting can be problematic as well.
One thing I'll need to figure out is how to collect all ideas for changing defaults. I think they should be considered as a group, as sort of "Jackson Improvement Project" or something, for bigger v3 changes/additions.
In 2.x,
JsonParser
andJsonGenerator
enableJsonParser.Feature.AUTO_CLOSE_SOURCE
andJsonGenerator.Feature.AUTO_CLOSE_TARGET
by default. I think it is too intrusive and aggressive to enable these features by default since they operate on input/output stream not owned by parser/generator as the javadoc states.Besides this, I found
YAMLGenerator
closes input/output stream always without consulting these features. This makes me can't useObjectMapper.writeValue(OutputStream out, Object value)
to write yaml content embedded in another stream, say zipped file stream.PS: I saw these features are migrated to
StreamReadFeature
andStreamWriteFeature
inmaster
.The text was updated successfully, but these errors were encountered: