Java gotcha o' the day
Monday, 18 February 2008
try { try { throw new RuntimeException("Lost?"); } finally { throw new RuntimeException("Interloper"); } } catch (Exception e) { System.out.println(e); }In hindsight I guess it's obvious that the exception thrown in the finally block would take precedence, but losing exceptions without having to explicitly deal with them seems quite the dangerous thing. It's just strange to say. That said, anyone throwing exceptions from a
finally
block should probably be strung up anyway.Labels: java, programming
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home