mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
equals "" should be replaced with isEmpty
This commit is contained in:
parent
3600d03e2c
commit
ad7d3c8078
6 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 ");
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue