replace filter with predicate

This commit is contained in:
Sebastian Sdorra
2014-01-09 20:16:03 +01:00
parent 908f2fe6c8
commit 4f6460eeae
10 changed files with 48 additions and 110 deletions

View File

@@ -35,13 +35,12 @@ package sonia.scm.cache;
//~--- non-JDK imports --------------------------------------------------------
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicate;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.Filter;
//~--- JDK imports ------------------------------------------------------------
import java.util.Set;
@@ -178,13 +177,13 @@ public class GuavaCache<K, V> implements Cache<K, V>
* @return
*/
@Override
public boolean removeAll(Filter<K> filter)
public boolean removeAll(Predicate<K> filter)
{
Set<K> keysToRemove = Sets.newHashSet();
for (K key : cache.asMap().keySet())
{
if (filter.accept(key))
if (filter.apply(key))
{
keysToRemove.add(key);
}