Skip to content

Commit

Permalink
Merge pull request #183 from thatsIch/Equals
Browse files Browse the repository at this point in the history
Replaces String == comparison with .equals()
  • Loading branch information
Cisien committed Sep 29, 2014
2 parents 7b3bde7 + 1d1ea7a commit 1404a2f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/appeng/integration/modules/FMP.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public TMultiPart createPart(String name, boolean client)
{
for (PartRegistry pr : PartRegistry.values())
{
if ( pr.getName() == name )
if ( pr.getName().equals( name ) )
return pr.construct( 0 );
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/items/tools/ToolMemoryCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String getSettingsName(ItemStack is)
{
NBTTagCompound c = Platform.openNbtData( is );
String name = c.getString( "Config" );
return name == null || name == "" ? GuiText.Blank.getUnlocalized() : name;
return name == null || name.equals( "" ) ? GuiText.Blank.getUnlocalized() : name;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void addInformation(ItemStack i, EntityPlayer p, List l, boolean b)
{
String encKey = tag.getString( "encryptionKey" );

if ( encKey == null || encKey == "" )
if ( encKey == null || encKey.equals( "" ) )
l.add( GuiText.Unlinked.getLocal() );
else
l.add( GuiText.Linked.getLocal() );
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/util/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public static boolean NBTEqualityTest(NBTBase A, NBTBase B)
return ((NBTTagLong) A).func_150291_c() == ((NBTTagLong) B).func_150291_c();

case 8: // else if ( A instanceof NBTTagString )
return ((NBTTagString) A).func_150285_a_() == ((NBTTagString) B).func_150285_a_()
return ((NBTTagString) A).func_150285_a_().equals( ((NBTTagString) B).func_150285_a_() )
|| ((NBTTagString) A).func_150285_a_().equals( ((NBTTagString) B).func_150285_a_() );

case 6: // else if ( A instanceof NBTTagDouble )
Expand Down

0 comments on commit 1404a2f

Please sign in to comment.