From ad7d3c80780f94d6f3d2e9be9ad26637e6ac293e Mon Sep 17 00:00:00 2001 From: vraskulin Date: Tue, 28 Feb 2017 11:45:15 +0300 Subject: [PATCH] equals "" should be replaced with isEmpty --- Mage.Sets/src/mage/cards/c/CoverOfDarkness.java | 2 +- Mage.Sets/src/mage/cards/s/SteelyResolve.java | 2 +- Mage.Sets/src/mage/cards/t/TestamentOfFaith.java | 2 +- Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java | 2 +- .../effects/common/continuous/BecomesCreatureAllEffect.java | 4 ++-- .../common/continuous/BecomesCreatureSourceEffect.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java b/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java index 1d091689203..84f2075a4bc 100644 --- a/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java +++ b/Mage.Sets/src/mage/cards/c/CoverOfDarkness.java @@ -88,7 +88,7 @@ class FilterCoverOfDarkness extends FilterCreaturePermanent { public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (super.match(permanent, sourceId, playerId, game)) { String subtype = (String) game.getState().getValue(sourceId + "_type"); - if (subtype != null && !subtype.equals("") && permanent.hasSubtype(subtype, game)) { + if (subtype != null && !subtype.isEmpty() && permanent.hasSubtype(subtype, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SteelyResolve.java b/Mage.Sets/src/mage/cards/s/SteelyResolve.java index 26f4f0d6221..79b26c49a7e 100644 --- a/Mage.Sets/src/mage/cards/s/SteelyResolve.java +++ b/Mage.Sets/src/mage/cards/s/SteelyResolve.java @@ -86,7 +86,7 @@ class FilterSteelyResolve extends FilterCreaturePermanent { public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (super.match(permanent, sourceId, playerId, game)) { String subtype = (String) game.getState().getValue(sourceId + "_type"); - if (subtype != null && !subtype.equals("") && permanent.hasSubtype(subtype, game)) { + if (subtype != null && !subtype.isEmpty() && permanent.hasSubtype(subtype, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java index 7cc2779d3c0..52a0b6cff3d 100644 --- a/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java +++ b/Mage.Sets/src/mage/cards/t/TestamentOfFaith.java @@ -116,7 +116,7 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i } } } - if ("".equals(type) || type == null) { + if (type != null && type.isEmpty() || type == null) { permanent.getSubtype(game).clear(); } if (!token.getSubtype(game).isEmpty()) { diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index f4140b07035..e28f3c99408 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -210,7 +210,7 @@ public class VerifyCardDataTest { private void checkCost(Card card, JsonCard ref) { String expected = ref.manaCost; String cost = join(card.getManaCost().getSymbols()); - if ("".equals(cost)) { + if (cost != null && cost.isEmpty()) { cost = null; } if (cost != null) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java index c249c52eecb..d7758dc6fef 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java @@ -135,12 +135,12 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { @Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); - if (!"".equals(duration.toString())) { + if (duration.toString() != null && !duration.toString().isEmpty()) { sb.append(duration.toString()).append(", "); } sb.append("all "); sb.append(filter.getMessage()); - if ("".equals(duration.toString())) { + if (duration.toString() != null && duration.toString().isEmpty()) { sb.append(" are "); } else { sb.append(" become "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index de5a79aff98..2464a08497b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -120,7 +120,7 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements } } } - if ("".equals(type) || type == null && permanent.getCardType().contains(CardType.LAND)) { + if (type != null && type.isEmpty() || type == null && permanent.getCardType().contains(CardType.LAND)) { permanent.getSubtype(game).retainAll(CardRepository.instance.getLandTypes()); } if (!token.getSubtype(game).isEmpty()) {