void (@NotNull String pattern, @NotNull final Set<Object> elements, @NotNull final ProgressIndicator indicator, boolean everywhere) { long start = System.currentTimeMillis(); myProvider.filterElements( ChooseByNameBase.this, pattern, everywhere, indicator, o -> { if (indicator.isCanceled()) return false; if (o == null) { LOG.error("Null returned from " + myProvider + " with " + myModel + " in " + ChooseByNameBase.this); return true; } elements.add(o); if (isOverflow(elements)) { elements.add(EXTRA_ELEM); return false; } return true; } ); if (myAlwaysHasMore) { elements.add(EXTRA_ELEM); } if (ContributorsBasedGotoByModel.LOG.isDebugEnabled()) { long end = System.currentTimeMillis(); ContributorsBasedGotoByModel.LOG.debug("addElementsByPattern("+pattern+"): "+(end-start)+"ms; "+elements.size()+" elements"); } }