Skip to content

Commit

Permalink
Fix creates immutable set of mutable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Feniksovich committed Jul 8, 2022
1 parent 5eff05e commit e35dd2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/feniksovich/proxypackfix/CacheManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.feniksovich.proxypackfix;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class CacheManager {

Expand All @@ -15,7 +17,7 @@ public void add(final UUID uuid, final String hash) {
if (cache.containsKey(uuid)) {
cache.get(uuid).add(hash);
} else {
cache.put(uuid, Set.of(hash));
cache.put(uuid, Stream.of(hash).collect(Collectors.toSet()));
}
plugin.debugLog("Added cache record for " + uuid + " with hash " + hash);
}
Expand Down

0 comments on commit e35dd2f

Please sign in to comment.