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
@@ -26,9 +26,9 @@ import appeng.util.IConfigManagerHost;
public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, IAEAppEngInventory, IConfigurableObject, IConfigManagerHost
{
AppEngInternalInventory cell = new AppEngInternalInventory( this, 1 );
AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 63 );
ConfigManager cm = new ConfigManager( this );
final AppEngInternalInventory cell = new AppEngInternalInventory( this, 1 );
final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 63 );
final ConfigManager cm = new ConfigManager( this );
IInventory cacheUpgrades = null;
IInventory cacheConfig = null;
@@ -33,7 +33,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
{
final int sides[] = new int[] { 0 };
AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
int tickTickTimer = 0;
int lastUpdate = 0;
@@ -27,10 +27,10 @@ import appeng.util.Platform;
public class TileCondenser extends AEBaseInvTile implements IAEAppEngInventory, IFluidHandler, IConfigManagerHost, IConfigurableObject
{
int sides[] = new int[] { 0, 1 };
static private FluidTankInfo[] empty = new FluidTankInfo[] { new FluidTankInfo( null, 10 ) };
AppEngInternalInventory inv = new AppEngInternalInventory( this, 3 );
ConfigManager cm = new ConfigManager( this );
final int[] sides = new int[] { 0, 1 };
static private final FluidTankInfo[] empty = new FluidTankInfo[] { new FluidTankInfo( null, 10 ) };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 3 );
final ConfigManager cm = new ConfigManager( this );
public double storedPower = 0;
@@ -46,7 +46,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
final int bottom[] = new int[] { 1 };
final int sides[] = new int[] { 2, 3 };
AppEngInternalInventory inv = new AppEngInternalInventory( this, 4 );
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 4 );
public final int maxProcessingTime = 100;
public int processingTime = 0;
@@ -58,8 +58,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
public long clientStart;
static final ItemStack inscriberStack = AEApi.instance().blocks().blockInscriber.stack( 1 );
private IConfigManager settings = new ConfigManager( this );
private UpgradeInventory upgrades = new UpgradeInventory( inscriberStack, this, getUpgradeSlots() );
private final IConfigManager settings = new ConfigManager( this );
private final UpgradeInventory upgrades = new UpgradeInventory( inscriberStack, this, getUpgradeSlots() );
@Override
public AECableType getCableConnectionType(ForgeDirection dir)
@@ -50,7 +50,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS
{
ForgeDirection pointAt = ForgeDirection.UNKNOWN;
DualityInterface duality = new DualityInterface( gridProxy, this );
final DualityInterface duality = new DualityInterface( gridProxy, this );
@MENetworkEventSubscribe
public void stateChange(MENetworkChannelsChanged c)
@@ -62,17 +62,17 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
{
private static int difference = 0;
private IConfigManager cm = new ConfigManager( this );
private final IConfigManager cm = new ConfigManager( this );
private SecurityInventory inventory = new SecurityInventory( this );
private MEMonitorHandler<IAEItemStack> securityMonitor = new MEMonitorHandler<IAEItemStack>( inventory );
private final SecurityInventory inventory = new SecurityInventory( this );
private final MEMonitorHandler<IAEItemStack> securityMonitor = new MEMonitorHandler<IAEItemStack>( inventory );
private boolean isActive = false;
AEColor paintedColor = AEColor.Transparent;
public long securityKey;
public AppEngInternalInventory configSlot = new AppEngInternalInventory( this, 1 );
public final AppEngInternalInventory configSlot = new AppEngInternalInventory( this, 1 );
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack)
@@ -31,7 +31,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
final double powerPerTick = 5;
final int sides[] = new int[] { 0 };
AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
public int burnSpeed = 100;
public double burnTime = 0;