Ok, let me take slightly different tack here: existing
`CLOSE_CLOSEABLE` only refers to root values, so I am hesitant to
extend semantics to cover use by individual serializers.

This is slightly orthogonal to the question here then, whether closing
of stream objects should occur, and if so, could it be prevented.
It kind of seems to be like they should be auto-closed, as I'm not
sure there's much value in keeping them open.
At the same time, of course, closing could fail if serialization
itself fails before reaching stream (or does not follow object
path)...

So I guess I don't have strong opinion. Other than not expanding
CLOSE_CLOSEABLE semantics in this case :)

-+ Tatu +-


On Tue, Jun 20, 2017 at 12:05 PM, Jeff Maxwell <[email protected]> wrote:
> The trouble with j.u.s.Streams is that they don't call close on error or
> terminal operations so they can easily leave resources open, details here.
>
> And since they are unusable after being touched, I don't think we should use
> allow CLOSE_CLOSABLE functionality.
>
> On Tuesday, June 20, 2017 at 1:40:24 PM UTC-5, Tatu Saloranta wrote:
>>
>> I don't think you should need any additional processing, since this
>> feature is only handled by ObjectMapper/ObjectWriter, based on ....
>> oh. Implementation of `Closeable`. But. What we really is
>> `AutoCloseable`...
>>
>> So, the big question is... since `AutoCloseable` was added in Java 7,
>> and since we can rely on that now with 2.9, should we use that
>> instead.
>>
>> It's a kind of sizable change, but seems to me like the Right Thing To Do?
>> Or, should we wait until 3.0?
>>
>> -+ Tatu +-
>>
>>
>>
>>
>>
>>
>> On Tue, Jun 20, 2017 at 7:52 AM, Jeff Maxwell <[email protected]> wrote:
>> > Currently I do not consider the CLOSE_CLOSEABLE option when dealing with
>> > j.u.s.Streams.
>> >
>> > Given the nature of j.u.s.Streams I believe this is the safest choice,
>> > especially since CLOSE_CLOSEABLE defaults to 'false'.
>> >
>> > Any thoughts?
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "jackson-dev" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [email protected].
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to