Avoid bug in JDT/UI test by widening search scope only when needed see https://bugs.eclipse.org/bugs/show_bug.cgi?id=559681#c9