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
@@ -16,6 +16,6 @@ public class AEGlassMaterial extends Material
return false;
}
public static AEGlassMaterial instance = (new AEGlassMaterial( MapColor.airColor ));
public static final AEGlassMaterial instance = (new AEGlassMaterial( MapColor.airColor ));
}
@@ -85,16 +85,16 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
final MultiCraftingTracker craftingTracker;
boolean hasConfig = false;
AENetworkProxy gridProxy;
IInterfaceHost iHost;
BaseActionSource mySrc;
ConfigManager cm = new ConfigManager( this );
final AENetworkProxy gridProxy;
final IInterfaceHost iHost;
final BaseActionSource mySrc;
final ConfigManager cm = new ConfigManager( this );
int priority;
List<ICraftingPatternDetails> craftingList = null;
List<ItemStack> waitingToSend = null;
private UpgradeInventory upgrades;
private final UpgradeInventory upgrades;
@Override
public int getInstalledUpgrades(Upgrades u)
@@ -304,11 +304,11 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
updateCraftingList();
}
AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 8 );
AppEngInternalInventory storage = new AppEngInternalInventory( this, 8 );
AppEngInternalInventory patterns = new AppEngInternalInventory( this, 9 );
final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 8 );
final AppEngInternalInventory storage = new AppEngInternalInventory( this, 8 );
final AppEngInternalInventory patterns = new AppEngInternalInventory( this, 9 );
WrapperInvSlot slotInv = new WrapperInvSlot( storage );
final WrapperInvSlot slotInv = new WrapperInvSlot( storage );
private InventoryAdaptor getAdaptor(int slot)
{
@@ -513,8 +513,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
return patterns;
}
MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<IAEItemStack>( new NullInventory<IAEItemStack>(), StorageChannel.ITEMS );
MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<IAEFluidStack>( new NullInventory<IAEFluidStack>(), StorageChannel.FLUIDS );
final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<IAEItemStack>( new NullInventory<IAEItemStack>(), StorageChannel.ITEMS );
final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<IAEFluidStack>( new NullInventory<IAEFluidStack>(), StorageChannel.FLUIDS );
public void gridChanged()
{
@@ -70,8 +70,8 @@ public class MeteoritePlacer
private class FalloutCopy extends Fallout
{
Block blk;
int meta;
final Block blk;
final int meta;
public FalloutCopy(IMeteoriteWorld w, int x, int y, int z) {
blk = w.getBlock( x, y, z );
@@ -186,7 +186,7 @@ public class MeteoritePlacer
static public class StandardWorld implements IMeteoriteWorld
{
protected World w;
protected final World w;
public StandardWorld(World w) {
this.w = w;
@@ -290,7 +290,7 @@ public class MeteoritePlacer
static public class ChunkOnly extends StandardWorld
{
Chunk target;
final Chunk target;
int verticalBits = 0;
@@ -377,14 +377,14 @@ public class MeteoritePlacer
}
}
int minBLocks = 200;
HashSet<Block> validSpawn = new HashSet<Block>();
HashSet<Block> invalidSpawn = new HashSet<Block>();
final int minBLocks = 200;
final HashSet<Block> validSpawn = new HashSet<Block>();
final HashSet<Block> invalidSpawn = new HashSet<Block>();
Fallout type = new Fallout();
Block skystone = AEApi.instance().blocks().blockSkyStone.block();
Block skychest;
final Block skystone = AEApi.instance().blocks().blockSkyStone.block();
final Block skychest;
double real_sizeOfMeteorite = (Math.random() * 6.0) + 2;
double realCrater = real_sizeOfMeteorite * 2 + 5;
@@ -81,8 +81,8 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
ACCEPT, DECLINE, TEST
}
HashSet<TestLookup> failCache = new HashSet<TestLookup>();
HashSet<TestLookup> passCache = new HashSet<TestLookup>();
final HashSet<TestLookup> failCache = new HashSet<TestLookup>();
final HashSet<TestLookup> passCache = new HashSet<TestLookup>();
private void markItemAs(int slotIndex, ItemStack i, TestStatus b)
{
@@ -32,8 +32,8 @@ import appeng.tile.networking.TileWireless;
public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
{
IWirelessTermHandler wth;
String encryptionKey;
final IWirelessTermHandler wth;
final String encryptionKey;
IGrid targetGrid;
IStorageGrid sg;
@@ -43,8 +43,8 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
double sqRange = Double.MAX_VALUE;
double myRange = Double.MAX_VALUE;
EntityPlayer myPlayer;
public ItemStack effectiveItem;
final EntityPlayer myPlayer;
public final ItemStack effectiveItem;
public double getRange()
{