On Monday, 13 August 2012 at 15:32:45 UTC, Dmitry Olshansky wrote:
Back to Java: what is I find strange is the lack of sensible tools to do transactional or exception safe code within the language. No RAII objects or just at least any kludge to reliably register cleanup/rollback, only "good" old try/finally.

Since Java 7, you have the same tools Haskell, Scheme, Lisp, C# and Python already offer for such cases.

For example:


try (BufferedReader br =
                   new BufferedReader(new FileReader(path))) {
        return br.readLine();
}

--
Paulo

Reply via email to