Skip to content

Commit

Permalink
Define concrete type in order to avoid accidental re-assignment with …
Browse files Browse the repository at this point in the history
…another collection
  • Loading branch information
raoulvdberge committed May 24, 2017
1 parent a62d2e2 commit d3c7c67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

Expand All @@ -24,15 +23,15 @@ public class NetworkNodeManager extends WorldSavedData implements INetworkNodeMa
private static final String NBT_NODE_DATA = "Data";
private static final String NBT_NODE_POS = "Pos";

private Map<BlockPos, INetworkNode> nodes = new ConcurrentHashMap<>();
private ConcurrentHashMap<BlockPos, INetworkNode> nodes = new ConcurrentHashMap<>();

public NetworkNodeManager(String s) {
super(s);
}

@Override
public void readFromNBT(NBTTagCompound tag) {
Map<BlockPos, INetworkNode> newNodes = new ConcurrentHashMap<>();
ConcurrentHashMap<BlockPos, INetworkNode> newNodes = new ConcurrentHashMap<>();

if (tag.hasKey(NBT_NODES)) {
NBTTagList list = tag.getTagList(NBT_NODES, Constants.NBT.TAG_COMPOUND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class StorageCacheFluid implements IStorageCache<FluidStack> {
private INetwork network;
private List<IStorage<FluidStack>> storages = new CopyOnWriteArrayList<>();
private CopyOnWriteArrayList<IStorage<FluidStack>> storages = new CopyOnWriteArrayList<>();
private IStackList<FluidStack> list = API.instance().createFluidStackList();

public StorageCacheFluid(INetwork network) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class StorageCacheItem implements IStorageCache<ItemStack> {
private INetwork network;
private List<IStorage<ItemStack>> storages = new CopyOnWriteArrayList<>();
private CopyOnWriteArrayList<IStorage<ItemStack>> storages = new CopyOnWriteArrayList<>();
private IStackList<ItemStack> list = API.instance().createItemStackList();

public StorageCacheItem(INetwork network) {
Expand Down

0 comments on commit d3c7c67

Please sign in to comment.