First batch of null -> isEmpty() checks.

I most likely still missed a ton of checks...
This commit is contained in:
Gunther De Wachter
2017-06-26 05:15:25 +02:00
parent 370fc49357
commit da5879b667
117 changed files with 594 additions and 570 deletions
@@ -92,7 +92,7 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
{
final ItemStackSrc is = this.colors[color.ordinal()];
if( comparableItem == null || is == null )
if( comparableItem.isEmpty() || is == null )
{
return false;
}
@@ -53,7 +53,7 @@ public class CellRegistry implements ICellRegistry
@Override
public boolean isCellHandled( final ItemStack is )
{
if( is == null )
if( is.isEmpty() )
{
return false;
}
@@ -70,7 +70,7 @@ public class CellRegistry implements ICellRegistry
@Override
public ICellHandler getHandler( final ItemStack is )
{
if( is == null )
if( is.isEmpty() )
{
return null;
}
@@ -87,7 +87,7 @@ public class CellRegistry implements ICellRegistry
@Override
public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel chan )
{
if( is == null )
if( is.isEmpty() )
{
return null;
}
@@ -42,13 +42,13 @@ public class CreativeCellHandler implements ICellHandler
@Override
public boolean isCell( final ItemStack is )
{
return is != null && is.getItem() instanceof ItemCreativeStorageCell;
return !is.isEmpty() && is.getItem() instanceof ItemCreativeStorageCell;
}
@Override
public IMEInventoryHandler getCellInventory( final ItemStack is, final ISaveProvider container, final StorageChannel channel )
{
if( channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell )
if( channel == StorageChannel.ITEMS && !is.isEmpty() && is.getItem() instanceof ItemCreativeStorageCell )
{
return CreativeCellInventory.getCell( is );
}
@@ -229,7 +229,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
private ItemStack copy( final ItemStack is )
{
if( is != null )
if( !is.isEmpty() )
{
return is.copy();
}
@@ -182,11 +182,11 @@ public final class InscriberRegistry implements IInscriberRegistry
{
throw new IllegalStateException( "Input must have a size." );
}
if( this.output == null )
if( this.output.isEmpty() )
{
throw new IllegalStateException( "Output must be defined." );
}
if( this.topOptional == null && this.bottomOptional == null )
if( this.topOptional.isEmpty() && this.bottomOptional.isEmpty() )
{
throw new IllegalStateException( "One optional must be defined." );
}