class Test { void foo() { final String str = ""; if (str == "") { return; } new Runnable() { public void run() { System.out.println(str); } } } }