public class Subroutine {
  private static void expect(boolean v) {
    if (! v) throw new RuntimeException();
  }

  // This test is intended to cover the jsr and ret instructions.
  // However, recent Sun javac versions avoid generating these
  // instructions by default, so we must compile this class using
  // -source 1.2 -target 1.1 -XDjsrlimit=0.
  //
  // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4381996
  //
  private static void test(boolean throw_) {
    int x = 42;
    int y = 99;
    int a = 0;
    try {
      try {
        int z = x + y;
        if (throw_) throw new DummyException();
        Integer.valueOf(z).toString();
      } finally {
        a = x + y;
        System.gc();
      }
      expect(a == x + y);
    } catch (DummyException e) {
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    test(false);
    test(true);
  }

  private static class DummyException extends RuntimeException { }
}

@@ -463,20 +463,39 @@
 n throw_
+, boolean predicate
 ) %7B%0A
-
     int 
@@ -622,24 +622,77 @@
 xception();%0A
+        if (predicate) %7B%0A          return;%0A        %7D%0A
         Inte
@@ -938,16 +938,46 @@
 st(false
+, false);%0A    test(false, true
 );%0A    t
@@ -980,24 +980,31 @@
    test(true
+, false
 );%0A  %7D%0A%0A  pr

add additional jsr test to Subroutine