1 class CrazyException { 2 void blackhole() {} 3 public static Object foo(boolean cond) { 4 var x = new CrazyException(); 5 for (int i=0; i< 100; ++i) { 6 if (cond) { 7 try { 8 x.blackhole(); // not inline. escape here. 9 } finally { // hidden catch(Throwable) is here! 10 close(); 11 } 12 } 13 } 14 return x; 15 } 16 17 public static void close() {} 18 public static void main(String[] args) { 19 for (int i = 0; i < 20_000; ++i) { 20 CrazyException.foo(0 == ( i& 0xf)); 21 } 22 } 23 }