mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
replace filter with predicate
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user