Sonar's fixes

This commit is contained in:
Oleg Agafonov 2019-07-06 13:09:27 +04:00
parent f572ace420
commit bce01ce053
6 changed files with 703 additions and 714 deletions

View file

@ -848,7 +848,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
} }
// can save result // can save result
if (isDownloadOK & httpConn != null) { if (isDownloadOK && httpConn != null) {
// save data to temp // save data to temp
try (InputStream in = new BufferedInputStream(httpConn.getInputStream()); try (InputStream in = new BufferedInputStream(httpConn.getInputStream());
OutputStream tfileout = new TFileOutputStream(fileTempImage); OutputStream tfileout = new TFileOutputStream(fileTempImage);

View file

@ -135,6 +135,7 @@ public class TableView implements Serializable {
switch (table.getState()) { switch (table.getState()) {
case WAITING: case WAITING:
stateText.append(" (").append(table.getTournament().getPlayers().size()).append('/').append(table.getNumberOfSeats()).append(')'); stateText.append(" (").append(table.getTournament().getPlayers().size()).append('/').append(table.getNumberOfSeats()).append(')');
break;
case READY_TO_START: case READY_TO_START:
case STARTING: case STARTING:
infoText.append(" Time: ").append(table.getTournament().getOptions().getMatchOptions().getMatchTimeLimit().toString()); infoText.append(" Time: ").append(table.getTournament().getOptions().getMatchOptions().getMatchTimeLimit().toString());
@ -153,6 +154,7 @@ public class TableView implements Serializable {
if (draft != null) { if (draft != null) {
stateText.append(' ').append(draft.getBoosterNum()).append('/').append(draft.getCardNum() - 1); stateText.append(' ').append(draft.getBoosterNum()).append('/').append(draft.getCardNum() - 1);
} }
break;
default: default:
} }
this.additionalInfo = infoText.toString(); this.additionalInfo = infoText.toString();

View file

@ -1999,8 +1999,10 @@ public class HumanPlayer extends PlayerImpl {
tResponse.setString("resolveStack"); tResponse.setString("resolveStack");
actionQueueSaved.add(tResponse); actionQueueSaved.add(tResponse);
} }
break;
default: default:
super.sendPlayerAction(playerAction, game, data); super.sendPlayerAction(playerAction, game, data);
break;
} }
} }

View file

@ -97,12 +97,13 @@ class BondOfPassionEffect extends OneShotEffect {
Permanent permanent2 = game.getPermanent(source.getTargets().get(1).getFirstTarget()); Permanent permanent2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent2 != null) { if (permanent2 != null) {
permanent2.damage(2, source.getSourceId(), game); permanent2.damage(2, source.getSourceId(), game);
return true; } else {
} Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget()); if (player != null) {
if (player != null) { player.damage(2, source.getSourceId(), game);
player.damage(2, source.getSourceId(), game); }
} }
return true; return true;
} }
} }

View file

@ -1,10 +1,5 @@
package mage; package mage;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
@ -14,6 +9,11 @@ import mage.filter.Filter;
import mage.filter.FilterMana; import mage.filter.FilterMana;
import mage.game.Game; import mage.game.Game;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/** /**
* @author nantuko * @author nantuko
*/ */
@ -192,6 +192,7 @@ public class ConditionalMana extends Mana implements Serializable {
break; break;
case COLORLESS: case COLORLESS:
colorless += amount; colorless += amount;
break;
case GENERIC: case GENERIC:
generic += amount; generic += amount;
break; break;