mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
introduced StringUtil class with .isEmpty(String input) and .isNotEmpty(String input), to replace str != null && str.length()>0 statements
This commit is contained in:
parent
fb15c79964
commit
f1cf9e7adb
47 changed files with 132 additions and 96 deletions
|
|
@ -18,6 +18,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.MageObjectType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.util.StringUtil;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
import mage.view.CounterView;
|
||||
|
|
@ -339,7 +340,7 @@ public class GuiDisplayUtil {
|
|||
}
|
||||
|
||||
String legal = rule.toString();
|
||||
if (legal.length() > 0) {
|
||||
if (StringUtil.isNotEmpty(legal)) {
|
||||
legal = legal.replaceAll("\\{this\\}", card.getName().isEmpty() ? "this" : card.getName());
|
||||
legal = legal.replaceAll("\\{source\\}", card.getName().isEmpty() ? "this" : card.getName());
|
||||
buffer.append(ManaSymbols.replaceSymbolsWithHTML(legal, ManaSymbols.Type.TOOLTIP));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue