introduced StringUtil class with .isEmpty(String input) and .isNotEmpty(String input), to replace str != null && str.length()>0 statements

This commit is contained in:
ingmargoudt 2016-09-16 20:51:51 +02:00
parent fb15c79964
commit f1cf9e7adb
47 changed files with 132 additions and 96 deletions

View file

@ -36,6 +36,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.StringUtil;
public class LoseLifeControllerAttachedEffect extends OneShotEffect {
@ -88,7 +89,7 @@ public class LoseLifeControllerAttachedEffect extends OneShotEffect {
StringBuilder sb = new StringBuilder();
sb.append("it's controller loses ").append(amount.toString()).append(" life");
String message = amount.getMessage();
if (message.length() > 0) {
if (StringUtil.isNotEmpty(message)) {
sb.append(" for each ");
sb.append(message);
}