Finally use Java7 <>

This commit is contained in:
yueh
2017-07-20 21:21:45 +02:00
parent 8ec8babb6a
commit 7de90ed0ae
145 changed files with 315 additions and 315 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ import appeng.core.AELog;
public final class ConfigManager implements IConfigManager
{
private final Map<Settings, Enum<?>> settings = new EnumMap<Settings, Enum<?>>( Settings.class );
private final Map<Settings, Enum<?>> settings = new EnumMap<>( Settings.class );
private final IConfigManagerHost target;
public ConfigManager( final IConfigManagerHost tile )
@@ -53,7 +53,7 @@ public class InWorldToolOperationResult
public static InWorldToolOperationResult getBlockOperationResult( final ItemStack[] items )
{
final List<ItemStack> temp = new ArrayList<ItemStack>();
final List<ItemStack> temp = new ArrayList<>();
ItemStack b = ItemStack.EMPTY;
for( final ItemStack l : items )
+3 -3
View File
@@ -155,7 +155,7 @@ public class Platform
* random source, use it for item drop locations...
*/
private static final Random RANDOM_GENERATOR = new Random();
private static final WeakHashMap<World, EntityPlayer> FAKE_PLAYERS = new WeakHashMap<World, EntityPlayer>();
private static final WeakHashMap<World, EntityPlayer> FAKE_PLAYERS = new WeakHashMap<>();
// private static Method getEntry;
private static final ItemComparisonHelper ITEM_COMPARISON_HELPER = new ItemComparisonHelper();
@@ -452,7 +452,7 @@ public class Platform
public static ItemStack[] getBlockDrops( final World w, final BlockPos pos )
{
List<ItemStack> out = new ArrayList<ItemStack>();
List<ItemStack> out = new ArrayList<>();
final IBlockState state = w.getBlockState( pos );
if( state != null )
@@ -1391,7 +1391,7 @@ public class Platform
public static <T extends IAEStack<T>> void postListChanges( final IItemList<T> before, final IItemList<T> after, final IMEMonitorHandlerReceiver<T> meMonitorPassthrough, final BaseActionSource source )
{
final LinkedList<T> changes = new LinkedList<T>();
final LinkedList<T> changes = new LinkedList<>();
for( final T is : before )
{
@@ -448,7 +448,7 @@ public class ItemComparisonHelper
AELog.debug( t );
}
return new ArrayList<NBTBase>();
return new ArrayList<>();
}
}
@@ -232,6 +232,6 @@ public class AdaptorPlayerHand extends InventoryAdaptor
@Override
public Iterator<ItemSlot> iterator()
{
return new NullIterator<ItemSlot>();
return new NullIterator<>();
}
}
@@ -52,7 +52,7 @@ public class WrapperChainedInventory implements IInventory
private void calculateSizes()
{
this.offsets = new HashMap<Integer, WrapperChainedInventory.InvOffset>();
this.offsets = new HashMap<>();
int offset = 0;
for( final IInventory in : this.l )
@@ -88,7 +88,7 @@ public class WrapperChainedInventory implements IInventory
{
if( this.l.size() > 1 )
{
final List<IInventory> newOrder = new ArrayList<IInventory>( this.l.size() );
final List<IInventory> newOrder = new ArrayList<>( this.l.size() );
newOrder.add( this.l.get( this.l.size() - 1 ) );
for( int x = 0; x < this.l.size() - 1; x++ )
{
@@ -42,7 +42,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
/*
* Shared Tag Compound Cache.
*/
private static final WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>> SHARED_TAG_COMPOUND = new WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>>();
private static final WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>> SHARED_TAG_COMPOUND = new WeakHashMap<>();
private final Item item;
private final int meta;
private SharedSearchObject sso;
@@ -114,7 +114,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
sso.setShared( clone );
clone.sso = sso;
SHARED_TAG_COMPOUND.put( sso, new WeakReference<SharedSearchObject>( sso ) );
SHARED_TAG_COMPOUND.put( sso, new WeakReference<>( sso ) );
return clone;
}
@@ -33,7 +33,7 @@ import appeng.api.storage.data.IItemList;
public final class FluidList implements IItemList<IAEFluidStack>
{
private final Map<IAEFluidStack, IAEFluidStack> records = new HashMap<IAEFluidStack, IAEFluidStack>();
private final Map<IAEFluidStack, IAEFluidStack> records = new HashMap<>();
@Override
public void add( final IAEFluidStack option )
@@ -177,7 +177,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
@Override
public Iterator<IAEFluidStack> iterator()
{
return new MeaningfulFluidIterator<IAEFluidStack>( this.records.values().iterator() );
return new MeaningfulFluidIterator<>( this.records.values().iterator() );
}
@Override
+3 -3
View File
@@ -36,7 +36,7 @@ import appeng.api.storage.data.IItemList;
public final class ItemList implements IItemList<IAEItemStack>
{
private final NavigableMap<IAEItemStack, IAEItemStack> records = new ConcurrentSkipListMap<IAEItemStack, IAEItemStack>();
private final NavigableMap<IAEItemStack, IAEItemStack> records = new ConcurrentSkipListMap<>();
@Override
public void add( final IAEItemStack option )
@@ -92,7 +92,7 @@ public final class ItemList implements IItemList<IAEItemStack>
}
else
{
final Collection<IAEItemStack> output = new LinkedList<IAEItemStack>();
final Collection<IAEItemStack> output = new LinkedList<>();
for( final IAEItemStack is : or.getAEEquivalents() )
{
@@ -205,7 +205,7 @@ public final class ItemList implements IItemList<IAEItemStack>
@Override
public Iterator<IAEItemStack> iterator()
{
return new MeaningfulItemIterator<IAEItemStack>( this.records.values().iterator() );
return new MeaningfulItemIterator<>( this.records.values().iterator() );
}
@Override
@@ -54,7 +54,7 @@ public class OreHelper
}
} );
private final Map<ItemRef, OreReference> references = new HashMap<ItemRef, OreReference>();
private final Map<ItemRef, OreReference> references = new HashMap<>();
/**
* Test if the passed {@link ItemStack} is an ore.
@@ -73,7 +73,7 @@ public class OreHelper
final Collection<Integer> ores = ref.getOres();
final Collection<String> set = ref.getEquivalents();
final Set<String> toAdd = new HashSet<String>();
final Set<String> toAdd = new HashSet<>();
for( final String ore : OreDictionary.getOreNames() )
{
@@ -35,8 +35,8 @@ import appeng.api.storage.data.IAEItemStack;
public class OreReference
{
private final List<String> otherOptions = new LinkedList<String>();
private final Set<Integer> ores = new HashSet<Integer>();
private final List<String> otherOptions = new LinkedList<>();
private final Set<Integer> ores = new HashSet<>();
private List<IAEItemStack> aeOtherOptions = null;
Collection<String> getEquivalents()
@@ -48,7 +48,7 @@ public class OreReference
{
if( this.aeOtherOptions == null )
{
this.aeOtherOptions = new ArrayList<IAEItemStack>( this.otherOptions.size() );
this.aeOtherOptions = new ArrayList<>( this.otherOptions.size() );
// SUMMON AE STACKS!
for( final String oreName : this.otherOptions )
@@ -28,8 +28,8 @@ import appeng.api.storage.data.IAEStack;
public final class MergedPriorityList<T extends IAEStack<T>> implements IPartitionList<T>
{
private final Collection<IPartitionList<T>> positive = new ArrayList<IPartitionList<T>>();
private final Collection<IPartitionList<T>> negative = new ArrayList<IPartitionList<T>>();
private final Collection<IPartitionList<T>> positive = new ArrayList<>();
private final Collection<IPartitionList<T>> negative = new ArrayList<>();
public void addNewList( final IPartitionList<T> list, final boolean isWhitelist )
{