Skip to content

Commit

Permalink
fix(cats): Remove use of unmodifiable collections (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert authored Oct 17, 2017
1 parent 805bad5 commit 6b0586b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import com.netflix.dyno.jedis.DynoJedisPipeline;
import com.netflix.spinnaker.cats.cache.CacheData;
import com.netflix.spinnaker.cats.cache.DefaultCacheData;
import com.netflix.spinnaker.cats.dynomite.DynomiteClientDelegate;
import com.netflix.spinnaker.cats.dynomite.DynomiteClientDelegate.ClientDelegateException;
import com.netflix.spinnaker.cats.compression.CompressionStrategy;
import com.netflix.spinnaker.cats.compression.NoopCompression;
import com.netflix.spinnaker.cats.dynomite.DynomiteClientDelegate;
import com.netflix.spinnaker.cats.dynomite.DynomiteClientDelegate.ClientDelegateException;
import com.netflix.spinnaker.cats.redis.cache.AbstractRedisCache;
import com.netflix.spinnaker.cats.redis.cache.RedisCacheOptions;
import net.jodah.failsafe.Failsafe;
Expand All @@ -41,7 +41,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
Expand Down Expand Up @@ -253,7 +252,7 @@ protected void evictItems(String type, List<String> identifiers, Collection<Stri
@Override
protected Collection<CacheData> getItems(String type, List<String> ids, List<String> knownRels) {
if (ids.isEmpty()) {
return Collections.emptyList();
return new ArrayList<>();
}

AtomicInteger hmgetAllOperations = new AtomicInteger();
Expand Down Expand Up @@ -386,7 +385,7 @@ private MergeOp buildHashedMergeOp(String type, CacheData cacheData, Map<String,

private Map<CacheData, Map<String, String>> getAllHashes(String type, Collection<CacheData> items) {
if (isHashingDisabled(type)) {
return Collections.emptyMap();
return new HashMap<>();
}

return redisClientDelegate.withPipeline(pipeline -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public Collection<CacheData> getAll(String type,
Collection<String> identifiers,
CacheFilter cacheFilter) {
if (identifiers.isEmpty()) {
return Collections.emptySet();
return new ArrayList<>();
}
Collection<String> ids = new LinkedHashSet<>(identifiers);
final List<String> knownRels;
Expand Down

0 comments on commit 6b0586b

Please sign in to comment.