diff --git a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java index 0414cd2ef0..6332c7987e 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfTheSwine.java @@ -83,8 +83,8 @@ class CurseOfTheSwineEffect extends OneShotEffect { } } CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken(); - for (UUID playerId : playersWithTargets.keySet()) { - swineToken.putOntoBattlefield(playersWithTargets.get(playerId), game, source.getSourceId(), playerId); + for (Map.Entry exiledByController : playersWithTargets.entrySet()) { + swineToken.putOntoBattlefield(exiledByController.getValue(), game, source.getSourceId(), exiledByController.getKey()); } return true; } diff --git a/Mage.Sets/src/mage/cards/d/DarkDeal.java b/Mage.Sets/src/mage/cards/d/DarkDeal.java index 0509a07c3d..1c81482bc1 100644 --- a/Mage.Sets/src/mage/cards/d/DarkDeal.java +++ b/Mage.Sets/src/mage/cards/d/DarkDeal.java @@ -4,6 +4,8 @@ package mage.cards.d; import java.util.LinkedHashMap; import java.util.Map; import java.util.UUID; + +import com.j256.ormlite.stmt.query.In; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -67,10 +69,10 @@ class DarkDealEffect extends OneShotEffect { } } } - for (UUID playerId : cardsToDraw.keySet()) { - Player player = game.getPlayer(playerId); + for (Map.Entry toDrawByPlayer : cardsToDraw.entrySet()) { + Player player = game.getPlayer(toDrawByPlayer.getKey()); if (player != null) { - player.drawCards(cardsToDraw.get(playerId), game); + player.drawCards(toDrawByPlayer.getValue(), game); } } return true; diff --git a/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java b/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java index bae2a1e14c..52ebc06776 100644 --- a/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java +++ b/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java @@ -77,8 +77,8 @@ class DescentOfTheDragonsEffect extends OneShotEffect { } } DragonToken dragonToken = new DragonToken(); - for (UUID playerId : playersWithTargets.keySet()) { - dragonToken.putOntoBattlefield(playersWithTargets.get(playerId), game, source.getSourceId(), playerId); + for (Map.Entry amountTokensPerPlayer : playersWithTargets.entrySet()) { + dragonToken.putOntoBattlefield(amountTokensPerPlayer.getValue(), game, source.getSourceId(), amountTokensPerPlayer.getKey()); } return true; } diff --git a/Mage.Sets/src/mage/cards/g/GuardianProject.java b/Mage.Sets/src/mage/cards/g/GuardianProject.java index fe7ac3aa84..899fcf3929 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianProject.java +++ b/Mage.Sets/src/mage/cards/g/GuardianProject.java @@ -110,7 +110,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili filterPermanent.add(new NamePredicate(permanent.getName())); filterPermanent.add(Predicates.not(new CardIdPredicate(permanent.getId()))); filterPermanent.add(new ControllerIdPredicate(controllerId)); - if (game.getBattlefield().getActivePermanents(filterPermanent, controllerId, game).size() > 0) { + if (!game.getBattlefield().getActivePermanents(filterPermanent, controllerId, game).isEmpty()) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/i/IncendiaryCommand.java b/Mage.Sets/src/mage/cards/i/IncendiaryCommand.java index 656ae6401e..6fc1a4aaa8 100644 --- a/Mage.Sets/src/mage/cards/i/IncendiaryCommand.java +++ b/Mage.Sets/src/mage/cards/i/IncendiaryCommand.java @@ -92,10 +92,10 @@ class IncendiaryCommandDrawEffect extends OneShotEffect { } } } - for (UUID playerId : cardsToDraw.keySet()) { - Player player = game.getPlayer(playerId); + for (Map.Entry toDrawByPlayer : cardsToDraw.entrySet()) { + Player player = game.getPlayer(toDrawByPlayer.getKey()); if (player != null) { - player.drawCards(cardsToDraw.get(playerId), game); + player.drawCards(toDrawByPlayer.getValue(), game); } } return true; diff --git a/Mage.Sets/src/mage/cards/k/KamahlsSummons.java b/Mage.Sets/src/mage/cards/k/KamahlsSummons.java index cdfd4fb8c4..b1d2ae7501 100644 --- a/Mage.Sets/src/mage/cards/k/KamahlsSummons.java +++ b/Mage.Sets/src/mage/cards/k/KamahlsSummons.java @@ -83,10 +83,10 @@ class KamahlsSummonsEffect extends OneShotEffect { } } Token token = new BearToken(); - for (UUID playerId : revealedCards.keySet()) { - int value = revealedCards.get(playerId); + for (Map.Entry revealedCardsByPlayer: revealedCards.entrySet()) { + int value = revealedCardsByPlayer.getValue(); if (value > 0) { - token.putOntoBattlefield(value, game, source.getSourceId(), playerId); + token.putOntoBattlefield(value, game, source.getSourceId(), revealedCardsByPlayer.getKey()); } } return true; diff --git a/Mage.Sets/src/mage/cards/m/MarchOfSouls.java b/Mage.Sets/src/mage/cards/m/MarchOfSouls.java index afb8a682f0..803b8b85b9 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfSouls.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfSouls.java @@ -67,8 +67,8 @@ class MarchOfSoulsEffect extends OneShotEffect { } } SpiritWhiteToken token = new SpiritWhiteToken(); - for (UUID playerId : playersWithCreatures.keySet()) { - token.putOntoBattlefield(playersWithCreatures.get(playerId), game, source.getSourceId(), playerId); + for (Map.Entry destroyedCreaturePerPlayer : playersWithCreatures.entrySet()) { + token.putOntoBattlefield(destroyedCreaturePerPlayer.getValue(), game, source.getSourceId(), destroyedCreaturePerPlayer.getKey()); } return true; } diff --git a/Mage.Sets/src/mage/cards/r/RampageOfTheClans.java b/Mage.Sets/src/mage/cards/r/RampageOfTheClans.java index 887a1786e2..0d1c4fa05e 100644 --- a/Mage.Sets/src/mage/cards/r/RampageOfTheClans.java +++ b/Mage.Sets/src/mage/cards/r/RampageOfTheClans.java @@ -69,8 +69,8 @@ class RampageOfTheClansEffect extends OneShotEffect { } } Token token = new CentaurToken(); - for (UUID playerId : playersWithPermanents.keySet()) { - token.putOntoBattlefield(playersWithPermanents.get(playerId), game, source.getSourceId(), playerId); + for (Map.Entry amountDestroyedByPlayer : playersWithPermanents.entrySet()) { + token.putOntoBattlefield(amountDestroyedByPlayer.getValue(), game, source.getSourceId(), amountDestroyedByPlayer.getKey()); } return true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/TapAllTargetPlayerControlsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/TapAllTargetPlayerControlsEffect.java index cc531c7945..421b2c2bc9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/TapAllTargetPlayerControlsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/TapAllTargetPlayerControlsEffect.java @@ -53,7 +53,7 @@ public class TapAllTargetPlayerControlsEffect extends OneShotEffect { } return "tap all " + filter.toString() + " target " + - (mode.getTargets().size() == 0 ? "player" : mode.getTargets().get(0).getTargetName()) + + (mode.getTargets().isEmpty() ? "player" : mode.getTargets().get(0).getTargetName()) + " controls"; } } diff --git a/Mage/src/main/java/mage/cards/repository/CardRepository.java b/Mage/src/main/java/mage/cards/repository/CardRepository.java index b0a743c904..56998bcdc9 100644 --- a/Mage/src/main/java/mage/cards/repository/CardRepository.java +++ b/Mage/src/main/java/mage/cards/repository/CardRepository.java @@ -73,7 +73,7 @@ public enum CardRepository { try { cardDao.callBatchTasks(() -> { // add - if (newCards != null && newCards.size() > 0) { + if (newCards != null && !newCards.isEmpty()) { logger.info("DB: need to add " + newCards.size() + " new cards"); try { for (CardInfo card : newCards) { diff --git a/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java b/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java index c0bfded768..b5f28ee7c6 100644 --- a/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java +++ b/Mage/src/main/java/mage/cards/repository/ExpansionRepository.java @@ -70,7 +70,7 @@ public enum ExpansionRepository { try { expansionDao.callBatchTasks(() -> { // add - if (newSets != null && newSets.size() > 0) { + if (newSets != null && !newSets.isEmpty()) { logger.info("DB: need to add " + newSets.size() + " new sets"); try { for (ExpansionInfo exp : newSets) { @@ -82,7 +82,7 @@ public enum ExpansionRepository { } // update - if (updatedSets != null && updatedSets.size() > 0) { + if (updatedSets != null && !updatedSets.isEmpty()) { logger.info("DB: need to update " + updatedSets.size() + " sets"); try { for (ExpansionInfo exp : updatedSets) {