@Override public List<User> findUsersAllowEmptyQuery( final JiraServiceContext jiraServiceContext, final String query) { // is it allowed? How did they get here anyway?? if (!canPerformAjaxSearch(jiraServiceContext)) { return Collections.emptyList(); } StopWatch stopWatch = new StopWatch(); final String convertedQuery = (query == null) ? "" : query.toLowerCase().trim(); if (log.isDebugEnabled()) log.debug("Running user-picker search: '" + convertedQuery + "'"); List<User> returnUsers = new ArrayList<User>(); final boolean canShowEmailAddresses = canShowEmailAddresses(jiraServiceContext); final Collection<User> allUsers = userManager.getUsers(); if (log.isDebugEnabled()) log.debug("Found all " + allUsers.size() + " users in " + stopWatch.getIntervalTime() + "ms"); final Predicate<User> userMatcher = new UserMatcherPredicate(convertedQuery, canShowEmailAddresses); for (final User user : allUsers) { if (user.isActive() && userMatcher.apply(user)) { returnUsers.add(user); } } if (log.isDebugEnabled()) log.debug( "Matched " + returnUsers.size() + " users in " + stopWatch.getIntervalTime() + "ms"); Collections.sort( returnUsers, new UserBestNameComparator(jiraServiceContext.getI18nBean().getLocale())); if (log.isDebugEnabled()) { log.debug( "Sorted top " + returnUsers.size() + " users in " + stopWatch.getIntervalTime() + "ms"); log.debug("User-picker search completed in " + stopWatch.getTotalTime() + "ms"); } return returnUsers; }