void () { final Preferences preferences = Preferences.getInstance(); // try to inline 'preferences' final Bar bar = new Bar(<caret>preferences.getComponent()); bar.toString(); ThreadUtils.run(new Runnable() { public void run() { final Foo foo = new Foo(); foo.setSize(preferences.getDimension().getSize()); } }); }