boolean needRefresh; synchronized (this) { if (isShowFailuresOnly()) { needRefresh= true; } else { needRefresh= fNeedRefresh; }
TestRoot testRoot; if (fTestRunSession != null) { testRoot= fTestRunSession.getTestRoot(); } else { testRoot= null; fNeedRefresh= true;
	public void processChangesInUI() {		boolean needRefresh;		synchronized (this) {			if (isShowFailuresOnly()) { //TODO: performance: add/remove elements, don't refresh				needRefresh= true;			} else {				needRefresh= fNeedRefresh;			}		}				if (needRefresh) {			registerViewerRefresh();			fNeedRefresh= false;			TestRoot testRoot;			synchronized (this) {				if (fTestRunSession != null) {					testRoot= fTestRunSession.getTestRoot();				} else {					testRoot= null;				}			}			fTreeViewer.setInput(testRoot);					} else {			Object[] toUpdate;			synchronized (this) {				toUpdate= fNeedUpdate.toArray();				fNeedUpdate.clear();			}			fTreeViewer.update(toUpdate, null);		}		autoScrollInUI();	}