forked from External/mage
list.size > 0 changed to !list.isEmpty
We care about if it's empty or not, not about it's size
This commit is contained in:
parent
f60ebfbb1f
commit
0557b5e89c
366 changed files with 532 additions and 548 deletions
|
|
@ -688,7 +688,7 @@ public abstract class CardPanel extends MagePermanent implements MouseListener,
|
|||
sbType.append(cardType.toString()).append(' ');
|
||||
}
|
||||
|
||||
if (card.getSubTypes().size() > 0) {
|
||||
if (!card.getSubTypes().isEmpty()) {
|
||||
sbType.append("- ");
|
||||
for (String subType : card.getSubTypes()) {
|
||||
sbType.append(subType).append(' ');
|
||||
|
|
@ -706,7 +706,7 @@ public abstract class CardPanel extends MagePermanent implements MouseListener,
|
|||
}
|
||||
} else {
|
||||
sb.append(card.getName());
|
||||
if (card.getManaCost().size() > 0) {
|
||||
if (!card.getManaCost().isEmpty()) {
|
||||
sb.append('\n').append(card.getManaCost());
|
||||
}
|
||||
sb.append('\n').append(cardType);
|
||||
|
|
@ -724,7 +724,7 @@ public abstract class CardPanel extends MagePermanent implements MouseListener,
|
|||
for (String rule : card.getRules()) {
|
||||
sb.append('\n').append(rule);
|
||||
}
|
||||
if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0) {
|
||||
if (card.getExpansionSetCode() != null && !card.getExpansionSetCode().isEmpty()) {
|
||||
sb.append('\n').append(card.getCardNumber()).append(" - ");
|
||||
sb.append(card.getExpansionSetCode()).append(" - ");
|
||||
sb.append(card.getRarity().toString());
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ public abstract class CardRenderer {
|
|||
for (CardType cardType : cardView.getCardTypes()) {
|
||||
sbType.append(cardType.toString()).append(' ');
|
||||
}
|
||||
if (cardView.getSubTypes().size() > 0) {
|
||||
if (!cardView.getSubTypes().isEmpty()) {
|
||||
sbType.append("- ");
|
||||
for (String subType : cardView.getSubTypes()) {
|
||||
sbType.append(subType).append(' ');
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class TextboxRule {
|
|||
// Do it in reverse order for proper handling of regions where
|
||||
// there are multiple attributes stacked (EG: bold + italic)
|
||||
AttributedString attributedRule = new AttributedString(text);
|
||||
if (text.length() != 0) {
|
||||
if (!text.isEmpty()) {
|
||||
attributedRule.addAttribute(TextAttribute.FONT, normal);
|
||||
for (int i = regions.size() - 1; i >= 0; --i) {
|
||||
regions.get(i).applyToAttributedString(attributedRule, normal, italic);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public class CardPluginImpl implements CardPlugin {
|
|||
break;
|
||||
}
|
||||
List<CounterView> counters = firstPanel.getOriginalPermanent().getCounters();
|
||||
if (counters != null && counters.size() > 0) {
|
||||
if (counters != null && !counters.isEmpty()) {
|
||||
// don't put to first panel if it has counters
|
||||
insertIndex = i;
|
||||
break;
|
||||
|
|
@ -191,7 +191,7 @@ public class CardPluginImpl implements CardPlugin {
|
|||
continue;
|
||||
}
|
||||
counters = permanent.getOriginalPermanent().getCounters();
|
||||
if (counters != null && counters.size() > 0) {
|
||||
if (counters != null && !counters.isEmpty()) {
|
||||
// if a land has counter, put it to the right
|
||||
insertIndex = i + 1;
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue