Skip to content

Commit

Permalink
Remove concurrent hashmap because it cannot handle null values.
Browse files Browse the repository at this point in the history
Need to use another approach if concurrency is required.
  • Loading branch information
tastybento committed Jun 3, 2024
1 parent d831722 commit f68af55
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
Expand All @@ -12,7 +13,6 @@
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import org.bukkit.Bukkit;
Expand Down Expand Up @@ -51,9 +51,9 @@ public class IslandCache {
private final @NonNull Database<Island> handler;

public IslandCache(@NonNull Database<Island> handler) {
islandsById = new ConcurrentHashMap<>();
islandsByUUID = new ConcurrentHashMap<>();
grids = new ConcurrentHashMap<>();
islandsById = new HashMap<>();
islandsByUUID = new HashMap<>();
grids = new HashMap<>();
this.handler = handler;
}

Expand Down

0 comments on commit f68af55

Please sign in to comment.