prefer isEmpty over length() == 0
This commit is contained in:
parent
430b33b7a3
commit
2d71b0e34a
|
@ -202,7 +202,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||||
this.amountToCraft.setText( out );
|
this.amountToCraft.setText( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out.length() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
out = "0";
|
out = "0";
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||||
this.amountToCraft.setText( out );
|
this.amountToCraft.setText( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out.length() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
out = "0";
|
out = "0";
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||||
{
|
{
|
||||||
if( !this.checkHotbarKeys( key ) )
|
if( !this.checkHotbarKeys( key ) )
|
||||||
{
|
{
|
||||||
if( character == ' ' && this.searchField.getText().length() == 0 )
|
if( character == ' ' && this.searchField.getText().isEmpty() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||||
this.level.setText( Out );
|
this.level.setText( Out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Out.length() == 0 )
|
if( Out.isEmpty() )
|
||||||
{
|
{
|
||||||
Out = "0";
|
Out = "0";
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||||
this.level.setText( Out );
|
this.level.setText( Out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Out.length() == 0 )
|
if( Out.isEmpty() )
|
||||||
{
|
{
|
||||||
Out = "0";
|
Out = "0";
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,7 +461,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||||
{
|
{
|
||||||
if( !this.checkHotbarKeys( key ) )
|
if( !this.checkHotbarKeys( key ) )
|
||||||
{
|
{
|
||||||
if( character == ' ' && this.searchField.getText().length() == 0 )
|
if( character == ' ' && this.searchField.getText().isEmpty() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class GuiPriority extends AEBaseGui
|
||||||
this.priority.setText( out );
|
this.priority.setText( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out.length() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
out = "0";
|
out = "0";
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ public class GuiPriority extends AEBaseGui
|
||||||
this.priority.setText( out );
|
this.priority.setText( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out.length() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
out = "0";
|
out = "0";
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||||
this.sendCPUs();
|
this.sendCPUs();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.noCPU = this.cpus.size() == 0;
|
this.noCPU = this.cpus.isEmpty();
|
||||||
|
|
||||||
super.detectAndSendChanges();
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||||
this.sendCPUs();
|
this.sendCPUs();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.noCPU = this.cpus.size() == 0;
|
this.noCPU = this.cpus.isEmpty();
|
||||||
|
|
||||||
super.detectAndSendChanges();
|
super.detectAndSendChanges();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class ApiPart implements IPartHelper
|
||||||
|
|
||||||
public Class getCombinedInstance( String base )
|
public Class getCombinedInstance( String base )
|
||||||
{
|
{
|
||||||
if( this.desc.size() == 0 )
|
if( this.desc.isEmpty() )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||||
{
|
{
|
||||||
throw new IllegalStateException( "Input must be defined." );
|
throw new IllegalStateException( "Input must be defined." );
|
||||||
}
|
}
|
||||||
if( this.inputs.size() == 0 )
|
if( this.inputs.isEmpty() )
|
||||||
{
|
{
|
||||||
throw new IllegalStateException( "Input must have a size." );
|
throw new IllegalStateException( "Input must have a size." );
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||||
|
|
||||||
final IWirelessTermHandler handler = this.getWirelessTerminalHandler( item );
|
final IWirelessTermHandler handler = this.getWirelessTerminalHandler( item );
|
||||||
final String unparsedKey = handler.getEncryptionKey( item );
|
final String unparsedKey = handler.getEncryptionKey( item );
|
||||||
if( unparsedKey.length() == 0 )
|
if( unparsedKey.isEmpty() )
|
||||||
{
|
{
|
||||||
player.addChatMessage( PlayerMessages.DeviceNotLinked.get() );
|
player.addChatMessage( PlayerMessages.DeviceNotLinked.get() );
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class GroupIngredient implements IIngredient
|
||||||
this.isInside = false;
|
this.isInside = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( out.size() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class IngredientSet implements IIngredient
|
||||||
List<ItemStack> out = new LinkedList<ItemStack>();
|
List<ItemStack> out = new LinkedList<ItemStack>();
|
||||||
out.addAll( this.items );
|
out.addAll( this.items );
|
||||||
|
|
||||||
if( out.size() == 0 )
|
if( out.isEmpty() )
|
||||||
{
|
{
|
||||||
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
throw new MissingIngredientError( this.toString() + " - group could not be resolved to any items." );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue