This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: YA Socket timeout patch
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Nic Ferrier <nferrier at tf1 dot tapsellferrier dot co dot uk>
- Cc: java-patches at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 12:56:59 +1300
- Subject: Re: YA Socket timeout patch
- References: <E16FknM-0005sv-00@tf1.tapsellferrier.co.uk>
Nic Ferrier wrote:
>>I don't agree. In this case there is no superclass that is going to mess
>>with the value, it is safe and more efficient to not explicitly
>>initialize it. I'd prefer if you removed them.
>>
>
>Safer to not initialize? How can it be safe to not initialize? I don't
>understand your issue here really, if it does cause increased size
>it's only tiny... Surely it's better to have explicit initialization
>and pay for the very small increase?
>
It is safe to not initialize because Java guarantees that all fields
will always be initialized to 0 or null. However as Eric pointed out,
its not safe for the *compiler* to optimize away such initializations
because the possibility exists that a superclass initializer could
somehow set the value before your initializer is run. In this case we
know that can never happen!
regards
Bryce.