Replace with array initializer

this can be done through http://docs.oracle.com/javase/specs/jls/se6/html/arrays.html#10.6
This commit is contained in:
thatsIch 2015-09-25 23:04:36 +02:00
parent 9d35f65e76
commit 430b33b7a3
26 changed files with 47 additions and 47 deletions

View File

@ -61,7 +61,7 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
int y = pos.getY();
int z = pos.getZ();
IAESprite[] icoSet = new IAESprite[] { imb.getIcon( EnumFacing.UP, imb.getDefaultState() ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() };
IAESprite[] icoSet = { imb.getIcon( EnumFacing.UP, imb.getDefaultState() ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() };
int lumen = 14 << 20 | 14 << 4;
int brightness = imb.getMixedBrightnessForBlock( world, pos );

View File

@ -44,7 +44,7 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
private final static ResourceLocation SKY_STONE_CHEST = new ResourceLocation( "appliedenergistics2", "textures/models/skychest.png" );
private final static ResourceLocation SKY_BLOCK_CHEST = new ResourceLocation( "appliedenergistics2", "textures/models/skyblockchest.png" );
private final static ResourceLocation METADATA_TO_TEXTURE[] = new ResourceLocation[] { SKY_STONE_CHEST, SKY_BLOCK_CHEST };
private final static ResourceLocation METADATA_TO_TEXTURE[] = { SKY_STONE_CHEST, SKY_BLOCK_CHEST };
private final ModelChest model = new ModelChest();

View File

@ -81,7 +81,7 @@ public class RenderBlockWireless extends BaseBlockRender<BlockWireless, TileWire
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
AEPartLocation[] sides = new AEPartLocation[] { AEPartLocation.EAST, AEPartLocation.WEST, AEPartLocation.UP, AEPartLocation.DOWN };
AEPartLocation[] sides = { AEPartLocation.EAST, AEPartLocation.WEST, AEPartLocation.UP, AEPartLocation.DOWN };
int s = 1;
@ -136,7 +136,7 @@ public class RenderBlockWireless extends BaseBlockRender<BlockWireless, TileWire
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
AEPartLocation[] sides = new AEPartLocation[] { AEPartLocation.EAST, AEPartLocation.WEST, AEPartLocation.UP, AEPartLocation.DOWN };
AEPartLocation[] sides = { AEPartLocation.EAST, AEPartLocation.WEST, AEPartLocation.UP, AEPartLocation.DOWN };
int s = 1;

View File

@ -57,9 +57,9 @@ public final class AEConfig extends Configuration implements IConfigurableObject
public static AEConfig instance;
public final IConfigManager settings = new ConfigManager( this );
public final EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
public final int[] craftByStacks = new int[] { 1, 10, 100, 1000 };
public final int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
public final int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
public final int[] craftByStacks = { 1, 10, 100, 1000 };
public final int[] priorityByStacks = { 1, 10, 100, 1000 };
public final int[] levelByStacks = { 1, 10, 100, 1000 };
private final double WirelessHighWirelessCount = 64;
private final File configFile;
public int storageBiomeID = -1;
@ -96,7 +96,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
public boolean updatable = false;
public double meteoriteClusterChance = 0.1;
public double meteoriteSpawnChance = 0.3;
public int[] meteoriteDimensionWhitelist = new int[] { 0 };
public int[] meteoriteDimensionWhitelist = { 0 };
public int craftingCalculationTimePerTick = 5;
PowerUnits selectedPowerUnit = PowerUnits.AE;
private double WirelessBaseCost = 8;

View File

@ -284,10 +284,10 @@ public class ApiPart implements IPartHelper
defineClassMethod.setAccessible( true );
try
{
Object[] argsA = new Object[] { name, name, b };
Object[] argsA = { name, name, b };
b = (byte[]) runTransformersMethod.invoke( loader, argsA );
Object[] args = new Object[] { name, b, 0, b.length };
Object[] args = { name, b, 0, b.length };
clazz = (Class) defineClassMethod.invoke( loader, args );
}
finally

View File

@ -109,7 +109,7 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
{
try
{
Object[] itemCtorArgs = new Object[] {};
Object[] itemCtorArgs = {};
Class<?>[] ctorArgClasses = new Class<?>[itemCtorArgs.length + 1];
ctorArgClasses[0] = Block.class;
for( int idx = 1; idx < ctorArgClasses.length; idx++ )

View File

@ -88,7 +88,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
private static final double LONGER = 10.0 / 16.0;
private static final double MIN_DIRECTION = 0;
private static final double MAX_DIRECTION = 1.0;
private static final Cuboid6[] SIDE_TESTS = new Cuboid6[] {
private static final Cuboid6[] SIDE_TESTS = {
// DOWN(0, -1, 0),
new Cuboid6( SHORTER, MIN_DIRECTION, SHORTER, LONGER, SHORTER, LONGER ),

View File

@ -106,8 +106,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
public static final int NUMBER_OF_PATTERN_SLOTS = 9;
private static final Collection<Block> BAD_BLOCKS = new HashSet<Block>( 100 );
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
final IAEItemStack[] requireWork = new IAEItemStack[] { null, null, null, null, null, null, null, null, null };
final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
final IAEItemStack[] requireWork = { null, null, null, null, null, null, null, null, null };
final MultiCraftingTracker craftingTracker;
final AENetworkProxy gridProxy;
final IInterfaceHost iHost;
@ -315,7 +315,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
public void updateCraftingList()
{
Boolean[] accountedFor = new Boolean[] { false, false, false, false, false, false, false, false, false }; // 9...
Boolean[] accountedFor = { false, false, false, false, false, false, false, false, false }; // 9...
assert ( accountedFor.length == this.patterns.getSizeInventory() );

View File

@ -68,7 +68,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
private static final int TEXTURE_HEIGHT = 58;
private static final int GRINDER_RATIO = 10000;
private static final Slot[] GRINDER_SLOTS = new ItemSlot[] {
private static final Slot[] GRINDER_SLOTS = {
new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 41, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
new ChanceSlot( 59, 12, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% chance)" ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
@ -76,14 +76,14 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
new ItemSlot( 22, 12, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ),
new ItemSlot( 22, 30, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT )
};
private static final Slot[] INSCRIBER_SLOTS = new ItemSlot[] {
private static final Slot[] INSCRIBER_SLOTS = {
new ItemSlot( 12, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 50, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ),
new ItemSlot( 31, 21, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT )
};
private static final Slot[] SHAPELESS_CRAFTING_SLOTS = new ItemSlot[] {
private static final Slot[] SHAPELESS_CRAFTING_SLOTS = {
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ),
@ -95,7 +95,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ),
};
private static final Slot[] CRAFTING_SLOTS_OWN_BG = new ItemSlot[] {
private static final Slot[] CRAFTING_SLOTS_OWN_BG = {
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
@ -107,14 +107,14 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(),
};
private static final Slot[] SMALL_CRAFTING_SLOTS_OWN_BG = new ItemSlot[] {
private static final Slot[] SMALL_CRAFTING_SLOTS_OWN_BG = {
new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(),
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(),
};
private static final Slot[] CRTAFTING_SLOTS = new ItemSlot[] {
private static final Slot[] CRTAFTING_SLOTS = {
new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ),
@ -126,7 +126,7 @@ public final class CraftGuide extends CraftGuideAPIObject implements IIntegratio
new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ),
};
private static final Slot[] SMALL_CRAFTING_SLOTS = new ItemSlot[] {
private static final Slot[] SMALL_CRAFTING_SLOTS = {
new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ),
new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ),

View File

@ -59,7 +59,7 @@ import appeng.util.ReadOnlyCollection;
public class GridNode implements IGridNode, IPathItem
{
private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged();
private static final int[] CHANNEL_COUNT = new int[] { 0, 8, 32 };
private static final int[] CHANNEL_COUNT = { 0, 8, 32 };
private final List<IGridConnection> connections = new LinkedList<IGridConnection>();
private final IGridBlock gridProxy;

View File

@ -31,7 +31,7 @@ public class InvLayerData
{
// a simple empty array for empty stuff..
private static final int[] NULL_SIDES = new int[] {};
private static final int[] NULL_SIDES = {};
// cache of inventory state.
private final int[][] sides;

View File

@ -49,7 +49,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
{
// a simple empty array for empty stuff..
private static final int[] NULL_SIDES = new int[] {};
private static final int[] NULL_SIDES = {};
InvLayerData invLayer = null;

View File

@ -70,7 +70,7 @@ import appeng.util.Platform;
public class PartCable extends AEBasePart implements IPartCable
{
final int[] channelsOnSide = new int[] { 0, 0, 0, 0, 0, 0 };
final int[] channelsOnSide = { 0, 0, 0, 0, 0, 0 };
EnumSet<AEPartLocation> connections = EnumSet.noneOf( AEPartLocation.class );
boolean powered = false;

View File

@ -38,8 +38,8 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
{
static final ThreadLocal<Stack<PartP2PLiquids>> DEPTH = new ThreadLocal<Stack<PartP2PLiquids>>();
private static final FluidTankInfo[] ACTIVE_TANK = new FluidTankInfo[] { new FluidTankInfo( null, 10000 ) };
private static final FluidTankInfo[] INACTIVE_TANK = new FluidTankInfo[] { new FluidTankInfo( null, 0 ) };
private static final FluidTankInfo[] ACTIVE_TANK = { new FluidTankInfo( null, 10000 ) };
private static final FluidTankInfo[] INACTIVE_TANK = { new FluidTankInfo( null, 0 ) };
IFluidHandler cachedTank;
private int tmpUsed;

View File

@ -78,7 +78,7 @@ import appeng.util.item.AEItemStack;
public class TileMolecularAssembler extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable, ICraftingMachine, IPowerChannelState
{
private static final int[] SIDES = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static final int[] SIDES = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private final InventoryCrafting craftingInv;
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 9 + 2 );

View File

@ -40,8 +40,8 @@ import appeng.util.inv.WrapperInventoryRange;
public class TileGrinder extends AEBaseInvTile implements ICrankable
{
final int[] inputs = new int[] { 0, 1, 2 };
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5 };
final int[] inputs = { 0, 1, 2 };
final int[] sides = { 0, 1, 2, 3, 4, 5 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 7 );
int points;

View File

@ -56,7 +56,7 @@ import appeng.util.item.AEItemStack;
public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpdatePlayerListBox
{
final int[] sides = new int[] { 0 };
final int[] sides = { 0 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
int tickTickTimer = 0;

View File

@ -47,8 +47,8 @@ import appeng.util.Platform;
public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConfigManagerHost, IConfigurableObject
{
private static final FluidTankInfo[] EMPTY = new FluidTankInfo[] { new FluidTankInfo( null, 10 ) };
final int[] sides = new int[] { 0, 1 };
private static final FluidTankInfo[] EMPTY = { new FluidTankInfo( null, 10 ) };
final int[] sides = { 0, 1 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 3 );
final ConfigManager cm = new ConfigManager( this );

View File

@ -82,9 +82,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
{
public final int maxProcessingTime = 100;
final int[] top = new int[] { 0 };
final int[] bottom = new int[] { 1 };
final int[] sides = new int[] { 2, 3 };
final int[] top = { 0 };
final int[] bottom = { 1 };
final int[] sides = { 2, 3 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 4 );
private final IConfigManager settings;
private final UpgradeInventory upgrades;

View File

@ -51,7 +51,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
{
private static final int FUEL_SLOT_INDEX = 0;
private static final double POWER_PER_TICK = 5;
private static final int[] ACCESSIBLE_SLOTS = new int[] { FUEL_SLOT_INDEX };
private static final int[] ACCESSIBLE_SLOTS = { FUEL_SLOT_INDEX };
private static final int MAX_BURN_SPEED = 200;
private static final double DILATION_SCALING = 100.0;
private static final int MIN_BURN_SPEED = 20;

View File

@ -46,7 +46,7 @@ import appeng.tile.inventory.InvOperation;
public class TileController extends AENetworkPowerTile
{
private static final IInventory NULL_INVENTORY = new AppEngInternalInventory( null, 0 );
private static final int[] ACCESSIBLE_SLOTS_BY_SIDE = new int[] {};
private static final int[] ACCESSIBLE_SLOTS_BY_SIDE = {};
private boolean isValid = false;

View File

@ -37,7 +37,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
{
static final AppEngInternalInventory INTERNAL_INVENTORY = new AppEngInternalInventory( null, 0 );
final int[] sides = new int[] {};
final int[] sides = {};
public TileEnergyAcceptor()
{

View File

@ -53,7 +53,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
public static final int POWERED_FLAG = 1;
public static final int CHANNEL_FLAG = 2;
final int[] sides = new int[] { 0 };
final int[] sides = { 0 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
public int clientFlags = 0;

View File

@ -57,8 +57,8 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock
{
private static final IBlockDefinition RING_DEFINITION = AEApi.instance().definitions().blocks().quantumRing();
public final byte corner = 16;
final int[] sidesRing = new int[] {};
final int[] sidesLink = new int[] { 0 };
final int[] sidesRing = {};
final int[] sidesLink = { 0 };
final AppEngInternalInventory internalInventory = new AppEngInternalInventory( this, 1 );
final byte hasSingularity = 32;
final byte powered = 64;

View File

@ -96,9 +96,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
{
static final ChestNoHandler NO_HANDLER = new ChestNoHandler();
static final int[] SIDES = new int[] { 0 };
static final int[] FRONT = new int[] { 1 };
static final int[] NO_SLOTS = new int[] {};
static final int[] SIDES = { 0 };
static final int[] FRONT = { 1 };
static final int[] NO_SLOTS = {};
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
final BaseActionSource mySrc = new MachineSource( this );
final IConfigManager config = new ConfigManager( this );

View File

@ -189,7 +189,7 @@ public class Platform
int offset = 0;
String level = "";
String[] preFixes = new String[] { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
String unitName = displayUnits.name();
if( displayUnits == PowerUnits.WA )