Make fields final if possible to ensure immutability

This commit is contained in:
thatsIch
2014-09-29 09:54:34 +02:00
parent 35f6c84d9f
commit 474596f095
261 changed files with 607 additions and 597 deletions
@@ -11,7 +11,7 @@ import appeng.api.storage.data.IAEItemStack;
public class OreHelper
{
public static OreHelper instance = new OreHelper();
public static final OreHelper instance = new OreHelper();
class ItemRef
{
@@ -28,9 +28,9 @@ public class OreHelper
hash = ref.hashCode() ^ damage;
}
Item ref;
int damage;
int hash;
final Item ref;
final int damage;
final int hash;
@Override
public boolean equals(Object obj)
@@ -58,7 +58,7 @@ public class OreHelper
}
HashMap<ItemRef, OreResult> references = new HashMap<ItemRef, OreResult>();
final HashMap<ItemRef, OreResult> references = new HashMap<ItemRef, OreResult>();
public OreReference isOre(ItemStack ItemStack)
{