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
if (isDownloadOK & httpConn != null) {
if (isDownloadOK && httpConn != null) {
// save data to temp
try (InputStream in = new BufferedInputStream(httpConn.getInputStream());
OutputStream tfileout = new TFileOutputStream(fileTempImage);

View file

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

View file

@ -1999,8 +1999,10 @@ public class HumanPlayer extends PlayerImpl {
tResponse.setString("resolveStack");
actionQueueSaved.add(tResponse);
}
break;
default:
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());
if (permanent2 != null) {
permanent2.damage(2, source.getSourceId(), game);
return true;
}
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());
if (player != null) {
player.damage(2, source.getSourceId(), game);
} else {
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());
if (player != null) {
player.damage(2, source.getSourceId(), game);
}
}
return true;
}
}

View file

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