+ public static void main(String s[]) throws Exception
+ {
+ // we are asserting that the finally clause of an exception handler will still
+ // fire when an exception is raised in the catch clause. otherwise, all our
+ // assumptions about being able to use finally properly are thrown out the window.
+ behavior_of_finally_when_exception_in_catch tony = new behavior_of_finally_when_exception_in_catch();
+ try {
+ tony.runTest();
+ } catch (Throwable cause) {
+ // yawn.
+ }
+ System.out.println("the finally clause needs to have run above; otherwise, we've got bad problems.");
+ if (!tony.ranRight) {
+ System.out.println("FAILURE in assumptions about the finally clause!!!");
+ } else {
+ System.out.println("okay, cool. test succeeded.");
+ }
+ }