[e-lang] Notes from latest Joe-E meeting
Tyler Close
tyler.close at gmail.com
Thu Apr 26 20:40:01 EDT 2007
Another possibility:
Error abort = null;
try {
... anything but assignment to abort ...
} catch (final Error e) {
abort = e;
} finally {
if (null != abort) { throw abort; }
}
Tyler
On 4/26/07, Tyler Close <tyler.close at gmail.com> wrote:
> On 4/26/07, Mark Miller <erights at gmail.com> wrote:
> > - There is an attack with try-finally and VirtualMachineError.
> > try {
> > ... X ...
> > } catch (final Error reason) {
> > throw JoeE.abort(reason);
> > } finally {
> > ... Y ...
> > }
>
> We could change the boilerplate for a finally clause to:
>
> try {
> ...
> } catch (final Error e) {
> while (true) { try { JoeE.abort(e); break; } catch (Throwable t) {} }
> throw e;
> } finally {
> ...
> }
>
> This is weird but is still better than banning finally clauses
> entirely. We could then document that this insanity would go away if
> Java supported Keepers and point to a JSR.
>
> The JLS doesn't give us any guarantees on what can be relied upon when
> an Error is thrown, but I suspect the above code is safe. Anyone have
> any expectations otherwise?
>
> Tyler
>
> --
> The web-calculus is the union of REST and capability-based security:
> http://www.waterken.com/dev/Web/
>
> Name your trusted sites to distinguish them from phishing sites.
> https://addons.mozilla.org/firefox/957/
>
--
The web-calculus is the union of REST and capability-based security:
http://www.waterken.com/dev/Web/
Name your trusted sites to distinguish them from phishing sites.
https://addons.mozilla.org/firefox/957/
More information about the e-lang
mailing list