Right: (with or without closures) there is no guarantee that any particular method completes normally unless it is specified to do so.<br><br><div class="gmail_quote">On Sun, Nov 16, 2008 at 3:44 PM, Vladimir Kirichenko <span dir="ltr">&lt;<a href="mailto:vladimir.kirichenko@gmail.com">vladimir.kirichenko@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Neal Gafter wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
All of the examples I&#39;ve seen where you could get into this kind of &quot;trouble&quot; involve making locally obvious errors. &nbsp;The exception points you precisely to where you made the mistake, too. &nbsp;In this case the temp() method clearly constructs a closure that should not escape its scope (it has a return in it) yet is assigned to a static variable.<br>

</blockquote>
<br></div>
The main point was to show that after the<br>
<br>
unrestrictedClosure.invoke()<br>
<br>
there are to guaranty that the following statements will execute.<br>
<br>
so there will be no exception but the code will not be executed:<br>
<br>
void m ({int ===&gt; void} t) {<br>
<br>
 &nbsp; &nbsp; &nbsp;t.invoke(i);<br>
<br>
 &nbsp; &nbsp; &nbsp;System.out.println(&quot;who knows if we ever get here...&quot;);<br>
<br>
 &nbsp; }<br>
<br>
Doesn&#39;t it look strange?<br>
<br>
-- <br>
Best Regards,<br><font color="#888888">
Vladimir Kirichenko<br>
<br>
</font></blockquote></div><br>