sr = initialSearchResults();
}
else if (sr.hasResultsList()) {
Object[] resultsArray = ((Set<TBPersistable>)((SearchResults)sr).getResults()).toArray();
REFINE: for ( int i = 0; i < resultsArray.length; i++ ) {
TBPersistable refineCandidate = (TBPersistable)resultsArray[i];
if ( selectedItems != null ) {
for ( int j = 0; j < selectedItems.length; j++ ) {
Long id = Long.parseLong(selectedItems[j]);
if ( id.compareTo(refineCandidate.getId()) == 0 ) {
LOGGER.debug("Keeping result "+refineCandidate.getId());
continue REFINE;
}
}
}
LOGGER.debug("Removing result "+refineCandidate.getId());
sr.getResults().remove(refineCandidate);
}
sr.announceSize(LOGGER);
AbstractService service = getSearchService().getAppropriateService(sr);
service.resurrectAll(sr.getResults());