class A { void foo() { String s = null; try { s = "1"; int invisibleOutsideTry = 1 + 1; bar(); s = s + invisibleOutsideTry; } catch (Exception e) { System.out.println("ex " + s); } System.out.println("ok " + s); } private void bar() throws Exception { throw new Exception(); } }