Transfer#close() is being called before Transfer#init() has been called.
close() just needs to check if out != null before calling out.flush().

To be honest, this is a weird test-case. People don't normally call stop() 
immediately after start().

But the whole construction of Transfer is a little dodgy. I would prefer to 
initialise the fields [socket,in,out,ssl] in
the constructor and make them final, so that we know for sure that they are 
initialised before the constructor returns.

I can't see any point in the current process because we always init() 
immediately after calling the constructor, except
for one place in TcpServerThread where we might as well call it immediately 
because we already have a functioning socket.

That way close() won't need any changes, and the code becomes safer.

-- Noel

Thomas Mueller wrote:
> Hi,
>
> I can't reproduce the problem. Could you post a complete, simple, 
> reproducible test case? See also http://sscce.org/
>
> Regards,
> Thomas
> -- 
> You received this message because you are subscribed to the Google Groups "H2 
> Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/h2-database?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to