Object lck = lock; synchronized (lck) { try { System.out.println("foo"); } catch (Exception e) { e.printStackTrace(); } finally { if (lock != null) { lock.notify(); } } } }
Object lck = lock; synchronized (lck) { try { System.out.println("foo"); } catch (RuntimeException e) { e.printStackTrace(); } finally { if (lock != null) { lock.notify(); } } } }
  void foo() {  Object lck = lock;    synchronized (lck) {    try {	System.out.println("foo");    } catch (Exception e) {	e.printStackTrace();    } finally {       if (lock != null) {	lock.notify();       }    }    }  }