[patch] Java definite assignment

Per Bothner per@bothner.com
Tue Feb 6 16:39:00 GMT 2001


Fergus Henderson <fjh@cs.mu.oz.au> writes:
> > String x; try { x = new String (); } finally {} x.toString ();
>> Surely it *should* issue an error message in that case.
> If `new String ()' throws an exception (e.g. because we're
> out of memory), then `x' will never get explicitly initialized.

But the x.toString() will never get executed either, so it doesn't
matter. I.e. we will never execute code that accesses x without
x having been assigned first.
-- 
	--Per Bothner
per@bothner.com http://www.bothner.com/~per/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /