diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index 103f2b6336..2e71716dc9 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -1,5 +1,6 @@ XMage.de 1 (Europe/Germany) fast :xmage.de:17171 woogerworks (North America/USA) :xmage.woogerworks.com:17171 +xmage.lukeskywalk.com (North America) :xmage.lukeskywalk.com:17171 XMageBr. (South America/Brazil) :magic.ncs3sistemas.com.br:17171 XMage.tahiti :xmage.tahiti.one:443 Seedds Server (Asia) :115.29.203.80:17171 diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 01274af98d..67167a7582 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -795,7 +795,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { try { LOGGER.debug("connecting (auto): " + currentConnection.getProxyType().toString() - + " " + currentConnection.getProxyHost() + " " + currentConnection.getProxyPort() + " " + currentConnection.getProxyUsername()); + + ' ' + currentConnection.getProxyHost() + ' ' + currentConnection.getProxyPort() + ' ' + currentConnection.getProxyUsername()); if (MageFrame.connect(currentConnection)) { showGames(false); return true; @@ -1334,7 +1334,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { hideTables(); SessionHandler.disconnect(false); if (errorCall) { - UserRequestMessage message = new UserRequestMessage("Connection lost", "The connection to server was lost. Reconnect to " + currentConnection.getHost() + "?"); + UserRequestMessage message = new UserRequestMessage("Connection lost", "The connection to server was lost. Reconnect to " + currentConnection.getHost() + '?'); message.setButton1("No", null); message.setButton2("Yes", PlayerAction.CLIENT_RECONNECT); showUserRequestDialog(message); diff --git a/Mage.Client/src/main/java/mage/client/cards/BigCard.java b/Mage.Client/src/main/java/mage/client/cards/BigCard.java index cc3417c1b4..3dd8910da5 100644 --- a/Mage.Client/src/main/java/mage/client/cards/BigCard.java +++ b/Mage.Client/src/main/java/mage/client/cards/BigCard.java @@ -141,7 +141,7 @@ public class BigCard extends JComponent { try { for (String line : strings) { - doc.insertString(doc.getLength(), line + "\n", doc.getStyle("regular")); + doc.insertString(doc.getLength(), line + '\n', doc.getStyle("regular")); } } catch (BadLocationException ble) { } diff --git a/Mage.Client/src/main/java/mage/client/cards/Card.java b/Mage.Client/src/main/java/mage/client/cards/Card.java index f8d974caf6..96aff7602a 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Card.java +++ b/Mage.Client/src/main/java/mage/client/cards/Card.java @@ -192,7 +192,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis gImage.setFont(new Font("Arial", Font.PLAIN, NAME_FONT_MAX_SIZE)); gImage.drawString(card.getName()+"TEST", CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET); if (card.getCardTypes().contains(CardType.CREATURE)) { - gImage.drawString(card.getPower() + "/" + card.getToughness(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); + gImage.drawString(card.getPower() + '/' + card.getToughness(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { gImage.drawString(card.getLoyalty(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); } @@ -228,27 +228,27 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StringBuilder sb = new StringBuilder(); if (card instanceof StackAbilityView || card instanceof AbilityView) { for (String rule : getRules()) { - sb.append("\n").append(rule); + sb.append('\n').append(rule); } } else { sb.append(card.getName()); if (card.getManaCost().size() > 0) { - sb.append("\n").append(card.getManaCost()); + sb.append('\n').append(card.getManaCost()); } - sb.append("\n").append(cardType); + sb.append('\n').append(cardType); if (card.getColor().hasColor()) { - sb.append("\n").append(card.getColor().toString()); + sb.append('\n').append(card.getColor().toString()); } if (card.getCardTypes().contains(CardType.CREATURE)) { - sb.append("\n").append(card.getPower()).append("/").append(card.getToughness()); + sb.append('\n').append(card.getPower()).append('/').append(card.getToughness()); } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { - sb.append("\n").append(card.getLoyalty()); + sb.append('\n').append(card.getLoyalty()); } for (String rule : getRules()) { - sb.append("\n").append(rule); + sb.append('\n').append(rule); } if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0) { - sb.append("\n").append(card.getCardNumber()).append(" - "); + sb.append('\n').append(card.getCardNumber()).append(" - "); sb.append(Sets.getInstance().get(card.getExpansionSetCode()).getName()).append(" - "); sb.append(card.getRarity().toString()); } @@ -277,7 +277,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis try { for (String rule : getRules()) { - doc.insertString(doc.getLength(), rule + "\n", doc.getStyle("small")); + doc.insertString(doc.getLength(), rule + '\n', doc.getStyle("small")); } } catch (BadLocationException e) { } @@ -301,17 +301,17 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StringBuilder sbType = new StringBuilder(); for (String superType : card.getSuperTypes()) { - sbType.append(superType).append(" "); + sbType.append(superType).append(' '); } for (CardType cardType : card.getCardTypes()) { - sbType.append(cardType.toString()).append(" "); + sbType.append(cardType.toString()).append(' '); } if (card.getSubTypes().size() > 0) { sbType.append("- "); for (String subType : card.getSubTypes()) { - sbType.append(subType).append(" "); + sbType.append(subType).append(' '); } } diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index e352c154e6..8a4d3a1771 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -708,7 +708,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg @Override public String toString() { - return "(" + sort.toString() + "," + Boolean.toString(separateCreatures) + "," + Integer.toString(cardSize) + ")"; + return '(' + sort.toString() + ',' + Boolean.toString(separateCreatures) + ',' + Integer.toString(cardSize) + ')'; } } @@ -1327,7 +1327,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg if (!s) { String t = ""; for (CardType type : card.getCardTypes()) { - t += " " + type.toString(); + t += ' ' + type.toString(); } s |= t.toLowerCase().contains(searchStr); } @@ -1385,14 +1385,14 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg // Type line String t = ""; for (CardType type : card.getCardTypes()) { - t += " " + type.toString(); + t += ' ' + type.toString(); } // Sub & Super Types for (String str : card.getSuperTypes()) { - t += " " + str.toLowerCase(); + t += ' ' + str.toLowerCase(); } for (String str : card.getSubTypes()) { - t += " " + str.toLowerCase(); + t += ' ' + str.toLowerCase(); } for (String qty : qtys.keySet()) { diff --git a/Mage.Client/src/main/java/mage/client/cards/Permanent.java b/Mage.Client/src/main/java/mage/client/cards/Permanent.java index f5b3dd2494..f9f8fa9b96 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Permanent.java +++ b/Mage.Client/src/main/java/mage/client/cards/Permanent.java @@ -107,24 +107,24 @@ public class Permanent extends Card { sb.append("\n----- Originally -------\n"); sb.append(permanent.getOriginal().getName()); if (permanent.getOriginal().getManaCost().size() > 0) { - sb.append("\n").append(permanent.getOriginal().getManaCost()); + sb.append('\n').append(permanent.getOriginal().getManaCost()); } - sb.append("\n").append(getType(permanent.getOriginal())); + sb.append('\n').append(getType(permanent.getOriginal())); if (permanent.getOriginal().getColor().hasColor()) { - sb.append("\n").append(permanent.getOriginal().getColor().toString()); + sb.append('\n').append(permanent.getOriginal().getColor().toString()); } if (permanent.getOriginal().getCardTypes().contains(CardType.CREATURE)) { - sb.append("\n").append(permanent.getOriginal().getPower()).append("/").append(permanent.getOriginal().getToughness()); + sb.append('\n').append(permanent.getOriginal().getPower()).append('/').append(permanent.getOriginal().getToughness()); } else if (permanent.getOriginal().getCardTypes().contains(CardType.PLANESWALKER)) { - sb.append("\n").append(permanent.getOriginal().getLoyalty()); + sb.append('\n').append(permanent.getOriginal().getLoyalty()); } for (String rule: getRules()) { - sb.append("\n").append(rule); + sb.append('\n').append(rule); } if (permanent.getOriginal().getExpansionSetCode().length() > 0) { - sb.append("\n").append(permanent.getCardNumber()).append(" - "); - sb.append("\n").append(Sets.getInstance().get(permanent.getOriginal().getExpansionSetCode()).getName()).append(" - "); + sb.append('\n').append(permanent.getCardNumber()).append(" - "); + sb.append('\n').append(Sets.getInstance().get(permanent.getOriginal().getExpansionSetCode()).getName()).append(" - "); sb.append(permanent.getOriginal().getRarity().toString()); } // sb.append("\n").append(card.getId()); diff --git a/Mage.Client/src/main/java/mage/client/components/layout/RelativeLayout.java b/Mage.Client/src/main/java/mage/client/components/layout/RelativeLayout.java index a139a2a144..2abca497ac 100644 --- a/Mage.Client/src/main/java/mage/client/components/layout/RelativeLayout.java +++ b/Mage.Client/src/main/java/mage/client/components/layout/RelativeLayout.java @@ -802,6 +802,6 @@ public class RelativeLayout implements LayoutManager2, java.io.Serializable { return getClass().getName() + "[axis=" + axis + ",gap=" + gap - + "]"; + + ']'; } } diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/RatioAdjustingSliderPanel.java b/Mage.Client/src/main/java/mage/client/deck/generator/RatioAdjustingSliderPanel.java index 219bd7ad27..bd6903eaec 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/RatioAdjustingSliderPanel.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/RatioAdjustingSliderPanel.java @@ -168,7 +168,7 @@ public class RatioAdjustingSliderPanel extends JPanel { private static JLabel createChangingPercentageLabel(final JSlider slider) { - final JLabel label = new JLabel(" " + String.valueOf(slider.getValue()) + "%"); + final JLabel label = new JLabel(" " + String.valueOf(slider.getValue()) + '%'); slider.addChangeListener(e -> { String value = String.valueOf(slider.getValue()); @@ -178,7 +178,7 @@ public class RatioAdjustingSliderPanel extends JPanel { labelBuilder.append(" "); } labelBuilder.append(value); - labelBuilder.append("%"); + labelBuilder.append('%'); label.setText(labelBuilder.toString()); }); return label; diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java b/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java index 8437a0b310..241dcc25e4 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java @@ -97,7 +97,7 @@ public class DeckArea extends javax.swing.JPanel { @Override public String toString() { - return maindeckSettings.toString() + "|" + sideboardSetings.toString() + "|" + dividerLocationNormal + "|" + dividerLocationLimited; + return maindeckSettings.toString() + '|' + sideboardSetings.toString() + '|' + dividerLocationNormal + '|' + dividerLocationLimited; } } diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java index 53333ae05d..cb11486d6e 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/DeckEditorPanel.java @@ -584,12 +584,12 @@ public class DeckEditorPanel extends javax.swing.JPanel { int second = s - (minute * 60); String text; if (minute < 10) { - text = "0" + Integer.toString(minute) + ":"; + text = '0' + Integer.toString(minute) + ':'; } else { - text = Integer.toString(minute) + ":"; + text = Integer.toString(minute) + ':'; } if (second < 10) { - text = text + "0" + Integer.toString(second); + text = text + '0' + Integer.toString(second); } else { text = text + Integer.toString(second); } @@ -599,7 +599,7 @@ public class DeckEditorPanel extends javax.swing.JPanel { } if (timeToSubmit > 0) { timeToSubmit--; - btnSubmitTimer.setText("Submit (" + timeToSubmit + ")"); + btnSubmitTimer.setText("Submit (" + timeToSubmit + ')'); btnSubmitTimer.setToolTipText("Submit your deck in " + timeToSubmit + " seconds!"); } } diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java index 94bd8e6152..fce95ec0f8 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java @@ -56,17 +56,17 @@ public class CardHelper { StringBuilder type = new StringBuilder(); for (String superType : c.getSuperTypes()) { type.append(superType); - type.append(" "); + type.append(' '); } for (CardType cardType : c.getCardTypes()) { type.append(cardType.toString()); - type.append(" "); + type.append(' '); } if (c.getSubTypes().size() > 0) { type.append("- "); for (String subType : c.getSubTypes()) { type.append(subType); - type.append(" "); + type.append(' '); } } return type.toString(); diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java index ab692662d5..71f67900d9 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java @@ -86,10 +86,10 @@ public class MageCardComparator implements Comparator { aCom = (float) -1; bCom = (float) -1; if (CardHelper.isCreature(a)) { - aCom = new Float(a.getPower() + "." + (a.getToughness().startsWith("-") ? "0" : a.getToughness())); + aCom = new Float(a.getPower() + '.' + (a.getToughness().startsWith("-") ? "0" : a.getToughness())); } if (CardHelper.isCreature(b)) { - bCom = new Float(b.getPower() + "." + (b.getToughness().startsWith("-") ? "0" : b.getToughness())); + bCom = new Float(b.getPower() + '.' + (b.getToughness().startsWith("-") ? "0" : b.getToughness())); } break; // Rarity diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java index 987ccff8c9..2291e16200 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java @@ -264,7 +264,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid { case 4: return CardHelper.getType(c); case 5: - return CardHelper.isCreature(c) ? c.getPower() + "/" + return CardHelper.isCreature(c) ? c.getPower() + '/' + c.getToughness() : "-"; case 6: return c.getRarity().toString(); diff --git a/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java b/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java index e4a697854a..71ad41544e 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java @@ -134,7 +134,7 @@ public class CardInfoWindowDialog extends MageDialog { public void loadCards(ExileView exile, BigCard bigCard, UUID gameId) { boolean changed = cards.loadCards(exile, bigCard, gameId, true); - String titel = name + " (" + exile.size() + ")"; + String titel = name + " (" + exile.size() + ')'; setTitle(titel); this.setTitelBarToolTip(titel); if (exile.size() > 0) { diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java index a738721cfe..4ee513a38a 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java @@ -397,7 +397,7 @@ public class ConnectDialog extends MageDialog { // pref settings MageFrame.getInstance().setUserPrefsToConnection(connection); - logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort()); + logger.debug("connecting: " + connection.getProxyType() + ' ' + connection.getProxyHost() + ' ' + connection.getProxyPort()); task = new ConnectTask(); task.execute(); } finally { diff --git a/Mage.Client/src/main/java/mage/client/dialog/GameEndDialog.java b/Mage.Client/src/main/java/mage/client/dialog/GameEndDialog.java index 17a6122fc9..2af0eeaa53 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/GameEndDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/GameEndDialog.java @@ -100,7 +100,7 @@ public class GameEndDialog extends MageDialog { StringBuilder sb = new StringBuilder(); for (PlayerView player : gameEndView.getPlayers()) { - sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(" "); + sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' '); } this.txtLife.setText(sb.toString()); @@ -128,8 +128,8 @@ public class GameEndDialog extends MageDialog { sdf.applyPattern( "yyyyMMdd_HHmmss" ); String fileName = new StringBuilder(dir).append(File.separator) .append(sdf.format(gameEndView.getStartTime())) - .append("_").append(gameEndView.getMatchView().getGameType()) - .append("_").append(gameEndView.getMatchView().getGames().size()) + .append('_').append(gameEndView.getMatchView().getGameType()) + .append('_').append(gameEndView.getMatchView().getGames().size()) .append(".txt").toString(); PrintWriter out = new PrintWriter(fileName); out.print(gamePanel.getGameLog()); diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java index 37ef502484..9cb6b7a3ee 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java @@ -673,7 +673,7 @@ public class NewTableDialog extends MageDialog { StringBuilder playerTypesString = new StringBuilder(); for (Object player : players) { if (playerTypesString.length() > 0) { - playerTypesString.append(","); + playerTypesString.append(','); } TablePlayerPanel tpp = (TablePlayerPanel) player; playerTypesString.append(tpp.getPlayerType()); diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index 709d7369e1..a67491bd0f 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -836,7 +836,7 @@ public class NewTournamentDialog extends MageDialog { StringBuilder packList = new StringBuilder(); for (ExpansionInfo exp : allExpansions) { packList.append(exp.getCode()); - packList.append(";"); + packList.append(';'); } txtRandomPacks.setText(packList.toString()); } @@ -860,7 +860,7 @@ public class NewTournamentDialog extends MageDialog { StringBuilder packList = new StringBuilder(); for (String str : randomPackSelector.getSelectedPacks()) { packList.append(str); - packList.append(";"); + packList.append(';'); } this.txtRandomPacks.setText(packList.toString()); this.pack(); @@ -1088,7 +1088,7 @@ public class NewTournamentDialog extends MageDialog { StringBuilder packlist = new StringBuilder(); for (String pack : this.randomPackSelector.getSelectedPacks()){ packlist.append(pack); - packlist.append(";"); + packlist.append(';'); } PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_PACKS_RANDOM_DRAFT, packlist.toString()); } diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java index a722263569..ce5a118398 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java @@ -188,7 +188,7 @@ public class DraftPanel extends javax.swing.JPanel { // If we are logging the draft create a file that will contain // the log. SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); - logFilename = "Draft_" + sdf.format(new Date()) + "_" + draftId + ".txt"; + logFilename = "Draft_" + sdf.format(new Date()) + '_' + draftId + ".txt"; try { Files.write(pathToDraftLog(), "".getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } catch (IOException ex) { @@ -366,12 +366,12 @@ public class DraftPanel extends javax.swing.JPanel { int second = s - (minute * 60); String text; if (minute < 10) { - text = "0" + Integer.toString(minute) + ":"; + text = '0' + Integer.toString(minute) + ':'; } else { - text = Integer.toString(minute) + ":"; + text = Integer.toString(minute) + ':'; } if (second < 10) { - text = text + "0" + Integer.toString(second); + text = text + '0' + Integer.toString(second); } else { text = text + Integer.toString(second); } diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index c4fbcc0bd0..966e036ae6 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -406,7 +406,7 @@ public final class GamePanel extends javax.swing.JPanel { private void saveDividerLocations() { // save panel sizes and divider locations. Rectangle rec = MageFrame.getDesktop().getBounds(); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb); PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_0, Integer.toString(this.jSplitPane0.getDividerLocation())); PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation())); @@ -417,7 +417,7 @@ public final class GamePanel extends javax.swing.JPanel { Rectangle rec = MageFrame.getDesktop().getBounds(); if (rec != null) { String size = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, null); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); // use divider positions only if screen size is the same as it was the time the settings were saved if (size != null && size.equals(sb)) { @@ -764,7 +764,7 @@ public final class GamePanel extends javax.swing.JPanel { } if (game.getSpellsCastCurrentTurn() > 0 && PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_SHOW_STORM_COUNTER, "true").equals("true")) { this.txtSpellsCast.setVisible(true); - this.txtSpellsCast.setText(" " + Integer.toString(game.getSpellsCastCurrentTurn()) + " "); + this.txtSpellsCast.setText(' ' + Integer.toString(game.getSpellsCastCurrentTurn()) + ' '); } else { this.txtSpellsCast.setVisible(false); } @@ -1279,7 +1279,7 @@ public final class GamePanel extends javax.swing.JPanel { pickChoice.showDialog(choice, objectId, choiceWindowState); if (choice.isKeyChoice()) { if (pickChoice.isAutoSelect()) { - SessionHandler.sendPlayerString(gameId, "#" + choice.getChoiceKey()); + SessionHandler.sendPlayerString(gameId, '#' + choice.getChoiceKey()); } else { SessionHandler.sendPlayerString(gameId, choice.getChoiceKey()); } diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index 79d3ddb8a6..d801a15d3a 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -377,11 +377,11 @@ public class HelperPanel extends JPanel { public void handleAutoAnswerPopupMenuEvent(ActionEvent e) { switch (e.getActionCommand()) { case CMD_AUTO_ANSWER_ID_YES: - SessionHandler.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_YES, gameId, originalId.toString() + "#" + message); + SessionHandler.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_YES, gameId, originalId.toString() + '#' + message); clickButton(btnLeft); break; case CMD_AUTO_ANSWER_ID_NO: - SessionHandler.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_NO, gameId, originalId.toString() + "#" + message); + SessionHandler.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_NO, gameId, originalId.toString() + '#' + message); clickButton(btnRight); break; case CMD_AUTO_ANSWER_NAME_YES: diff --git a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java index 8c228cf300..fe3ab8d668 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java @@ -360,7 +360,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { int h = priorityTimeLeft / 3600; int m = (priorityTimeLeft % 3600) / 60; int s = priorityTimeLeft % 60; - return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s; + return (h < 10 ? "0" : "") + h + ':' + (m < 10 ? "0" : "") + m + ':' + (s < 10 ? "0" : "") + s; } protected void update(ManaPoolView pool) { diff --git a/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java b/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java index 98e861c60e..646f2e554f 100644 --- a/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java +++ b/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java @@ -43,7 +43,7 @@ public class MagePreferences { } private static String prefixedKey(String prefix, String key) { - return prefix + "/" + key; + return prefix + '/' + key; } public static String getUserName(String serverAddress) { diff --git a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java index 365f2d6529..c67a88c655 100644 --- a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java @@ -161,11 +161,11 @@ public class PlayersChatPanel extends javax.swing.JPanel { JTableHeader th = jTablePlayers.getTableHeader(); TableColumnModel tcm = th.getColumnModel(); - tcm.getColumn(jTablePlayers.convertColumnIndexToView(1)).setHeaderValue("Players (" + this.players.length + ")"); + tcm.getColumn(jTablePlayers.convertColumnIndexToView(1)).setHeaderValue("Players (" + this.players.length + ')'); tcm.getColumn(jTablePlayers.convertColumnIndexToView(8)).setHeaderValue( "Games " + roomUserInfo.getNumberActiveGames() + (roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads() : " (") - + " limit: " + roomUserInfo.getNumberMaxGames() + ")"); + + " limit: " + roomUserInfo.getNumberMaxGames() + ')'); th.repaint(); this.fireTableDataChanged(); } diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index 4081bcdc2b..72cc9d9e94 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -187,7 +187,7 @@ public class TablesPanel extends javax.swing.JPanel { String pwdColumn = (String) tableModel.getValueAt(modelRow, TableTableModel.COLUMN_PASSWORD); switch (action) { case "Join": - if (owner.equals(SessionHandler.getUserName()) || owner.startsWith(SessionHandler.getUserName() + ",")) { + if (owner.equals(SessionHandler.getUserName()) || owner.startsWith(SessionHandler.getUserName() + ',')) { try { JDesktopPane desktopPane = (JDesktopPane) MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE); JInternalFrame[] windows = desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER); @@ -350,7 +350,7 @@ public class TablesPanel extends javax.swing.JPanel { private void saveDividerLocations() { // save panel sizes and divider locations. Rectangle rec = MageFrame.getDesktop().getBounds(); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb); PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation())); PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPaneTables.getDividerLocation())); @@ -387,7 +387,7 @@ public class TablesPanel extends javax.swing.JPanel { Rectangle rec = MageFrame.getDesktop().getBounds(); if (rec != null) { String size = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, null); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); // use divider positions only if screen size is the same as it was the time the settings were saved if (size != null && size.equals(sb)) { String location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1, null); diff --git a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java index fea2f500e4..884cb53ef4 100644 --- a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java +++ b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java @@ -174,7 +174,7 @@ public class TournamentPanel extends javax.swing.JPanel { private void saveDividerLocations() { // save panel sizes and divider locations. Rectangle rec = MageFrame.getDesktop().getBounds(); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb); PreferencesDialog.saveValue(PreferencesDialog.KEY_TOURNAMENT_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation())); PreferencesDialog.saveValue(PreferencesDialog.KEY_TOURNAMENT_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation())); @@ -184,7 +184,7 @@ public class TournamentPanel extends javax.swing.JPanel { Rectangle rec = MageFrame.getDesktop().getBounds(); if (rec != null) { String size = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, null); - String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight()); + String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight()); // use divider positions only if screen size is the same as it was the time the settings were saved if (size != null && size.equals(sb)) { String location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TOURNAMENT_DIVIDER_LOCATION_1, null); @@ -244,7 +244,7 @@ public class TournamentPanel extends javax.swing.JPanel { c = c.getParent(); } if (c != null) { - ((TournamentPane) c).setTitle("Tournament [" + tournament.getTournamentName() + "]"); + ((TournamentPane) c).setTitle("Tournament [" + tournament.getTournamentName() + ']'); } txtName.setText(tournament.getTournamentName()); txtType.setText(tournament.getTournamentType()); @@ -260,7 +260,7 @@ public class TournamentPanel extends javax.swing.JPanel { if (tournament.getStepStartTime() != null) { timeLeft = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000); } - txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(timeLeft).append(")").toString()); + txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(timeLeft).append(')').toString()); break; case "Dueling": case "Drafting": diff --git a/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java b/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java index ed5dd61d12..7ab38acb40 100644 --- a/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java @@ -59,7 +59,7 @@ public class CardsViewUtil { CardsView cards = new CardsView(); for (SimpleCardView simple: view.values()) { - String key = simple.getExpansionSetCode() + "_" + simple.getCardNumber(); + String key = simple.getExpansionSetCode() + '_' + simple.getCardNumber(); Card card = loadedCards.get(key); if(card == null) { diff --git a/Mage.Client/src/main/java/mage/client/util/Format.java b/Mage.Client/src/main/java/mage/client/util/Format.java index 50b9bdf4ff..492c10f6ee 100644 --- a/Mage.Client/src/main/java/mage/client/util/Format.java +++ b/Mage.Client/src/main/java/mage/client/util/Format.java @@ -62,13 +62,13 @@ public class Format { seconds = seconds % 3600; long m = seconds / 60; long s = seconds % 60; - sb.append(h).append(":"); + sb.append(h).append(':'); if (m<10) { - sb.append("0"); + sb.append('0'); } - sb.append(m).append(":"); + sb.append(m).append(':'); if (s<10) { - sb.append("0"); + sb.append('0'); } sb.append(s); return sb.toString(); diff --git a/Mage.Client/src/main/java/mage/client/util/audio/MusicPlayer.java b/Mage.Client/src/main/java/mage/client/util/audio/MusicPlayer.java index b823ad3ed0..d77d81ef09 100644 --- a/Mage.Client/src/main/java/mage/client/util/audio/MusicPlayer.java +++ b/Mage.Client/src/main/java/mage/client/util/audio/MusicPlayer.java @@ -112,7 +112,7 @@ public class MusicPlayer { volume = (FloatControl) sourceDataLine.getControl(FloatControl.Type.MASTER_GAIN); sourceDataLine.start(); } catch (Exception e) { - log.error("Couldn't load file: " + file + " " + e); + log.error("Couldn't load file: " + file + ' ' + e); } } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java index 081245971d..9dbdb8e3a7 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java @@ -222,7 +222,7 @@ public class GuiDisplayUtil { buffer.append(""); buffer.append(card.getDisplayName()); if (card.isGameObject()) { - buffer.append(" [").append(card.getId().toString().substring(0, 3)).append("]"); + buffer.append(" [").append(card.getId().toString().substring(0, 3)).append(']'); } buffer.append(""); - String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + ">"; + String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + '>'; if (card.getColor().isWhite()) { buffer.append("W"); if (!card.isControlledByOwner()) { if (card instanceof PermanentView) { - buffer.append("[").append(((PermanentView) card).getNameOwner()).append("] "); + buffer.append('[').append(((PermanentView) card).getNameOwner()).append("] "); } else { buffer.append("[only controlled] "); } @@ -361,16 +361,16 @@ public class GuiDisplayUtil { private static String getTypes(CardView card) { String types = ""; for (String superType : card.getSuperTypes()) { - types += superType + " "; + types += superType + ' '; } for (CardType cardType : card.getCardTypes()) { - types += cardType.toString() + " "; + types += cardType.toString() + ' '; } if (card.getSubTypes().size() > 0) { types += "- "; } for (String subType : card.getSubTypes()) { - types += subType + " "; + types += subType + ' '; } return types.trim(); } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/TableUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/TableUtil.java index c86933d041..01c77482b0 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/TableUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/TableUtil.java @@ -59,8 +59,8 @@ public class TableUtil { for (int i = 0; i < table.getColumnModel().getColumnCount(); i++) { TableColumn column = table.getColumnModel().getColumn(table.convertColumnIndexToView(i)); if (!firstValue) { - columnWidthSettings.append(","); - columnOrderSettings.append(","); + columnWidthSettings.append(','); + columnOrderSettings.append(','); } else { firstValue = false; } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/MyComboBoxEditor.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/MyComboBoxEditor.java index 03f3760a31..00c1f256e3 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/MyComboBoxEditor.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/MyComboBoxEditor.java @@ -65,7 +65,7 @@ public class MyComboBoxEditor extends BasicComboBoxEditor { @Override public Object getItem() { - return "[" + this.selectedItem.toString() + "]"; + return '[' + this.selectedItem.toString() + ']'; } @Override diff --git a/Mage.Client/src/main/java/mage/client/util/object/SaveObjectUtil.java b/Mage.Client/src/main/java/mage/client/util/object/SaveObjectUtil.java index 081532510b..f8bb49615a 100644 --- a/Mage.Client/src/main/java/mage/client/util/object/SaveObjectUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/object/SaveObjectUtil.java @@ -53,7 +53,7 @@ public class SaveObjectUtil { } } String time = now(DATE_PATTERN); - File f = new File("income" + File.separator + name + "_" + time + ".save"); + File f = new File("income" + File.separator + name + '_' + time + ".save"); if (!f.exists()) { f.createNewFile(); } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index fd329f538d..81dfd06989 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -681,17 +681,17 @@ public abstract class CardPanel extends MagePermanent implements MouseListener, StringBuilder sbType = new StringBuilder(); for (String superType : card.getSuperTypes()) { - sbType.append(superType).append(" "); + sbType.append(superType).append(' '); } for (CardType cardType : card.getCardTypes()) { - sbType.append(cardType.toString()).append(" "); + sbType.append(cardType.toString()).append(' '); } if (card.getSubTypes().size() > 0) { sbType.append("- "); for (String subType : card.getSubTypes()) { - sbType.append(subType).append(" "); + sbType.append(subType).append(' '); } } @@ -702,30 +702,30 @@ public abstract class CardPanel extends MagePermanent implements MouseListener, StringBuilder sb = new StringBuilder(); if (card instanceof StackAbilityView || card instanceof AbilityView) { for (String rule : card.getRules()) { - sb.append("\n").append(rule); + sb.append('\n').append(rule); } } else { sb.append(card.getName()); if (card.getManaCost().size() > 0) { - sb.append("\n").append(card.getManaCost()); + sb.append('\n').append(card.getManaCost()); } - sb.append("\n").append(cardType); + sb.append('\n').append(cardType); if (card.getColor().hasColor()) { - sb.append("\n").append(card.getColor().toString()); + sb.append('\n').append(card.getColor().toString()); } if (card.getCardTypes().contains(CardType.CREATURE)) { - sb.append("\n").append(card.getPower()).append("/").append(card.getToughness()); + sb.append('\n').append(card.getPower()).append('/').append(card.getToughness()); } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { - sb.append("\n").append(card.getLoyalty()); + sb.append('\n').append(card.getLoyalty()); } if (card.getRules() == null) { card.overrideRules(new ArrayList<>()); } for (String rule : card.getRules()) { - sb.append("\n").append(rule); + sb.append('\n').append(rule); } if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0) { - sb.append("\n").append(card.getCardNumber()).append(" - "); + sb.append('\n').append(card.getCardNumber()).append(" - "); sb.append(card.getExpansionSetCode()).append(" - "); sb.append(card.getRarity().toString()); } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelComponentImpl.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelComponentImpl.java index 827ecc70a5..781df3cb46 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelComponentImpl.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelComponentImpl.java @@ -241,7 +241,7 @@ public class CardPanelComponentImpl extends CardPanel { // PT Text ptText = new GlowText(); if (CardUtil.isCreature(gameCard)) { - ptText.setText(gameCard.getPower() + "/" + gameCard.getToughness()); + ptText.setText(gameCard.getPower() + '/' + gameCard.getToughness()); } else if (CardUtil.isPlaneswalker(gameCard)) { ptText.setText(gameCard.getLoyalty()); } @@ -580,9 +580,9 @@ public class CardPanelComponentImpl extends CardPanel { // Update card text if (CardUtil.isCreature(card) && CardUtil.isPlaneswalker(card)) { - ptText.setText(card.getPower() + "/" + card.getToughness() + " (" + card.getLoyalty() + ")"); + ptText.setText(card.getPower() + '/' + card.getToughness() + " (" + card.getLoyalty() + ')'); } else if (CardUtil.isCreature(card)) { - ptText.setText(card.getPower() + "/" + card.getToughness()); + ptText.setText(card.getPower() + '/' + card.getToughness()); } else if (CardUtil.isPlaneswalker(card)) { ptText.setText(card.getLoyalty()); } else { diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardRenderer.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardRenderer.java index 4b3bcc54b6..fb883c04c9 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardRenderer.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardRenderer.java @@ -380,15 +380,15 @@ public abstract class CardRenderer { } else { StringBuilder sbType = new StringBuilder(); for (String superType : cardView.getSuperTypes()) { - sbType.append(superType).append(" "); + sbType.append(superType).append(' '); } for (CardType cardType : cardView.getCardTypes()) { - sbType.append(cardType.toString()).append(" "); + sbType.append(cardType.toString()).append(' '); } if (cardView.getSubTypes().size() > 0) { sbType.append("- "); for (String subType : cardView.getSubTypes()) { - sbType.append(subType).append(" "); + sbType.append(subType).append(' '); } } return sbType.toString(); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java index 32e2e6c0e7..fdc1b195c3 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -89,7 +89,7 @@ public class ManaSymbols { setImages.put(set, rarityImages); for (String rarityCode : codes) { - File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-" + rarityCode + ".jpg"); + File file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + '-' + rarityCode + ".jpg"); try { Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); int width = image.getWidth(null); @@ -114,11 +114,11 @@ public class ManaSymbols { } for (String code : codes) { - file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set + "-" + code + ".png"); + file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set + '-' + code + ".png"); if (file.exists()) { continue; } - file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + "-" + code + ".jpg"); + file = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set + '-' + code + ".jpg"); Image image = UI.getImageIcon(file.getAbsolutePath()).getImage(); try { int width = image.getWidth(null); @@ -130,7 +130,7 @@ public class ManaSymbols { } Rectangle r = new Rectangle(15 + dx, (int) (height * (15.0f + dx) / width)); BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r); - File newFile = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + File.separator + set + "-" + code + ".png"); + File newFile = new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + File.separator + set + '-' + code + ".png"); ImageIO.write(resized, "png", newFile); } } catch (Exception e) { @@ -171,7 +171,7 @@ public class ManaSymbols { resourcePath = Constants.RESOURCE_PATH_MANA_MEDIUM; } for (String symbol : symbols) { - File file = new File(getSymbolsPath() + resourcePath + "/" + symbol + ".gif"); + File file = new File(getSymbolsPath() + resourcePath + '/' + symbol + ".gif"); try { if (size == 15 || size == 25) { @@ -315,7 +315,7 @@ public class ManaSymbols { if (symbolFilesFound) { replaced = REPLACE_SYMBOLS_PATTERN.matcher(value).replaceAll( "$1$2"); + + " height=" + symbolSize + '>'); } replaced = replaced.replace("|source|", "{source}"); replaced = replaced.replace("|this|", "{this}"); @@ -328,7 +328,7 @@ public class ManaSymbols { int factor = size / 15 + 1; Integer width = setImagesExist.get(_set).width * factor; Integer height = setImagesExist.get(_set).height * factor; - return "" + rarity + ""; + return "" + rarity + ""; } else { return set; } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java b/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java index 562e1f0c69..b727c29d44 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java @@ -638,7 +638,7 @@ public class ModernCardRenderer extends CardRenderer { } g.setColor(textColor); g.setFont(ptTextFont); - String ptText = cardView.getPower() + "/" + cardView.getToughness(); + String ptText = cardView.getPower() + '/' + cardView.getToughness(); int ptTextWidth = g.getFontMetrics().stringWidth(ptText); g.drawString(ptText, x + (partWidth - ptTextWidth) / 2, curY - ptTextOffset - 1); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/constants/Constants.java b/Mage.Client/src/main/java/org/mage/plugins/card/constants/Constants.java index b7744ae219..c5ed731747 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/constants/Constants.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/constants/Constants.java @@ -22,5 +22,5 @@ public class Constants { String IMAGE_PROPERTIES_FILE = "image.url.properties"; } - public static final String CARD_IMAGE_PATH_TEMPLATE = "." + File.separator + "plugins" + File.separator + "images/{set}/{name}.{collector}.full.jpg"; + public static final String CARD_IMAGE_PATH_TEMPLATE = '.' + File.separator + "plugins" + File.separator + "images/{set}/{name}.{collector}.full.jpg"; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java index 049a9f8403..e82220c845 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/DownloadJob.java @@ -167,7 +167,7 @@ public class DownloadJob extends AbstractLaternaBean { @Override public String toString() { - return proxy != null ? proxy.type().toString() + " " : "" + url; + return proxy != null ? proxy.type().toString() + ' ' : "" + url; } }; @@ -196,7 +196,7 @@ public class DownloadJob extends AbstractLaternaBean { @Override public String toString() { - return proxy != null ? proxy.type().toString() + " " : "" + url; + return proxy != null ? proxy.type().toString() + ' ' : "" + url; } }; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardFrames.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardFrames.java index 368f128c9b..1f3228bd07 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardFrames.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardFrames.java @@ -78,8 +78,8 @@ public class CardFrames implements Iterable { private DownloadJob generateDownloadJob(String dirName, String name) { File dst = new File(outDir, name + ".png"); - String url = BASE_DOWNLOAD_URL + dirName + "/" + name + ".png"; - return new DownloadJob("frames-" + dirName + "-" + name, fromURL(url), toFile(dst)); + String url = BASE_DOWNLOAD_URL + dirName + '/' + name + ".png"; + return new DownloadJob("frames-" + dirName + '-' + name, fromURL(url), toFile(dst)); } private void useDefaultDir() { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java index 5d63f8ee15..03420448c9 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java @@ -163,12 +163,12 @@ public class GathererSets implements Iterable { } private DownloadJob generateDownloadJob(String set, String rarity, String urlRarity) { - File dst = new File(outDir, set + "-" + rarity + ".jpg"); + File dst = new File(outDir, set + '-' + rarity + ".jpg"); if (symbolsReplacements.containsKey(set)) { set = symbolsReplacements.get(set); } String url = "http://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=" + set + "&size=small&rarity=" + urlRarity; - return new DownloadJob(set + "-" + rarity, fromURL(url), toFile(dst)); + return new DownloadJob(set + '-' + rarity, fromURL(url), toFile(dst)); } private void changeOutDir(String path) { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java index 485582d6a4..2beb29d6ac 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSymbols.java @@ -54,62 +54,64 @@ public class GathererSymbols implements Iterable { @Override protected DownloadJob computeNext() { - String sym; - if (symIndex < symbols.length) { - sym = symbols[symIndex++]; - } else if (numeric <= maxNumeric) { - sym = "" + (numeric++); - } else { - sizeIndex++; - if (sizeIndex == sizes.length) { - return endOfData(); + while (true) { + String sym; + if (symIndex < symbols.length) { + sym = symbols[symIndex++]; + } else if (numeric <= maxNumeric) { + sym = "" + (numeric++); + } else { + sizeIndex++; + if (sizeIndex == sizes.length) { + return endOfData(); + } + + symIndex = 0; + numeric = 0; + dir = new File(outDir, sizes[sizeIndex]); + continue; + } + String symbol = sym.replaceAll("/", ""); + File dst = new File(dir, symbol + ".gif"); + + /** + * Handle a bug on Gatherer where a few symbols are missing at the large size. + * Fall back to using the medium symbol for those cases. + */ + int modSizeIndex = sizeIndex; + if (sizeIndex == 2) { + switch (sym) { + case "WP": + case "UP": + case "BP": + case "RP": + case "GP": + case "E": + case "C": + modSizeIndex = 1; + break; + + default: + // Nothing to do, symbol is available in the large size + } } - symIndex = 0; - numeric = 0; - dir = new File(outDir, sizes[sizeIndex]); - return computeNext(); - } - String symbol = sym.replaceAll("/", ""); - File dst = new File(dir, symbol + ".gif"); - - /** - * Handle a bug on Gatherer where a few symbols are missing at the large size. - * Fall back to using the medium symbol for those cases. - */ - int modSizeIndex = sizeIndex; - if (sizeIndex == 2) { - switch (sym) { - case "WP": - case "UP": - case "BP": - case "RP": - case "GP": - case "E": - case "C": - modSizeIndex = 1; + switch (symbol) { + case "T": + symbol = "tap"; + break; + case "Q": + symbol = "untap"; + break; + case "S": + symbol = "snow"; break; - - default: - // Nothing to do, symbol is available in the large size } + + String url = format(urlFmt, sizes[modSizeIndex], symbol); + + return new DownloadJob(sym, fromURL(url), toFile(dst)); } - - switch (symbol) { - case "T": - symbol = "tap"; - break; - case "Q": - symbol = "untap"; - break; - case "S": - symbol = "snow"; - break; - } - - String url = format(urlFmt, sizes[modSizeIndex], symbol); - - return new DownloadJob(sym, fromURL(url), toFile(dst)); } }; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java index d9d732b73f..25dbe9bf66 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java @@ -174,20 +174,20 @@ public class MagicCardsImageSource implements CardImageSource { String preferedLanguage = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PREF_LANGUAGE, "en"); - StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append("/"); - url.append(set.toLowerCase()).append("/").append(collectorId); + StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append('/'); + url.append(set.toLowerCase()).append('/').append(collectorId); if (card.isTwoFacedCard()) { url.append(card.isSecondSide() ? "b" : "a"); } if (card.isSplitCard()) { - url.append("a"); + url.append('a'); } if (card.isFlipCard()) { if (card.isFlippedSide()) { // download rotated by 180 degree image - url.append("b"); + url.append('b'); } else { - url.append("a"); + url.append('a'); } } url.append(".jpg"); @@ -200,16 +200,16 @@ public class MagicCardsImageSource implements CardImageSource { String name = card.getName(); // add type to name if it's not 0 if (card.getType() > 0) { - name = name + " " + card.getType(); + name = name + ' ' + card.getType(); } name = name.replaceAll(" ", "-").replace(",", "").toLowerCase(); String set = "not-supported-set"; if (setNameTokenReplacement.containsKey(card.getSet())) { set = setNameTokenReplacement.get(card.getSet()); } else { - set += "-" + card.getSet(); + set += '-' + card.getSet(); } - return "http://magiccards.info/extras/token/" + set + "/" + name + ".jpg"; + return "http://magiccards.info/extras/token/" + set + '/' + name + ".jpg"; } @Override diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagidexImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagidexImageSource.java index 7a39d6768a..46e79774dc 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagidexImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagidexImageSource.java @@ -74,7 +74,7 @@ public class MagidexImageSource implements CardImageSource { } // This will properly escape the url - URI uri = new URI("http", "magidex.com", "/extstatic/card/" + cardSet + "/" + cardDownloadName + ".jpg", null, null); + URI uri = new URI("http", "magidex.com", "/extstatic/card/" + cardSet + '/' + cardDownloadName + ".jpg", null, null); return uri.toASCIIString(); } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgImageSource.java index 25673e33af..96a0ccb5d0 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgImageSource.java @@ -73,7 +73,7 @@ public class MtgImageSource implements CardImageSource { throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet); } StringBuilder url = new StringBuilder("http://mtgimage.com/set/"); - url.append(cardSet.toUpperCase()).append("/"); + url.append(cardSet.toUpperCase()).append('/'); if (card.isSplitCard()) { url.append(card.getDownloadName().replaceAll(" // ", "")); @@ -86,9 +86,9 @@ public class MtgImageSource implements CardImageSource { } if (card.isFlipCard()) { if (card.isFlippedSide()) { // download rotated by 180 degree image - url.append("b"); + url.append('b'); } else { - url.append("a"); + url.append('a'); } } url.append(".jpg"); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java index 23d3275ab4..646894efb3 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java @@ -115,7 +115,7 @@ public class MythicspoilerComSource implements CardImageSource { Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None")); for (String setName : setNames.split("\\^")) { String URLSetName = URLEncoder.encode(setName, "UTF-8"); - String baseUrl = "http://mythicspoiler.com/" + URLSetName + "/"; + String baseUrl = "http://mythicspoiler.com/" + URLSetName + '/'; Map pageLinks = getSetLinksFromPage(cardSet, aliasesStart, prefs, proxyType, baseUrl, baseUrl); setLinks.putAll(pageLinks); @@ -166,7 +166,7 @@ public class MythicspoilerComSource implements CardImageSource { Elements cardsImages = doc.select("img[src^=cards/]"); // starts with cards/ if (!aliasesStart.isEmpty()) { for (String text : aliasesStart) { - cardsImages.addAll(doc.select("img[src^=" + text + "]")); + cardsImages.addAll(doc.select("img[src^=" + text + ']')); } } @@ -179,8 +179,8 @@ public class MythicspoilerComSource implements CardImageSource { cardName = cardLink.substring(0, cardLink.length() - 4); } if (cardName != null && !cardName.isEmpty()) { - if (cardNameAliases.containsKey(cardSet + "-" + cardName)) { - cardName = cardNameAliases.get(cardSet + "-" + cardName); + if (cardNameAliases.containsKey(cardSet + '-' + cardName)) { + cardName = cardNameAliases.get(cardSet + '-' + cardName); } else if (cardName.endsWith("1") || cardName.endsWith("2") || cardName.endsWith("3") || cardName.endsWith("4") || cardName.endsWith("5")) { if (!cardName.startsWith("forest") && !cardName.startsWith("swamp") diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java index fbc1ad88e1..38376e1888 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java @@ -162,19 +162,19 @@ public class TokensMtgImageSource implements CardImageSource { TokenData tokenData; if (type == 0) { if (matchedTokens.size() > 1) { - logger.info("Multiple images were found for token " + name + ", set " + set + "."); + logger.info("Multiple images were found for token " + name + ", set " + set + '.'); } tokenData = matchedTokens.get(0); } else { if (type > matchedTokens.size()) { - logger.warn("Not enough images for token with type " + type + ", name " + name + ", set " + set + "."); + logger.warn("Not enough images for token with type " + type + ", name " + name + ", set " + set + '.'); return null; } tokenData = matchedTokens.get(card.getType() - 1); } - String url = "http://tokens.mtg.onl/tokens/" + tokenData.getExpansionSetCode().trim() + "_" - + tokenData.getNumber().trim() + "-" + tokenData.getName().trim() + ".jpg"; + String url = "http://tokens.mtg.onl/tokens/" + tokenData.getExpansionSetCode().trim() + '_' + + tokenData.getNumber().trim() + '-' + tokenData.getName().trim() + ".jpg"; url = url.replace(' ', '-'); return url; } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java index e0b2b7c9fe..52869723ef 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java @@ -410,11 +410,11 @@ public class WizardCardsImageSource implements CardImageSource { private String normalizeName(String name) { //Split card if(name.contains("//")) { - name = name.substring(0, name.indexOf("(") - 1); + name = name.substring(0, name.indexOf('(') - 1); } //Special timeshifted name if(name.startsWith("XX")) { - name = name.substring(name.indexOf("(") + 1, name.length() - 1); + name = name.substring(name.indexOf('(') + 1, name.length() - 1); } return name.replace("\u2014", "-").replace("\u2019", "'") .replace("\u00C6", "AE").replace("\u00E6", "ae") @@ -456,7 +456,7 @@ public class WizardCardsImageSource implements CardImageSource { } else { link = setLinks.get(Integer.toString(number - 21)); if (link != null) { - link = link.replace(Integer.toString(number - 20), (Integer.toString(number - 20) + "a")); + link = link.replace(Integer.toString(number - 20), (Integer.toString(number - 20) + 'a')); } } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java index 439c89479a..7db13b2326 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java @@ -325,12 +325,12 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab int tokenImages = 0; for (CardDownloadData card : cardsToDownload) { - logger.debug((card.isToken() ? "Token" : "Card") + " image to download: " + card.getName() + " (" + card.getSet() + ")"); + logger.debug((card.isToken() ? "Token" : "Card") + " image to download: " + card.getName() + " (" + card.getSet() + ')'); if (card.isToken()) { tokenImages++; } } - logger.info("Check download images (total card images: " + numberCardImages + ", total token images: " + numberAllTokenImages + ")"); + logger.info("Check download images (total card images: " + numberCardImages + ", total token images: " + numberAllTokenImages + ')'); logger.info(" => Missing card images: " + (cardsToDownload.size() - tokenImages)); logger.info(" => Missing token images: " + tokenImages); return new ArrayList<>(cardsToDownload); @@ -445,7 +445,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab CardDownloadData card = cardsToDownload.get(i); - logger.debug("Downloading card: " + card.getName() + " (" + card.getSet() + ")"); + logger.debug("Downloading card: " + card.getName() + " (" + card.getSet() + ')'); String url; if (ignoreUrls.contains(card.getSet()) || card.isToken()) { @@ -470,7 +470,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab } catch (Exception ex) { } } else if (cardImageSource.getTotalImages() == -1) { - logger.info("Card not available on " + cardImageSource.getSourceName() + ": " + card.getName() + " (" + card.getSet() + ")"); + logger.info("Card not available on " + cardImageSource.getSourceName() + ": " + card.getName() + " (" + card.getSet() + ')'); synchronized (sync) { update(cardIndex + 1, cardsToDownload.size()); } @@ -540,7 +540,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab try { filePath.append(Constants.IO.imageBaseDir); if (!useSpecifiedPaths && card != null) { - filePath.append(card.hashCode()).append(".").append(card.getName().replace(":", "").replace("//", "-")).append(".jpg"); + filePath.append(card.hashCode()).append('.').append(card.getName().replace(":", "").replace("//", "-")).append(".jpg"); temporaryFile = new File(filePath.toString()); } String imagePath; @@ -650,7 +650,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab if (card != null && !useSpecifiedPaths) { logger.warn("Image download for " + card.getName() + (!card.getDownloadName().equals(card.getName()) ? " downloadname: " + card.getDownloadName() : "") - + "(" + card.getSet() + ") failed - responseCode: " + responseCode + " url: " + url.toString()); + + '(' + card.getSet() + ") failed - responseCode: " + responseCode + " url: " + url.toString()); } if (logger.isDebugEnabled()) { // Shows the returned html from the request to the web server logger.debug("Returned HTML ERROR:\n" + convertStreamToString(((HttpURLConnection) httpConn).getErrorStream())); @@ -658,7 +658,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab } } catch (AccessDeniedException e) { - logger.error("The file " + (outputFile != null ? outputFile.toString() : "to add the image of " + card.getName() + "(" + card.getSet() + ")") + " can't be accessed. Try rebooting your system to remove the file lock."); + logger.error("The file " + (outputFile != null ? outputFile.toString() : "to add the image of " + card.getName() + '(' + card.getSet() + ')') + " can't be accessed. Try rebooting your system to remove the file lock."); } catch (Exception e) { logger.error(e, e); } finally { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java index f31d98eea8..5595794bd7 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java @@ -255,11 +255,11 @@ public class ImageCache { * Returns the map key for a card, without any suffixes for the image size. */ private static String getKey(CardView card, String name, String suffix) { - return name + "#" + card.getExpansionSetCode() + "#" + card.getType() + "#" + card.getCardNumber() + "#" + return name + '#' + card.getExpansionSetCode() + '#' + card.getType() + '#' + card.getCardNumber() + '#' + (card.getTokenSetCode() == null ? "" : card.getTokenSetCode()) + suffix + (card.getUsesVariousArt() ? "#usesVariousArt" : "") - + (card.getTokenDescriptor() != null ? "#" + card.getTokenDescriptor() : "#"); + + (card.getTokenDescriptor() != null ? '#' + card.getTokenDescriptor() : "#"); } // /** diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java index 74db210fe9..ed67783972 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/CardImageUtils.java @@ -168,11 +168,11 @@ public class CardImageUtils { String imageDir = getImageDir(card, imagesPath); String imageName; - String type = card.getType() != 0 ? " " + Integer.toString(card.getType()) : ""; + String type = card.getType() != 0 ? ' ' + Integer.toString(card.getType()) : ""; String name = card.getFileName().isEmpty() ? card.getName().replace(":", "").replace("//", "-") : card.getFileName(); if (card.getUsesVariousArt()) { - imageName = name + "." + card.getCollectorId() + ".full.jpg"; + imageName = name + '.' + card.getCollectorId() + ".full.jpg"; } else { imageName = name + type + ".full.jpg"; } diff --git a/Mage.Common/src/mage/db/EntityManagerTest.java b/Mage.Common/src/mage/db/EntityManagerTest.java index fc38832125..339c20ad56 100644 --- a/Mage.Common/src/mage/db/EntityManagerTest.java +++ b/Mage.Common/src/mage/db/EntityManagerTest.java @@ -23,7 +23,7 @@ public class EntityManagerTest { System.out.print(" arguments=[ "); if (log.getArguments() != null) { for (String argument : log.getArguments()) { - System.out.print("arg=" + argument + " "); + System.out.print("arg=" + argument + ' '); } } System.out.println("]"); diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java index 2a989da8dc..f739c45c5e 100644 --- a/Mage.Common/src/mage/remote/Connection.java +++ b/Mage.Common/src/mage/remote/Connection.java @@ -93,7 +93,7 @@ public class Connection { @Override public String toString() { - return host + ":" + Integer.toString(port) + "/" + serialization + parameter; + return host + ':' + Integer.toString(port) + '/' + serialization + parameter; } public String getURI() { @@ -101,13 +101,13 @@ public class Connection { try { InetAddress inet = getLocalAddress(); if (inet != null) { - return transport + "://" + inet.getHostAddress() + ":" + port + "/" + serialization + parameter; + return transport + "://" + inet.getHostAddress() + ':' + port + '/' + serialization + parameter; } } catch (SocketException ex) { // just use localhost if can't find local ip } } - return transport + "://" + host + ":" + port + "/" + serialization + parameter; + return transport + "://" + host + ':' + port + '/' + serialization + parameter; } public ProxyType getProxyType() { diff --git a/Mage.Common/src/mage/remote/SessionImpl.java b/Mage.Common/src/mage/remote/SessionImpl.java index 594bf09430..f8170971dd 100644 --- a/Mage.Common/src/mage/remote/SessionImpl.java +++ b/Mage.Common/src/mage/remote/SessionImpl.java @@ -158,7 +158,7 @@ public class SessionImpl implements Session { StringBuilder sb = new StringBuilder(); sb.append("Unable to connect to server.\n"); for (StackTraceElement element : t.getStackTrace()) { - sb.append(element.toString()).append("\n"); + sb.append(element.toString()).append('\n'); } client.showMessage(sb.toString()); } @@ -171,11 +171,11 @@ public class SessionImpl implements Session { return establishJBossRemotingConnection(connection) && handleRemotingTaskExceptions(new RemotingTask() { @Override public boolean run() throws Throwable { - logger.info("Trying to register as " + getUserName() + " to XMAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Trying to register as " + getUserName() + " to XMAGE server at " + connection.getHost() + ':' + connection.getPort()); boolean registerResult = server.registerUser(sessionId, connection.getUsername(), connection.getPassword(), connection.getEmail()); if (registerResult) { - logger.info("Registered as " + getUserName() + " to MAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Registered as " + getUserName() + " to MAGE server at " + connection.getHost() + ':' + connection.getPort()); } return registerResult; } @@ -187,10 +187,10 @@ public class SessionImpl implements Session { return establishJBossRemotingConnection(connection) && handleRemotingTaskExceptions(new RemotingTask() { @Override public boolean run() throws Throwable { - logger.info("Trying to ask for an auth token to " + getEmail() + " to XMAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Trying to ask for an auth token to " + getEmail() + " to XMAGE server at " + connection.getHost() + ':' + connection.getPort()); boolean result = server.emailAuthToken(sessionId, connection.getEmail()); if (result) { - logger.info("An auth token is emailed to " + getEmail() + " from MAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("An auth token is emailed to " + getEmail() + " from MAGE server at " + connection.getHost() + ':' + connection.getPort()); } return result; } @@ -202,10 +202,10 @@ public class SessionImpl implements Session { return establishJBossRemotingConnection(connection) && handleRemotingTaskExceptions(new RemotingTask() { @Override public boolean run() throws Throwable { - logger.info("Trying reset the password in XMAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Trying reset the password in XMAGE server at " + connection.getHost() + ':' + connection.getPort()); boolean result = server.resetPassword(sessionId, connection.getEmail(), connection.getAuthToken(), connection.getPassword()); if (result) { - logger.info("Password is successfully reset in MAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Password is successfully reset in MAGE server at " + connection.getHost() + ':' + connection.getPort()); } return result; } @@ -218,7 +218,7 @@ public class SessionImpl implements Session { && handleRemotingTaskExceptions(new RemotingTask() { @Override public boolean run() throws Throwable { - logger.info("Trying to log-in as " + getUserName() + " to XMAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Trying to log-in as " + getUserName() + " to XMAGE server at " + connection.getHost() + ':' + connection.getPort()); boolean registerResult; if (connection.getAdminPassword() == null) { // for backward compatibility. don't remove twice call - first one does nothing but for version checking @@ -234,8 +234,8 @@ public class SessionImpl implements Session { if (!connection.getUsername().equals("Admin")) { updateDatabase(connection.isForceDBComparison(), serverState); } - logger.info("Logged-in as " + getUserName() + " to MAGE server at " + connection.getHost() + ":" + connection.getPort()); - client.connected(getUserName() + "@" + connection.getHost() + ":" + connection.getPort() + " "); + logger.info("Logged-in as " + getUserName() + " to MAGE server at " + connection.getHost() + ':' + connection.getPort()); + client.connected(getUserName() + '@' + connection.getHost() + ':' + connection.getPort() + ' '); return true; } disconnect(false); @@ -260,7 +260,7 @@ public class SessionImpl implements Session { boolean result = handleRemotingTaskExceptions(new RemotingTask() { @Override public boolean run() throws Throwable { - logger.info("Trying to connect to XMAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Trying to connect to XMAGE server at " + connection.getHost() + ':' + connection.getPort()); System.setProperty("http.nonProxyHosts", "code.google.com"); System.setProperty("socksNonProxyHosts", "code.google.com"); @@ -391,14 +391,14 @@ public class SessionImpl implements Session { Set callbackConnectors = callbackClient.getCallbackConnectors(callbackHandler); if (callbackConnectors.size() != 1) { - logger.warn("There should be one callback Connector (number existing = " + callbackConnectors.size() + ")"); + logger.warn("There should be one callback Connector (number existing = " + callbackConnectors.size() + ')'); } callbackClient.invoke(null); sessionId = callbackClient.getSessionId(); sessionState = SessionState.CONNECTED; - logger.info("Connected to MAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.info("Connected to MAGE server at " + connection.getHost() + ':' + connection.getPort()); return true; } }); @@ -451,7 +451,7 @@ public class SessionImpl implements Session { break; } if (t.getCause() != null && logger.isDebugEnabled()) { - message = "\n" + t.getCause().getMessage() + message; + message = '\n' + t.getCause().getMessage() + message; logger.debug(t.getCause().getMessage()); } @@ -1434,7 +1434,7 @@ public class SessionImpl implements Session { @Override public boolean endUserSession(String userSessionId) { try { - if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to mute userSessionId " + userSessionId + "?", "WARNING", + if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to mute userSessionId " + userSessionId + '?', "WARNING", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (isConnected()) { server.endUserSession(sessionId, userSessionId); @@ -1470,7 +1470,7 @@ public class SessionImpl implements Session { @Override public boolean setActivation(String userName, boolean active) { try { - if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to set active to " + active + " for user: " + userName + "?", "WARNING", + if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to set active to " + active + " for user: " + userName + '?', "WARNING", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (isConnected()) { server.setActivation(sessionId, userName, active); @@ -1496,7 +1496,7 @@ public class SessionImpl implements Session { JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { return setActivation(userName, false); } - if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to toggle activation for user: " + userName + "?", "WARNING", + if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to toggle activation for user: " + userName + '?', "WARNING", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (isConnected()) { server.toggleActivation(sessionId, userName); @@ -1542,8 +1542,8 @@ public class SessionImpl implements Session { } private void handleInvalidDeckException(InvalidDeckException iex) { - logger.warn(iex.getMessage() + "\n" + iex.getInvalid()); - client.showError(iex.getMessage() + "\n" + iex.getInvalid()); + logger.warn(iex.getMessage() + '\n' + iex.getInvalid()); + client.showError(iex.getMessage() + '\n' + iex.getInvalid()); } private void handleGameException(GameException ex) { @@ -1588,7 +1588,7 @@ public class SessionImpl implements Session { if (isConnected()) { long startTime = System.nanoTime(); if (!server.ping(sessionId, pingInfo)) { - logger.error("Ping failed: " + this.getUserName() + " Session: " + sessionId + " to MAGE server at " + connection.getHost() + ":" + connection.getPort()); + logger.error("Ping failed: " + this.getUserName() + " Session: " + sessionId + " to MAGE server at " + connection.getHost() + ':' + connection.getPort()); throw new MageException("Ping failed"); } pingTime.add(System.nanoTime() - startTime); @@ -1602,7 +1602,7 @@ public class SessionImpl implements Session { sum += time; } milliSeconds = TimeUnit.MILLISECONDS.convert(sum / pingTime.size(), TimeUnit.NANOSECONDS); - pingInfo = lastPing + " (Av: " + (milliSeconds > 0 ? milliSeconds + "ms" : "<1ms") + ")"; + pingInfo = lastPing + " (Av: " + (milliSeconds > 0 ? milliSeconds + "ms" : "<1ms") + ')'; } return true; } catch (MageException ex) { diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index adf31bb5b6..68aeb0f11b 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -77,7 +77,7 @@ public class MageVersion implements Serializable, Comparable { @Override public String toString() { - return major + "." + minor + "." + patch + info + minorPatch; + return major + "." + minor + '.' + patch + info + minorPatch; } @Override diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 3d03b865f2..0548837a35 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -732,7 +732,7 @@ public class CardView extends SimpleCardView { @Override public String toString() { - return getName() + " [" + getId() + "]"; + return getName() + " [" + getId() + ']'; } public boolean isFaceDown() { diff --git a/Mage.Common/src/mage/view/GameEndView.java b/Mage.Common/src/mage/view/GameEndView.java index 8e99e2ee11..830f9fb725 100644 --- a/Mage.Common/src/mage/view/GameEndView.java +++ b/Mage.Common/src/mage/view/GameEndView.java @@ -79,11 +79,11 @@ public class GameEndView implements Serializable { } if (you != null) { if (you.hasWon()) { - gameInfo = new StringBuilder("You won the game on turn ").append(game.getTurnNum()).append(".").toString(); + gameInfo = new StringBuilder("You won the game on turn ").append(game.getTurnNum()).append('.').toString(); } else if (winner > 0) { - gameInfo = new StringBuilder("You lost the game on turn ").append(game.getTurnNum()).append(".").toString(); + gameInfo = new StringBuilder("You lost the game on turn ").append(game.getTurnNum()).append('.').toString(); } else { - gameInfo = new StringBuilder("Game is a draw on Turn ").append(game.getTurnNum()).append(".").toString(); + gameInfo = new StringBuilder("Game is a draw on Turn ").append(game.getTurnNum()).append('.').toString(); } } matchView = new MatchView(table); diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 5ee494809d..1c55dac842 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -138,7 +138,7 @@ public class GameView implements Serializable { if (designation != null) { stack.put(stackObject.getId(), new CardView(designation, (StackAbility) stackObject)); } else { - LOGGER.fatal("Designation object not found: " + object.getName() + " " + object.toString() + " " + object.getClass().toString()); + LOGGER.fatal("Designation object not found: " + object.getName() + ' ' + object.toString() + ' ' + object.getClass().toString()); } } else if (object instanceof StackAbility) { @@ -147,7 +147,7 @@ public class GameView implements Serializable { stack.put(stackObject.getId(), new CardView(((StackAbility) stackObject))); checkPaid(stackObject.getId(), ((StackAbility) stackObject)); } else { - LOGGER.fatal("Object can't be cast to StackAbility: " + object.getName() + " " + object.toString() + " " + object.getClass().toString()); + LOGGER.fatal("Object can't be cast to StackAbility: " + object.getName() + ' ' + object.toString() + ' ' + object.getClass().toString()); } } else { // can happen if a player times out while ability is on the stack diff --git a/Mage.Common/src/mage/view/MatchView.java b/Mage.Common/src/mage/view/MatchView.java index 6b808ebd23..47fc3d6625 100644 --- a/Mage.Common/src/mage/view/MatchView.java +++ b/Mage.Common/src/mage/view/MatchView.java @@ -78,7 +78,7 @@ public class MatchView implements Serializable { this.gameType = match.getOptions().getGameType(); if (table.getName() != null && !table.getName().isEmpty()) { - this.deckType = match.getOptions().getDeckType() + " [" + table.getName() + "]"; + this.deckType = match.getOptions().getDeckType() + " [" + table.getName() + ']'; } else { this.deckType = match.getOptions().getDeckType(); } @@ -102,9 +102,9 @@ public class MatchView implements Serializable { int lostGames = match.getNumGames() - (matchPlayer.getWins() + match.getDraws()); sb1.append(", "); sb2.append(matchPlayer.getName()).append(" ["); - sb2.append(matchPlayer.getWins()).append("-"); + sb2.append(matchPlayer.getWins()).append('-'); if (match.getDraws() > 0) { - sb2.append(match.getDraws()).append("-"); + sb2.append(match.getDraws()).append('-'); } sb2.append(lostGames).append("], "); } @@ -127,14 +127,14 @@ public class MatchView implements Serializable { this.matchName = table.getName(); this.gameType = table.getGameType(); if (table.getTournament().getOptions().getNumberRounds() > 0) { - this.gameType = new StringBuilder(this.gameType).append(" ").append(table.getTournament().getOptions().getNumberRounds()).append(" Rounds").toString(); + this.gameType = new StringBuilder(this.gameType).append(' ').append(table.getTournament().getOptions().getNumberRounds()).append(" Rounds").toString(); } StringBuilder sbDeckType = new StringBuilder(table.getDeckType()); if (!table.getTournament().getBoosterInfo().isEmpty()) { - sbDeckType.append(" ").append(table.getTournament().getBoosterInfo()); + sbDeckType.append(' ').append(table.getTournament().getBoosterInfo()); } if (table.getName() != null && !table.getName().isEmpty()) { - sbDeckType.append(table.getDeckType()).append(" [").append(table.getName()).append("]"); + sbDeckType.append(table.getDeckType()).append(" [").append(table.getName()).append(']'); } this.deckType = sbDeckType.toString(); StringBuilder sb1 = new StringBuilder(); @@ -145,7 +145,7 @@ public class MatchView implements Serializable { StringBuilder sb2 = new StringBuilder(); if (table.getTournament().getRounds().size() > 0) { for (TournamentPlayer tPlayer : table.getTournament().getPlayers()) { - sb2.append(tPlayer.getPlayer().getName()).append(": ").append(tPlayer.getResults()).append(" "); + sb2.append(tPlayer.getPlayer().getName()).append(": ").append(tPlayer.getResults()).append(' '); } } else { sb2.append("Canceled"); diff --git a/Mage.Common/src/mage/view/TableView.java b/Mage.Common/src/mage/view/TableView.java index 52051be04c..1d8b74e041 100644 --- a/Mage.Common/src/mage/view/TableView.java +++ b/Mage.Common/src/mage/view/TableView.java @@ -73,7 +73,7 @@ public class TableView implements Serializable { this.tableName = table.getName(); String tableNameInfo = null; if (tableName != null && !tableName.isEmpty()) { - tableNameInfo = " [" + table.getName() + "]"; + tableNameInfo = " [" + table.getName() + ']'; } this.controllerName = table.getControllerName(); this.tableState = table.getState(); @@ -95,7 +95,7 @@ public class TableView implements Serializable { if (!table.isTournament()) { // MATCH if (table.getState()==TableState.WAITING || table.getState()==TableState.READY_TO_START) { - tableStateText = table.getState().toString() + " (" + table.getMatch().getPlayers().size() + "/" + table.getSeats().length + ")"; + tableStateText = table.getState().toString() + " (" + table.getMatch().getPlayers().size() + '/' + table.getSeats().length + ')'; } else { tableStateText = table.getState().toString(); } @@ -107,10 +107,10 @@ public class TableView implements Serializable { for (MatchPlayer matchPlayer : table.getMatch().getPlayers()) { if (matchPlayer.getPlayer() == null) { sb.append(", ").append("[unknown]"); - sbScore.append("-").append(matchPlayer.getWins()); + sbScore.append('-').append(matchPlayer.getWins()); } else if (!matchPlayer.getName().equals(table.getControllerName())) { sb.append(", ").append(matchPlayer.getName()); - sbScore.append("-").append(matchPlayer.getWins()); + sbScore.append('-').append(matchPlayer.getWins()); } else { sbScore.insert(0, matchPlayer.getWins()).insert(0, " Score: "); } @@ -140,7 +140,7 @@ public class TableView implements Serializable { } else { // TOURNAMENT if (table.getTournament().getOptions().getNumberRounds() > 0) { - this.gameType = new StringBuilder(this.gameType).append(" ").append(table.getTournament().getOptions().getNumberRounds()).append(" Rounds").toString(); + this.gameType = new StringBuilder(this.gameType).append(' ').append(table.getTournament().getOptions().getNumberRounds()).append(" Rounds").toString(); } StringBuilder sb1 = new StringBuilder(); for (TournamentPlayer tp : table.getTournament().getPlayers()) { @@ -152,10 +152,10 @@ public class TableView implements Serializable { StringBuilder infoText = new StringBuilder(); StringBuilder stateText = new StringBuilder(table.getState().toString()); infoText.append("Wins:").append(table.getTournament().getOptions().getMatchOptions().getWinsNeeded()); - infoText.append(" Seats: ").append(table.getTournament().getPlayers().size()).append("/").append(table.getNumberOfSeats()); + infoText.append(" Seats: ").append(table.getTournament().getPlayers().size()).append('/').append(table.getNumberOfSeats()); switch (table.getState()) { 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(')'); case READY_TO_START: case STARTING: infoText.append(" Time: ").append(table.getTournament().getOptions().getMatchOptions().getMatchTimeLimit().toString()); @@ -172,13 +172,13 @@ public class TableView implements Serializable { case DRAFTING: Draft draft = table.getTournament().getDraft(); if (draft != null) { - stateText.append(" ").append(draft.getBoosterNum()).append("/").append(draft.getCardNum() - 1); + stateText.append(' ').append(draft.getBoosterNum()).append('/').append(draft.getCardNum() - 1); } default: } this.additionalInfo = infoText.toString(); this.tableStateText = stateText.toString(); - this.deckType = table.getDeckType() + " " + table.getTournament().getBoosterInfo() + (tableNameInfo != null ? tableNameInfo : ""); + this.deckType = table.getDeckType() + ' ' + table.getTournament().getBoosterInfo() + (tableNameInfo != null ? tableNameInfo : ""); this.skillLevel = table.getTournament().getOptions().getMatchOptions().getSkillLevel(); this.quitRatio = Integer.toString(table.getTournament().getOptions().getQuitRatio()); this.limited = table.getTournament().getOptions().getMatchOptions().isLimited(); diff --git a/Mage.Common/src/mage/view/TournamentGameView.java b/Mage.Common/src/mage/view/TournamentGameView.java index 6aa2263798..8813ec4d94 100644 --- a/Mage.Common/src/mage/view/TournamentGameView.java +++ b/Mage.Common/src/mage/view/TournamentGameView.java @@ -70,14 +70,14 @@ public class TournamentGameView implements Serializable { if (game.hasEnded()) { if (game.getEndTime() != null) { - duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime())/1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime())/1000) + ')'; } this.state = "Finished" + duelingTime; this.result = game.getWinner(); } else { if (game.getStartTime() != null) { - duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime())/1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime())/1000) + ')'; } this.state = "Dueling" + duelingTime; this.result = ""; diff --git a/Mage.Common/src/mage/view/TournamentPlayerView.java b/Mage.Common/src/mage/view/TournamentPlayerView.java index c2a8078a25..198d007435 100644 --- a/Mage.Common/src/mage/view/TournamentPlayerView.java +++ b/Mage.Common/src/mage/view/TournamentPlayerView.java @@ -51,7 +51,7 @@ public class TournamentPlayerView implements Serializable, Comparable { StringBuilder sb = new StringBuilder(tournamentPlayer.getState().toString()); String stateInfo = tournamentPlayer.getStateInfo(); if (!stateInfo.isEmpty()) { - sb.append(" (").append(stateInfo).append(")"); + sb.append(" (").append(stateInfo).append(')'); } sb.append(tournamentPlayer.getDisconnectInfo()); this.state = sb.toString(); diff --git a/Mage.Common/src/mage/view/TournamentView.java b/Mage.Common/src/mage/view/TournamentView.java index ae6ca94a64..8197a72774 100644 --- a/Mage.Common/src/mage/view/TournamentView.java +++ b/Mage.Common/src/mage/view/TournamentView.java @@ -67,7 +67,7 @@ public class TournamentView implements Serializable { typeText.append(" / ").append(tournament.getOptions().getMatchOptions().getDeckType()); } if (tournament.getNumberRounds() > 0) { - typeText.append(" ").append(tournament.getNumberRounds()).append(" rounds"); + typeText.append(' ').append(tournament.getNumberRounds()).append(" rounds"); } tournamentType = typeText.toString(); startTime = tournament.getStartTime(); @@ -79,7 +79,7 @@ public class TournamentView implements Serializable { tournamentState = tournament.getTournamentState(); if (tournament.getTournamentState().equals("Drafting") && tournament.getDraft() != null) { - runningInfo = "booster/card: " + tournament.getDraft().getBoosterNum() +"/" + (tournament.getDraft().getCardNum() -1); + runningInfo = "booster/card: " + tournament.getDraft().getBoosterNum() + '/' + (tournament.getDraft().getCardNum() -1); } else { runningInfo = ""; } diff --git a/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java b/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java index 6a4b6e8620..6851c2c1c3 100644 --- a/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java +++ b/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java @@ -423,7 +423,7 @@ public class ConnectDialog extends JDialog { connection.setProxyPassword(new String(this.txtPasswordField.getPassword())); } - logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort()); + logger.debug("connecting: " + connection.getProxyType() + ' ' + connection.getProxyHost() + ' ' + connection.getProxyPort()); task = new ConnectTask(); task.execute(); diff --git a/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java b/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java index d272053f9b..5e2b590c2b 100644 --- a/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java +++ b/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java @@ -575,14 +575,14 @@ class UpdateUsersTask extends SwingWorker> { for (UserView u2 : usersToCheck) { if (u1.getUserName().equals(u2.getUserName())) { found = true; - String s = u1.getUserName() + "," + u1.getHost(); + String s = u1.getUserName() + ',' + u1.getHost(); if (peopleIps.get(s) == null) { - logger.warn("Found new user: " + u1.getUserName() + "," + u1.getHost()); + logger.warn("Found new user: " + u1.getUserName() + ',' + u1.getHost()); peopleIps.put(s, "1"); } - s = u2.getUserName() + "," + u2.getHost(); + s = u2.getUserName() + ',' + u2.getHost(); if (peopleIps.get(s) == null) { - logger.warn("Found new user: " + u1.getUserName() + "," + u1.getHost()); + logger.warn("Found new user: " + u1.getUserName() + ',' + u1.getHost()); peopleIps.put(s, "1"); } break; diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java index 1d35210ae5..804e336bb7 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java @@ -142,16 +142,16 @@ public class Commander extends Constructed { } else { for (Card commander : deck.getSideboard()) { if (bannedCommander.contains(commander.getName())) { - invalid.put("Commander", "Commander banned (" + commander.getName() + ")"); + invalid.put("Commander", "Commander banned (" + commander.getName() + ')'); valid = false; } if ((!commander.getCardType().contains(CardType.CREATURE) || !commander.getSupertype().contains("Legendary")) && (!commander.getCardType().contains(CardType.PLANESWALKER) || !commander.getAbilities().contains(CanBeYourCommanderAbility.getInstance()))) { - invalid.put("Commander", "Commander invalid (" + commander.getName() + ")"); + invalid.put("Commander", "Commander invalid (" + commander.getName() + ')'); valid = false; } if (deck.getSideboard().size() == 2 && !commander.getAbilities().contains(PartnerAbility.getInstance())) { - invalid.put("Commander", "Commander without Partner (" + commander.getName() + ")"); + invalid.put("Commander", "Commander without Partner (" + commander.getName() + ')'); valid = false; } FilterMana commanderColor = CardUtil.getColorIdentity(commander); @@ -174,7 +174,7 @@ public class Commander extends Constructed { } for (Card card : deck.getCards()) { if (!cardHasValidColor(colorIdentity, card)) { - invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ")"); + invalid.put(card.getName(), "Invalid color (" + colorIdentity.toString() + ')'); valid = false; } } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java index cf8896ccac..ab3b3ec42f 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java @@ -189,11 +189,11 @@ public class TinyLeaders extends Constructed { } } } else { - invalid.put("Commander", "Commander banned (" + commander.getName() + ")"); + invalid.put("Commander", "Commander banned (" + commander.getName() + ')'); valid = false; } } else { - invalid.put("Commander", "Commander invalide (" + commander.getName() + ")"); + invalid.put("Commander", "Commander invalide (" + commander.getName() + ')'); valid = false; } } else { @@ -221,22 +221,22 @@ public class TinyLeaders extends Constructed { private boolean isCardFormatValid(Card card, Card commander, FilterMana color) { if (!cardHasValideColor(color, card)) { - invalid.put(card.getName(), "Invalid color (" + commander.getName() + ")"); + invalid.put(card.getName(), "Invalid color (" + commander.getName() + ')'); return false; } //905.5b - Converted mana cost must be 3 or less if (card instanceof SplitCard) { if (((SplitCard) card).getLeftHalfCard().getManaCost().convertedManaCost() > 3) { - invalid.put(card.getName(), "Invalid cost (" + ((SplitCard) card).getLeftHalfCard().getManaCost().convertedManaCost() + ")"); + invalid.put(card.getName(), "Invalid cost (" + ((SplitCard) card).getLeftHalfCard().getManaCost().convertedManaCost() + ')'); return false; } if (((SplitCard) card).getRightHalfCard().getManaCost().convertedManaCost() > 3) { - invalid.put(card.getName(), "Invalid cost (" + ((SplitCard) card).getRightHalfCard().getManaCost().convertedManaCost() + ")"); + invalid.put(card.getName(), "Invalid cost (" + ((SplitCard) card).getRightHalfCard().getManaCost().convertedManaCost() + ')'); return false; } } else if (card.getManaCost().convertedManaCost() > 3) { - invalid.put(card.getName(), "Invalid cost (" + card.getManaCost().convertedManaCost() + ")"); + invalid.put(card.getName(), "Invalid cost (" + card.getManaCost().convertedManaCost() + ')'); return false; } return true; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 908ae33f08..17b7cf9a50 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -244,9 +244,9 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { logger.info(new StringBuilder("[").append(game.getPlayer(playerId).getName()).append("], life = ").append(player.getLife()).toString()); StringBuilder sb = new StringBuilder("-> Hand: ["); for (Card card : player.getHand().getCards(game)) { - sb.append(card.getName()).append(";"); + sb.append(card.getName()).append(';'); } - logger.info(sb.append("]").toString()); + logger.info(sb.append(']').toString()); sb.setLength(0); sb.append("-> Permanents: ["); for (Permanent permanent : game.getBattlefield().getAllPermanents()) { @@ -258,10 +258,10 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { if (permanent.isAttacking()) { sb.append("(attacking)"); } - sb.append(";"); + sb.append(';'); } } - logger.info(sb.append("]").toString()); + logger.info(sb.append(']').toString()); } protected void act(Game game) { @@ -329,7 +329,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { //System.out.println("[" + game.getPlayer(playerId).getName() + "] Action: not better score"); //} } else { - logger.info("[" + game.getPlayer(playerId).getName() + "] Action: skip Root.score = " + root.getScore() + " currentScore = " + currentScore); + logger.info('[' + game.getPlayer(playerId).getName() + "] Action: skip Root.score = " + root.getScore() + " currentScore = " + currentScore); } } } @@ -372,7 +372,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { } protected int minimaxAB(SimulationNode2 node, int depth, int alpha, int beta) { - logger.trace("Sim minimaxAB [" + depth + "] -- a: " + alpha + " b: " + beta + " <" + (node != null ? node.getScore() : "null") + ">"); + logger.trace("Sim minimaxAB [" + depth + "] -- a: " + alpha + " b: " + beta + " <" + (node != null ? node.getScore() : "null") + '>'); UUID currentPlayerId = node.getGame().getPlayerList().get(); SimulationNode2 bestChild = null; for (SimulationNode2 child : node.getChildren()) { @@ -569,7 +569,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { List allActions = currentPlayer.simulatePriority(game); optimize(game, allActions); if (logger.isInfoEnabled() && allActions.size() > 0 && depth == maxDepth) { - logger.info("ADDED ACTIONS (" + allActions.size() + ") " + " " + allActions); + logger.info("ADDED ACTIONS (" + allActions.size() + ") " + ' ' + allActions); } int counter = 0; int bestValSubNodes = Integer.MIN_VALUE; @@ -606,18 +606,18 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { } else { val = addActions(newNode, depth - 1, alpha, beta); } - logger.debug("Sim Prio " + BLANKS.substring(0, 2 + (maxDepth - depth) * 3) + "[" + depth + "]#" + counter + " <" + val + "> - (" + action.toString() + ") "); + logger.debug("Sim Prio " + BLANKS.substring(0, 2 + (maxDepth - depth) * 3) + '[' + depth + "]#" + counter + " <" + val + "> - (" + action.toString() + ") "); if (logger.isInfoEnabled() && depth >= maxDepth) { StringBuilder sb = new StringBuilder("Sim Prio [").append(depth).append("] #").append(counter) .append(" <").append(val).append("> (").append(action) .append(action.isModal() ? " Mode = " + action.getModes().getMode().toString() : "") - .append(listTargets(game, action.getTargets())).append(")") + .append(listTargets(game, action.getTargets())).append(')') .append(logger.isTraceEnabled() ? " #" + newNode.hashCode() : ""); SimulationNode2 logNode = newNode; while (logNode.getChildren() != null && logNode.getChildren().size() > 0) { logNode = logNode.getChildren().get(0); if (logNode.getAbilities() != null && logNode.getAbilities().size() > 0) { - sb.append(" -> [").append(logNode.getDepth()).append("]").append(logNode.getAbilities().toString()).append("<").append(logNode.getScore()).append(">"); + sb.append(" -> [").append(logNode.getDepth()).append(']').append(logNode.getAbilities().toString()).append('<').append(logNode.getScore()).append('>'); } } logger.info(sb); @@ -1437,7 +1437,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { StringBuilder sb = new StringBuilder(); if (targets != null) { for (Target target : targets) { - sb.append("[").append(target.getTargetedName(game)).append("]"); + sb.append('[').append(target.getTargetedName(game)).append(']'); } if (sb.length() > 0) { sb.insert(0, " targeting "); diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java index c1ff29cb74..9dc9c24766 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java @@ -174,7 +174,7 @@ public class ComputerPlayer7 extends ComputerPlayer6 { if (root.abilities.size() == 1) { for (Ability ability : root.abilities) { if (ability.getManaCosts().convertedManaCost() == 0 && ability.getCosts().isEmpty()) { - if (actionCache.contains(ability.getRule() + "_" + ability.getSourceId())) { + if (actionCache.contains(ability.getRule() + '_' + ability.getSourceId())) { doThis = false; // don't do it again } } @@ -184,11 +184,11 @@ public class ComputerPlayer7 extends ComputerPlayer6 { actions = new LinkedList<>(root.abilities); combat = root.combat; for (Ability ability : actions) { - actionCache.add(ability.getRule() + "_" + ability.getSourceId()); + actionCache.add(ability.getRule() + '_' + ability.getSourceId()); } } } else { - logger.info("[" + game.getPlayer(playerId).getName() + "][pre] Action: skip"); + logger.info('[' + game.getPlayer(playerId).getName() + "][pre] Action: skip"); } } else { logger.debug("Next Action exists!"); @@ -211,10 +211,10 @@ public class ComputerPlayer7 extends ComputerPlayer6 { actions = new LinkedList<>(root.abilities); combat = root.combat; } else { - logger.debug("[" + game.getPlayer(playerId).getName() + "] no better score current: " + currentScore + " bestScore: " + bestScore); + logger.debug('[' + game.getPlayer(playerId).getName() + "] no better score current: " + currentScore + " bestScore: " + bestScore); } } else { - logger.debug("[" + game.getPlayer(playerId).getName() + "][post] Action: skip"); + logger.debug('[' + game.getPlayer(playerId).getName() + "][post] Action: skip"); } } } @@ -236,10 +236,10 @@ public class ComputerPlayer7 extends ComputerPlayer6 { if (depth <= 0 || SimulationNode2.nodeCount > maxNodes || game.gameOver(null)) { val = GameStateEvaluator2.evaluate(playerId, game); if (logger.isTraceEnabled()) { - StringBuilder sb = new StringBuilder("Add Actions -- reached end state <").append(val).append(">"); + StringBuilder sb = new StringBuilder("Add Actions -- reached end state <").append(val).append('>'); SimulationNode2 logNode = node; do { - sb.append(new StringBuilder(" <- [" + logNode.getDepth() + "]" + (logNode.getAbilities() != null ? logNode.getAbilities().toString() : "[empty]"))); + sb.append(new StringBuilder(" <- [" + logNode.getDepth() + ']' + (logNode.getAbilities() != null ? logNode.getAbilities().toString() : "[empty]"))); logNode = logNode.getParent(); } while ((logNode.getParent() != null)); logger.trace(sb); @@ -253,7 +253,7 @@ public class ComputerPlayer7 extends ComputerPlayer6 { for (SimulationNode2 logNode : node.getChildren()) { sb.append(logNode.getAbilities() != null ? logNode.getAbilities().toString() : "null").append(", "); } - sb.append(")"); + sb.append(')'); logger.debug(sb); } val = minimaxAB(node, depth - 1, alpha, beta); @@ -308,7 +308,7 @@ public class ComputerPlayer7 extends ComputerPlayer6 { for (SimulationNode2 logNode : node.getChildren()) { sb.append(logNode.getAbilities() != null ? logNode.getAbilities().toString() : "null").append(", "); } - sb.append(")"); + sb.append(')'); logger.debug(sb); } diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java index 68661f92b8..7c762ebe3d 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java @@ -64,7 +64,7 @@ public class GameStateEvaluator2 { int onePermScore = evaluatePermanent(permanent, game); playerScore += onePermScore; if (logger.isDebugEnabled()) { - sbPlayer.append(permanent.getName()).append("[").append(onePermScore).append("] "); + sbPlayer.append(permanent.getName()).append('[').append(onePermScore).append("] "); } } if (logger.isDebugEnabled()) { @@ -78,7 +78,7 @@ public class GameStateEvaluator2 { int onePermScore = evaluatePermanent(permanent, game); opponentScore += onePermScore; if (logger.isDebugEnabled()) { - sbOpponent.append(permanent.getName()).append("[").append(onePermScore).append("] "); + sbOpponent.append(permanent.getName()).append('[').append(onePermScore).append("] "); } } if (logger.isDebugEnabled()) { @@ -97,7 +97,7 @@ public class GameStateEvaluator2 { handScore *= 5; int score = lifeScore + permanentScore + handScore; - logger.debug(score + " total Score (life:" + lifeScore + " permanents:" + permanentScore + " hand:" + handScore + ")"); + logger.debug(score + " total Score (life:" + lifeScore + " permanents:" + permanentScore + " hand:" + handScore + ')'); return score; } diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java index 6ae7612a78..8699ba43a4 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java @@ -170,7 +170,7 @@ public class SimulatedPlayer2 extends ComputerPlayer { } } // add the specific value for x - newAbility.getManaCostsToPay().add(new ManaCostsImpl(new StringBuilder("{").append(xAmount).append("}").toString())); + newAbility.getManaCostsToPay().add(new ManaCostsImpl(new StringBuilder("{").append(xAmount).append('}').toString())); newAbility.getManaCostsToPay().setX(xAmount); if (varCost != null) { varCost.setPaid(); @@ -338,7 +338,7 @@ public class SimulatedPlayer2 extends ComputerPlayer { binary.setLength(0); binary.append(Integer.toBinaryString(i)); while (binary.length() < attackersList.size()) { - binary.insert(0, "0"); + binary.insert(0, '0'); } for (int j = 0; j < attackersList.size(); j++) { if (binary.charAt(j) == '1') { diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java index a511893676..3ea315a049 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java @@ -161,7 +161,7 @@ public class CombatUtil { UUID attackerId = game.getCombat().getAttackerId(); UUID defenderId = game.getCombat().getDefenders().iterator().next(); if (attackerId == null || defenderId == null) { - log.warn("Couldn't find attacker or defender: " + attackerId + " " + defenderId); + log.warn("Couldn't find attacker or defender: " + attackerId + ' ' + defenderId); return new CombatInfo(); } @@ -298,7 +298,7 @@ public class CombatUtil { UUID attackerId = game.getCombat().getAttackerId(); UUID defenderId = game.getCombat().getDefenders().iterator().next(); if (attackerId == null || defenderId == null) { - log.warn("Couldn't find attacker or defender: " + attackerId + " " + defenderId); + log.warn("Couldn't find attacker or defender: " + attackerId + ' ' + defenderId); return new CombatInfo(); } diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 75e70c3c8d..2ec47e1f00 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -199,7 +199,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options) { if (log.isDebugEnabled()) { - log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString()); + log.debug("chooseTarget: " + outcome.toString() + ':' + target.toString()); } // sometimes a target selection can be made from a player that does not control the ability UUID abilityControllerId = playerId; @@ -450,7 +450,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) { if (log.isDebugEnabled()) { - log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString()); + log.debug("chooseTarget: " + outcome.toString() + ':' + target.toString()); } // sometimes a target selection can be made from a player that does not control the ability UUID abilityControllerId = playerId; @@ -817,7 +817,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { if (log.isDebugEnabled()) { - log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString()); + log.debug("chooseTarget: " + outcome.toString() + ':' + target.toString()); } UUID opponentId = game.getOpponents(playerId).iterator().next(); if (target.getOriginalTarget() instanceof TargetCreatureOrPlayerAmount) { @@ -1999,7 +1999,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { for (int i = 1; i < powerElements; i++) { String binary = Integer.toBinaryString(i); while (binary.length() < attackersList.size()) { - binary = "0" + binary; + binary = '0' + binary; } List trialAttackers = new ArrayList<>(); for (int j = 0; j < attackersList.size(); j++) { @@ -2119,7 +2119,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { StringBuilder sb = new StringBuilder(); sb.append(message).append(": "); for (MageObject object : list) { - sb.append(object.getName()).append(","); + sb.append(object.getName()).append(','); } log.info(sb.toString()); } @@ -2128,7 +2128,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { StringBuilder sb = new StringBuilder(); sb.append(message).append(": "); for (Ability ability : list) { - sb.append(ability.getRule()).append(","); + sb.append(ability.getRule()).append(','); } log.debug(sb.toString()); } diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java index e36bde422e..bfacd03fdb 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java @@ -215,7 +215,7 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { UUID opponentId = game.getCombat().getDefenders().iterator().next(); for (UUID attackerId: combat.getAttackers()) { this.declareAttacker(attackerId, opponentId, game, false); - sb.append(game.getPermanent(attackerId).getName()).append(","); + sb.append(game.getPermanent(attackerId).getName()).append(','); } logger.info(sb.toString()); MCTSNode.logHitMiss(); @@ -233,9 +233,9 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { sb.append(game.getPermanent(groups.get(i).getAttackers().get(0)).getName()).append(" with: "); for (UUID blockerId: combat.getGroups().get(i).getBlockers()) { this.declareBlocker(this.getId(), blockerId, groups.get(i).getAttackers().get(0), game); - sb.append(game.getPermanent(blockerId).getName()).append(","); + sb.append(game.getPermanent(blockerId).getName()).append(','); } - sb.append("|"); + sb.append('|'); } } logger.info(sb.toString()); @@ -448,7 +448,7 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { StringBuilder sb = new StringBuilder(); sb.append(game.getTurn().getValue(game.getTurnNum())); for (Player player: game.getPlayers().values()) { - sb.append("[player ").append(player.getName()).append(":").append(player.getLife()).append("]"); + sb.append("[player ").append(player.getName()).append(':').append(player.getLife()).append(']'); } logger.info(sb.toString()); } diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java index f28f868392..7eef75f10e 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java @@ -567,9 +567,9 @@ public class MCTSNode { public static void logHitMiss() { if (USE_ACTION_CACHE) { StringBuilder sb = new StringBuilder(); - sb.append("Playables Cache -- Hits: ").append(playablesHit).append(" Misses: ").append(playablesMiss).append("\n"); - sb.append("Attacks Cache -- Hits: ").append(attacksHit).append(" Misses: ").append(attacksMiss).append("\n"); - sb.append("Blocks Cache -- Hits: ").append(blocksHit).append(" Misses: ").append(blocksMiss).append("\n"); + sb.append("Playables Cache -- Hits: ").append(playablesHit).append(" Misses: ").append(playablesMiss).append('\n'); + sb.append("Attacks Cache -- Hits: ").append(attacksHit).append(" Misses: ").append(attacksMiss).append('\n'); + sb.append("Blocks Cache -- Hits: ").append(blocksHit).append(" Misses: ").append(blocksMiss).append('\n'); logger.info(sb.toString()); } } diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java index 9c2769eb1d..d7589f2636 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java @@ -131,7 +131,7 @@ public class MCTSPlayer extends ComputerPlayer { binary.setLength(0); binary.append(Integer.toBinaryString(i)); while (binary.length() < attackersList.size()) { - binary.insert(0, "0"); + binary.insert(0, '0'); } List engagement = new ArrayList(); for (int j = 0; j < attackersList.size(); j++) { diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java index 2c015d350c..344964fb75 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java @@ -195,7 +195,7 @@ public class SimulatedPlayerMCTS extends MCTSPlayer { StringBuilder binary = new StringBuilder(); binary.append(Integer.toBinaryString(value)); while (binary.length() < attackersList.size()) { - binary.insert(0, "0"); //pad with zeros + binary.insert(0, '0'); //pad with zeros } for (int i = 0; i < attackersList.size(); i++) { if (binary.charAt(i) == '1') { diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java index 3141c5227e..3cba31ffd9 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java @@ -297,7 +297,7 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { task.get(maxThink, TimeUnit.SECONDS); long endTime = System.nanoTime(); long duration = endTime - startTime; - logger.info("Calculated " + SimulationNode.nodeCount + " nodes in " + duration/1000000000.0 + "s"); + logger.info("Calculated " + SimulationNode.nodeCount + " nodes in " + duration/1000000000.0 + 's'); nodeCount += SimulationNode.nodeCount; thinkTime += duration; } catch (TimeoutException e) { @@ -311,7 +311,7 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { } long endTime = System.nanoTime(); long duration = endTime - startTime; - logger.info("Timeout - Calculated " + SimulationNode.nodeCount + " nodes in " + duration/1000000000.0 + "s"); + logger.info("Timeout - Calculated " + SimulationNode.nodeCount + " nodes in " + duration/1000000000.0 + 's'); nodeCount += SimulationNode.nodeCount; thinkTime += duration; } catch (ExecutionException e) { diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java index 743c6a6544..fdefaa68d2 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java @@ -172,7 +172,7 @@ public class SimulatedPlayer extends ComputerPlayer { binary.setLength(0); binary.append(Integer.toBinaryString(i)); while (binary.length() < attackersList.size()) { - binary.insert(0, "0"); + binary.insert(0, '0'); } for (int j = 0; j < attackersList.size(); j++) { if (binary.charAt(j) == '1') { diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index ea2af12d1a..c199fda2c5 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -990,7 +990,7 @@ public class HumanPlayer extends PlayerImpl { } else { Permanent creature = game.getPermanent(creatureId); if (creature != null) { - sb.append(creature.getIdName()).append(" "); + sb.append(creature.getIdName()).append(' '); } } @@ -1066,7 +1066,7 @@ public class HumanPlayer extends PlayerImpl { StringBuilder sb = new StringBuilder(target.getTargetName()); Permanent attacker = game.getPermanent(attackerId); if (attacker != null) { - sb.append(" (").append(attacker.getName()).append(")"); + sb.append(" (").append(attacker.getName()).append(')'); target.setTargetName(sb.toString()); } } @@ -1493,7 +1493,7 @@ public class HumanPlayer extends PlayerImpl { this.quit(game); return; } - logger.debug("Setting game priority to " + getId() + " [" + methodName + "]"); + logger.debug("Setting game priority to " + getId() + " [" + methodName + ']'); game.getState().setPriorityPlayerId(getId()); } } diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 69c51f2a6d..0127a61cb1 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -161,7 +161,7 @@ public class ChatManager { colour = "green"; } messageToCheck = messageToCheck.replaceFirst("\\[" + cardName + "\\]", "card"); - String displayCardName = "" + cardName + ""; + String displayCardName = ""; message = message.replaceFirst("\\[" + cardName + "\\]", displayCardName); } } @@ -220,7 +220,7 @@ public class ChatManager { } if (command.startsWith("W ") || command.startsWith("WHISPER ")) { String rest = message.substring(command.startsWith("W ") ? 3 : 9); - int first = rest.indexOf(" "); + int first = rest.indexOf(' '); if (first > 1) { String userToName = rest.substring(0, first); rest = rest.substring(first + 1).trim(); diff --git a/Mage.Server/src/main/java/mage/server/ChatSession.java b/Mage.Server/src/main/java/mage/server/ChatSession.java index fdb5f58f90..0f97c01ca6 100644 --- a/Mage.Server/src/main/java/mage/server/ChatSession.java +++ b/Mage.Server/src/main/java/mage/server/ChatSession.java @@ -67,7 +67,7 @@ public class ChatSession { if (!clients.containsKey(userId)) { String userName = user.getName(); clients.put(userId, userName); - broadcast(null, userName + " has joined (" + user.getClientVersion() + ")", MessageColor.BLUE, true, MessageType.STATUS, null); + broadcast(null, userName + " has joined (" + user.getClientVersion() + ')', MessageColor.BLUE, true, MessageType.STATUS, null); logger.trace(userName + " joined chat " + chatId); } }); @@ -84,7 +84,7 @@ public class ChatSession { String userName = clients.get(userId); if (reason != DisconnectReason.LostConnection) { // for lost connection the user will be reconnected or session expire so no remove of chat yet clients.remove(userId); - logger.debug(userName + "(" + reason.toString() + ")" + " removed from chatId " + chatId); + logger.debug(userName + '(' + reason.toString() + ')' + " removed from chatId " + chatId); } String message; switch (reason) { @@ -107,7 +107,7 @@ public class ChatSession { message = null; break; default: - message = " left (" + reason.toString() + ")"; + message = " left (" + reason.toString() + ')'; } if (message != null) { broadcast(null, userName + message, MessageColor.BLUE, true, MessageType.STATUS, null); diff --git a/Mage.Server/src/main/java/mage/server/MageServerImpl.java b/Mage.Server/src/main/java/mage/server/MageServerImpl.java index d4384d241c..255d29b4d1 100644 --- a/Mage.Server/src/main/java/mage/server/MageServerImpl.java +++ b/Mage.Server/src/main/java/mage/server/MageServerImpl.java @@ -118,7 +118,7 @@ public class MageServerImpl implements MageServer { String authToken = generateAuthToken(); activeAuthTokens.put(email, authToken); String subject = "XMage Password Reset Auth Token"; - String text = "Use this auth token to reset " + authorizedUser.name + "'s password: " + authToken + "\n" + String text = "Use this auth token to reset " + authorizedUser.name + "'s password: " + authToken + '\n' + "It's valid until the next server restart."; boolean success; if (!ConfigSettings.getInstance().getMailUser().isEmpty()) { @@ -221,13 +221,13 @@ public class MageServerImpl implements MageServer { // check if the user itself satisfies the quitRatio requirement. int quitRatio = options.getQuitRatio(); if (quitRatio < user.getMatchQuitRatio()) { - user.showUserMessage("Create table", "Your quit ratio " + user.getMatchQuitRatio() + "% is higher than the table requirement " + quitRatio + "%"); + user.showUserMessage("Create table", "Your quit ratio " + user.getMatchQuitRatio() + "% is higher than the table requirement " + quitRatio + '%'); throw new MageException("No message"); } TableView table = GamesRoomManager.getInstance().getRoom(roomId).createTable(userId, options); if (logger.isDebugEnabled()) { - logger.debug("TABLE created - tableId: " + table.getTableId() + " " + table.getTableName()); + logger.debug("TABLE created - tableId: " + table.getTableId() + ' ' + table.getTableName()); logger.debug("- " + user.getName() + " userId: " + user.getId()); logger.debug("- chatId: " + TableManager.getInstance().getChatId(table.getTableId())); } @@ -274,7 +274,7 @@ public class MageServerImpl implements MageServer { int quitRatio = options.getQuitRatio(); if (quitRatio < user.getTourneyQuitRatio()) { String message = new StringBuilder("Your quit ratio ").append(user.getTourneyQuitRatio()) - .append("% is higher than the table requirement ").append(quitRatio).append("%").toString(); + .append("% is higher than the table requirement ").append(quitRatio).append('%').toString(); user.showUserMessage("Create tournament", message); throw new MageException("No message"); } @@ -323,7 +323,7 @@ public class MageServerImpl implements MageServer { if (logger.isTraceEnabled()) { Optional user = UserManager.getInstance().getUser(userId); if (user.isPresent()) { - logger.trace("join tourn. tableId: " + tableId + " " + name); + logger.trace("join tourn. tableId: " + tableId + ' ' + name); } } if (userId == null) { @@ -962,7 +962,7 @@ public class MageServerImpl implements MageServer { User user = UserManager.getInstance().getUserByName(userName); if (user != null) { Date muteUntil = new Date(Calendar.getInstance().getTimeInMillis() + (durationMinutes * Timer.ONE_MINUTE)); - user.showUserMessage("Admin info", "You were muted for chat messages until " + SystemUtil.dateFormat.format(muteUntil) + "."); + user.showUserMessage("Admin info", "You were muted for chat messages until " + SystemUtil.dateFormat.format(muteUntil) + '.'); user.setChatLockedUntil(muteUntil); } @@ -975,7 +975,7 @@ public class MageServerImpl implements MageServer { User user = UserManager.getInstance().getUserByName(userName); if (user != null) { Date lockUntil = new Date(Calendar.getInstance().getTimeInMillis() + (durationMinutes * Timer.ONE_MINUTE)); - user.showUserMessage("Admin info", "Your user profile was locked until " + SystemUtil.dateFormat.format(lockUntil) + "."); + user.showUserMessage("Admin info", "Your user profile was locked until " + SystemUtil.dateFormat.format(lockUntil) + '.'); user.setLockedUntil(lockUntil); if (user.isConnected()) { SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId()); diff --git a/Mage.Server/src/main/java/mage/server/MailgunClient.java b/Mage.Server/src/main/java/mage/server/MailgunClient.java index 45b3557aa6..cc012886db 100644 --- a/Mage.Server/src/main/java/mage/server/MailgunClient.java +++ b/Mage.Server/src/main/java/mage/server/MailgunClient.java @@ -23,7 +23,7 @@ public class MailgunClient { String domain = ConfigSettings.getInstance().getMailgunDomain(); WebResource webResource = client.resource("https://api.mailgun.net/v3/" + domain + "/messages"); MultivaluedMapImpl formData = new MultivaluedMapImpl(); - formData.add("from", "XMage "); + formData.add("from", "XMage '); formData.add("to", email); formData.add("subject", subject); formData.add("text", text); diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 1131b0fd15..1839fa3e44 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -130,7 +130,7 @@ public class Main { logger.info(" - Loading extension from " + f); extensions.add(ExtensionPackageLoader.loadExtension(f)); } catch (IOException e) { - logger.error("Could not load extension in " + f + "!", e); + logger.error("Could not load extension in " + f + '!', e); } } } @@ -141,7 +141,7 @@ public class Main { logger.info("Registering custom sets..."); for (ExtensionPackage pkg : extensions) { for (ExpansionSet set : pkg.getSets()) { - logger.info("- Loading " + set.getName() + " (" + set.getCode() + ")"); + logger.info("- Loading " + set.getName() + " (" + set.getCode() + ')'); Sets.getInstance().addSet(set); } PluginClassloaderRegistery.registerPluginClassloader(pkg.getClassLoader()); @@ -268,7 +268,7 @@ public class Main { StringBuilder sessionInfo = new StringBuilder(); Optional user = UserManager.getInstance().getUser(session.getUserId()); if (user.isPresent()) { - sessionInfo.append(user.get().getName()).append(" [").append(user.get().getGameInfo()).append("]"); + sessionInfo.append(user.get().getName()).append(" [").append(user.get().getGameInfo()).append(']'); } else { sessionInfo.append("[user missing] "); } diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index ab6f404de2..31f0a2fe49 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -102,7 +102,7 @@ public class Session { } AuthorizedUserRepository.instance.add(userName, password, email); String subject = "XMage Registration Completed"; - String text = "You are successfully registered as " + userName + "."; + String text = "You are successfully registered as " + userName + '.'; text += " Your initial, generated password is: " + password; boolean success; diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index 21d6f8aec6..b831426c2e 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -179,7 +179,7 @@ public class TableController { if (!Main.isTestMode() && !table.getValidator().validate(deck)) { StringBuilder sb = new StringBuilder("You (").append(name).append(") have an invalid deck for the selected ").append(table.getValidator().getName()).append(" Format. \n\n"); for (Map.Entry entry : table.getValidator().getInvalid().entrySet()) { - sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n"); + sb.append(entry.getKey()).append(": ").append(entry.getValue()).append('\n'); } sb.append("\n\nSelect a deck that is appropriate for the selected format and try again!"); user.showUserMessage("Join Table", sb.toString()); @@ -194,7 +194,7 @@ public class TableController { int quitRatio = table.getTournament().getOptions().getQuitRatio(); if (quitRatio < user.getTourneyQuitRatio()) { String message = new StringBuilder("Your quit ratio ").append(user.getTourneyQuitRatio()) - .append("% is higher than the table requirement ").append(quitRatio).append("%").toString(); + .append("% is higher than the table requirement ").append(quitRatio).append('%').toString(); user.showUserMessage("Join Table", message); return false; } @@ -278,7 +278,7 @@ public class TableController { if (!Main.isTestMode() && !table.getValidator().validate(deck)) { StringBuilder sb = new StringBuilder("You (").append(name).append(") have an invalid deck for the selected ").append(table.getValidator().getName()).append(" Format. \n\n"); for (Map.Entry entry : table.getValidator().getInvalid().entrySet()) { - sb.append(entry.getKey()).append(": ").append(entry.getValue()).append("\n"); + sb.append(entry.getKey()).append(": ").append(entry.getValue()).append('\n'); } sb.append("\n\nSelect a deck that is appropriate for the selected format and try again!"); user.showUserMessage("Join Table", sb.toString()); @@ -292,7 +292,7 @@ public class TableController { int quitRatio = table.getMatch().getOptions().getQuitRatio(); if (quitRatio < user.getMatchQuitRatio()) { String message = new StringBuilder("Your quit ratio ").append(user.getMatchQuitRatio()) - .append("% is higher than the table requirement ").append(quitRatio).append("%").toString(); + .append("% is higher than the table requirement ").append(quitRatio).append('%').toString(); user.showUserMessage("Join Table", message); return false; } @@ -317,7 +317,7 @@ public class TableController { user.showUserMessage("Join Table", message); return false; } - logger.debug("DECK validated: " + table.getValidator().getName() + " " + player.getName() + " " + deck.getName()); + logger.debug("DECK validated: " + table.getValidator().getName() + ' ' + player.getName() + ' ' + deck.getName()); if (!player.canJoinTable(table)) { user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString()); return false; @@ -505,7 +505,7 @@ public class TableController { if (table.isTournament()) { logger.debug("Quit tournament sub tables for userId: " + userId); TableManager.getInstance().userQuitTournamentSubTables(tournament.getId(), userId); - logger.debug("Quit tournament Id: " + table.getTournament().getId() + "(" + table.getTournament().getTournamentState() + ")"); + logger.debug("Quit tournament Id: " + table.getTournament().getId() + '(' + table.getTournament().getTournamentState() + ')'); TournamentManager.getInstance().quit(tournament.getId(), userId); } else { MatchPlayer matchPlayer = match.getPlayer(playerId); @@ -553,7 +553,7 @@ public class TableController { logger.info("Tourn. match started id:" + match.getId() + " tournId: " + table.getTournament().getId()); } else { UserManager.getInstance().getUser(userId).ifPresent(user -> { - logger.info("MATCH started [" + match.getName() + "] " + match.getId() + "(" + user.getName() + ")"); + logger.info("MATCH started [" + match.getName() + "] " + match.getId() + '(' + user.getName() + ')'); logger.debug("- " + match.getOptions().getGameType() + " - " + match.getOptions().getDeckType()); }); } @@ -613,7 +613,7 @@ public class TableController { // log about game started logger.info("GAME started " + (match.getGame() != null ? match.getGame().getId() : "no Game") + " [" + match.getName() + "] " + creator + " - " + opponent.toString()); - logger.debug("- matchId: " + match.getId() + " [" + match.getName() + "]"); + logger.debug("- matchId: " + match.getId() + " [" + match.getName() + ']'); if (match.getGame() != null) { logger.debug("- chatId: " + GameManager.getInstance().getChatId(match.getGame().getId())); } @@ -926,12 +926,12 @@ public class TableController { if (!(table.getState() == TableState.WAITING || table.getState() == TableState.STARTING || table.getState() == TableState.READY_TO_START)) { if (match == null) { logger.debug("- Match table with no match:"); - logger.debug("-- matchId:" + match.getId() + " [" + match.getName() + "]"); + logger.debug("-- matchId:" + match.getId() + " [" + match.getName() + ']'); // return false; } else if (match.isDoneSideboarding() && match.getGame() == null) { // no sideboarding and not active game -> match seems to hang (maybe the Draw bug) logger.debug("- Match with no active game and not in sideboard state:"); - logger.debug("-- matchId:" + match.getId() + " [" + match.getName() + "]"); + logger.debug("-- matchId:" + match.getId() + " [" + match.getName() + ']'); // return false; } } diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index 2d8ec48fd7..e7ff34a203 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -368,12 +368,12 @@ public class TableManager { logger.debug(user.getId() + " | " + formatter.format(user.getConnectionTime()) + " | " + sessionState - + " | " + user.getName() + " (" + user.getUserState().toString() + " - " + user.getPingInfo() + ")"); + + " | " + user.getName() + " (" + user.getUserState().toString() + " - " + user.getPingInfo() + ')'); } ArrayList chatSessions = ChatManager.getInstance().getChatSessions(); logger.debug("------- ChatSessions: " + chatSessions.size() + " ----------------------------------"); for (ChatSession chatSession : chatSessions) { - logger.debug(chatSession.getChatId() + " " + formatter.format(chatSession.getCreateTime()) + " " + chatSession.getInfo() + " " + chatSession.getClients().values().toString()); + logger.debug(chatSession.getChatId() + " " + formatter.format(chatSession.getCreateTime()) + ' ' + chatSession.getInfo() + ' ' + chatSession.getClients().values().toString()); } logger.debug("------- Games: " + GameManager.getInstance().getNumberActiveGames() + " --------------------------------------------"); logger.debug(" Active Game Worker: " + ThreadExecutor.getInstance().getActiveThreads(ThreadExecutor.getInstance().getGameExecutor())); diff --git a/Mage.Server/src/main/java/mage/server/User.java b/Mage.Server/src/main/java/mage/server/User.java index c4411ff94f..ec97db3753 100644 --- a/Mage.Server/src/main/java/mage/server/User.java +++ b/Mage.Server/src/main/java/mage/server/User.java @@ -224,7 +224,7 @@ public class User { int minutes = (int) secondsLeft / 60; int seconds = (int) secondsLeft % 60; - return new StringBuilder(sign).append(Integer.toString(minutes)).append(":").append(seconds > 9 ? seconds : "0" + Integer.toString(seconds)).toString(); + return new StringBuilder(sign).append(Integer.toString(minutes)).append(':').append(seconds > 9 ? seconds : '0' + Integer.toString(seconds)).toString(); } public long getSecondsDisconnected() { @@ -499,7 +499,7 @@ public class User { } if (!isConnected()) { - tournamentPlayer.setDisconnectInfo(" (discon. " + getDisconnectDuration() + ")"); + tournamentPlayer.setDisconnectInfo(" (discon. " + getDisconnectDuration() + ')'); } else { tournamentPlayer.setDisconnectInfo(""); } @@ -537,25 +537,25 @@ public class User { tablesToDelete.clear(); } if (waiting > 0) { - sb.append("Wait: ").append(waiting).append(" "); + sb.append("Wait: ").append(waiting).append(' '); } if (match > 0) { - sb.append("Match: ").append(match).append(" "); + sb.append("Match: ").append(match).append(' '); } if (sideboard > 0) { - sb.append("Sideb: ").append(sideboard).append(" "); + sb.append("Sideb: ").append(sideboard).append(' '); } if (draft > 0) { - sb.append("Draft: ").append(draft).append(" "); + sb.append("Draft: ").append(draft).append(' '); } if (construct > 0) { - sb.append("Const: ").append(construct).append(" "); + sb.append("Const: ").append(construct).append(' '); } if (tournament > 0) { - sb.append("Tourn: ").append(tournament).append(" "); + sb.append("Tourn: ").append(tournament).append(' '); } if (watchedGames.size() > 0) { - sb.append("Watch: ").append(watchedGames.size()).append(" "); + sb.append("Watch: ").append(watchedGames.size()).append(' '); } return sb.toString(); } @@ -576,7 +576,7 @@ public class User { if (isConnected()) { return pingInfo; } else { - return " (discon. " + getDisconnectDuration() + ")"; + return " (discon. " + getDisconnectDuration() + ')'; } } @@ -658,7 +658,7 @@ public class User { if (quit.size() > 0) { builder.append(" ("); joinStrings(builder, quit, " "); - builder.append(")"); + builder.append(')'); } return builder.toString(); } @@ -690,7 +690,7 @@ public class User { if (quit.size() > 0) { builder.append(" ("); joinStrings(builder, quit, " "); - builder.append(")"); + builder.append(')'); } return builder.toString(); } diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index 61a673d788..acd963a62d 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -133,7 +133,7 @@ public class UserManager { USER_EXECUTOR.execute( () -> { try { - LOGGER.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + "]"); + LOGGER.info("USER REMOVE - " + user.getName() + " (" + reason.toString() + ") userId: " + userId + " [" + user.getGameInfo() + ']'); user.remove(reason); LOGGER.debug("USER REMOVE END - " + user.getName()); } catch (Exception ex) { diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 854f40680e..710a6cd8b4 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -332,7 +332,7 @@ public class GameController implements GameCallback { joinType = "rejoined"; } user.get().addGame(playerId, gameSession); - logger.debug("Player " + player.getName() + " " + playerId + " has " + joinType + " gameId: " + game.getId()); + logger.debug("Player " + player.getName() + ' ' + playerId + " has " + joinType + " gameId: " + game.getId()); ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(playerId).getLogName() + " has " + joinType + " the game", MessageColor.ORANGE, true, MessageType.GAME, null); checkStart(); } @@ -613,7 +613,7 @@ public class GameController implements GameCallback { } else { // user can already see the cards UserManager.getInstance().getUser(userIdRequester).ifPresent(requester -> { - requester.showUserMessage("Request to show hand cards", "You can see already the hand cards of player " + grantingPlayer.getName() + "!"); + requester.showUserMessage("Request to show hand cards", "You can see already the hand cards of player " + grantingPlayer.getName() + '!'); }); } @@ -848,9 +848,9 @@ public class GameController implements GameCallback { StringBuilder sb = new StringBuilder(); sb.append(message).append(ex.toString()); sb.append("\nServer version: ").append(Main.getVersion().toString()); - sb.append("\n"); + sb.append('\n'); for (StackTraceElement e : ex.getStackTrace()) { - sb.append(e.toString()).append("\n"); + sb.append(e.toString()).append('\n'); } for (final Entry entry : gameSessions.entrySet()) { entry.getValue().gameError(sb.toString()); @@ -1004,9 +1004,9 @@ public class GameController implements GameCallback { if (player != null) { sb.append(player.getName()).append("(Left=").append(player.hasLeft() ? "Y" : "N").append(") "); } else { - sb.append("player missing: ").append(playerId).append(" "); + sb.append("player missing: ").append(playerId).append(' '); } } - return sb.append("]").toString(); + return sb.append(']').toString(); } } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java index b5ae735a81..bca997678d 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java @@ -424,7 +424,7 @@ public class TournamentController { TableController tableController = TableManager.getInstance().getController(tableId); if (tableController != null) { if (user.isPresent()) { - replacePlayerName = "Draftbot (" + user.get().getName() + ")"; + replacePlayerName = "Draftbot (" + user.get().getName() + ')'; } tableController.replaceDraftPlayer(leavingPlayer.getPlayer(), replacePlayerName, "Computer - draftbot", 5); if (user.isPresent()) { diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java index 4a09cc84fe..3a479da566 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java @@ -92,13 +92,13 @@ public class TournamentFactory { StringBuilder rv = new StringBuilder( "Random Draft using sets: "); for (Map.Entry entry: setInfo.entrySet()){ rv.append(entry.getKey()); - rv.append(";"); + rv.append(';'); } tournament.setBoosterInfo(rv.toString()); } else { StringBuilder sb = new StringBuilder(); for (Map.Entry entry:setInfo.entrySet()) { - sb.append(entry.getValue().toString()).append("x").append(entry.getKey()).append(" "); + sb.append(entry.getValue().toString()).append('x').append(entry.getKey()).append(' '); } tournament.setBoosterInfo(sb.toString()); } @@ -110,7 +110,7 @@ public class TournamentFactory { logger.fatal("TournamentFactory error ", ex); return null; } - logger.debug("Tournament created: " + tournamentType + " " + tournament.getId()); + logger.debug("Tournament created: " + tournamentType + ' ' + tournament.getId()); return tournament; } diff --git a/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java b/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java index 0a171959fe..60f3e56c95 100644 --- a/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java +++ b/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java @@ -119,7 +119,7 @@ class XMageThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); - thread.setName(prefix + " " + thread.getThreadGroup().getName() + "-" + thread.getId()); + thread.setName(prefix + ' ' + thread.getThreadGroup().getName() + '-' + thread.getId()); return thread; } diff --git a/Mage.Sets/src/mage/cards/a/AcademyResearchers.java b/Mage.Sets/src/mage/cards/a/AcademyResearchers.java index 274378afc3..9ba8e5afe0 100644 --- a/Mage.Sets/src/mage/cards/a/AcademyResearchers.java +++ b/Mage.Sets/src/mage/cards/a/AcademyResearchers.java @@ -105,7 +105,7 @@ class AcademyResearchersEffect extends OneShotEffect { game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers); auraInHand.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId()); if (academyResearchers.addAttachment(auraInHand.getId(), game)) { - game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + "."); + game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.'); return true; } } diff --git a/Mage.Sets/src/mage/cards/a/Addle.java b/Mage.Sets/src/mage/cards/a/Addle.java index 9f17a79c67..afd3f43a09 100644 --- a/Mage.Sets/src/mage/cards/a/Addle.java +++ b/Mage.Sets/src/mage/cards/a/Addle.java @@ -92,7 +92,7 @@ class AddleEffect extends OneShotEffect { controller.choose(outcome, choice, game); ObjectColor color = choice.getColor(); if(color != null) { - game.informPlayers(controller.getLogName() + " chooses " + color + "."); + game.informPlayers(controller.getLogName() + " chooses " + color + '.'); FilterCard filter = new FilterCard(); filter.add(new ColorPredicate(color)); Effect effect = new DiscardCardYouChooseTargetEffect(filter); diff --git a/Mage.Sets/src/mage/cards/a/AetherbornMarauder.java b/Mage.Sets/src/mage/cards/a/AetherbornMarauder.java index 1f32696376..0237247f08 100644 --- a/Mage.Sets/src/mage/cards/a/AetherbornMarauder.java +++ b/Mage.Sets/src/mage/cards/a/AetherbornMarauder.java @@ -105,7 +105,7 @@ class AetherbornMarauderEffect extends OneShotEffect { filter.add(new CounterPredicate(CounterType.P1P1)); boolean firstRun = true; while (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { - if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Move " + (firstRun ? "any" : "more") + " +1/+1 counters from other permanents you control to " + sourceObject.getLogName() + '?', source, game)) { firstRun = false; TargetControlledPermanent target = new TargetControlledPermanent(filter); target.setNotTarget(true); diff --git a/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java b/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java index 1c58bb68d6..9390e33105 100644 --- a/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java +++ b/Mage.Sets/src/mage/cards/a/AlhammarretHighArbiter.java @@ -121,7 +121,7 @@ class AlhammarretHighArbiterEffect extends OneShotEffect { controller.chooseTarget(Outcome.Benefit, revealedCards, target, source, game); Card card = game.getCard(target.getFirstTarget()); if (card != null) { - game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + "]"); + game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + ']'); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null) { sourcePermanent.addInfo("chosen card name", CardUtil.addToolTipMarkTags("Chosen card name: " + card.getName()), game); diff --git a/Mage.Sets/src/mage/cards/a/AssaultSuit.java b/Mage.Sets/src/mage/cards/a/AssaultSuit.java index 729729ffe8..d2c1c1c631 100644 --- a/Mage.Sets/src/mage/cards/a/AssaultSuit.java +++ b/Mage.Sets/src/mage/cards/a/AssaultSuit.java @@ -159,7 +159,7 @@ class AssaultSuitGainControlEffect extends OneShotEffect { if (equipment.getAttachedTo() != null) { Permanent equippedCreature = game.getPermanent(equipment.getAttachedTo()); if (equippedCreature != null && controller.chooseUse(outcome, - "Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + "?", source, game)) { + "Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + '?', source, game)) { equippedCreature.untap(game); ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, activePlayer.getId()); effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo())); diff --git a/Mage.Sets/src/mage/cards/a/AureliasFury.java b/Mage.Sets/src/mage/cards/a/AureliasFury.java index 1f2ecff390..29ee0ae014 100644 --- a/Mage.Sets/src/mage/cards/a/AureliasFury.java +++ b/Mage.Sets/src/mage/cards/a/AureliasFury.java @@ -169,7 +169,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")"; + return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage.Sets/src/mage/cards/a/AuriokSurvivors.java b/Mage.Sets/src/mage/cards/a/AuriokSurvivors.java index 34e25bf401..3a006b8c24 100644 --- a/Mage.Sets/src/mage/cards/a/AuriokSurvivors.java +++ b/Mage.Sets/src/mage/cards/a/AuriokSurvivors.java @@ -97,7 +97,7 @@ class AuriokSurvivorsEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player player = game.getPlayer(source.getControllerId()); if (p != null && player != null && sourcePermanent != null) { - if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + '?', source, game)) { sourcePermanent.addAttachment(p.getId(), game); } return true; diff --git a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java index 54ef0caba2..4ad8d32e28 100644 --- a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java +++ b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java @@ -118,7 +118,7 @@ class AurraSingBaneOfJediEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Deal 2 damage to " + game.getPermanent(getTargetPointer().getFirst(game, source)).getName() + '?', source, game)) { new DamageTargetEffect(2).apply(game, source); } else { new DamageControllerEffect(1).apply(game, source); diff --git a/Mage.Sets/src/mage/cards/b/BattletideAlchemist.java b/Mage.Sets/src/mage/cards/b/BattletideAlchemist.java index 4a34978a4f..2f72855579 100644 --- a/Mage.Sets/src/mage/cards/b/BattletideAlchemist.java +++ b/Mage.Sets/src/mage/cards/b/BattletideAlchemist.java @@ -96,7 +96,7 @@ class BattletideAlchemistEffect extends PreventionEffectImpl { if (controller != null) { int numberOfClericsControlled = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent("Cleric", "Clerics")).calculate(game, source, this); int toPrevent = Math.min(numberOfClericsControlled, event.getAmount()); - if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + "?", source, game)) { + if (toPrevent > 0 && controller.chooseUse(Outcome.PreventDamage, "Prevent " + toPrevent + " damage to " + targetPlayer.getName() + '?', source, game)) { GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, targetPlayer.getId(), source.getSourceId(), source.getControllerId(), toPrevent, false); if (!game.replaceEvent(preventEvent)) { if (event.getAmount() >= toPrevent) { diff --git a/Mage.Sets/src/mage/cards/b/BlindZealot.java b/Mage.Sets/src/mage/cards/b/BlindZealot.java index 7e47066d93..74d7892455 100644 --- a/Mage.Sets/src/mage/cards/b/BlindZealot.java +++ b/Mage.Sets/src/mage/cards/b/BlindZealot.java @@ -109,7 +109,7 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl { StringBuilder sb = new StringBuilder(); sb.append("Do you wish to sacrifice ").append(sourcePermanent.getIdName()); sb.append(" to destroy target creature controlled by "); - sb.append(game.getPlayer(event.getTargetId()).getLogName()).append("?"); + sb.append(game.getPlayer(event.getTargetId()).getLogName()).append('?'); if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), this, game)) { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new ControllerIdPredicate(event.getTargetId())); diff --git a/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java b/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java index 7351904528..ae0a9ac04a 100644 --- a/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java +++ b/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java @@ -154,7 +154,7 @@ class BorderlandExplorerEffect extends OneShotEffect { for (UUID cardId : cardsPlayer) { Cards cards = new CardsImpl(game.getCard(cardId)); Card card = game.getCard(cardId); - player.revealCards(card.getIdName() + " (" + player.getName() + ")", cards, game); + player.revealCards(card.getIdName() + " (" + player.getName() + ')', cards, game); player.moveCardToHandWithInfo(card, source.getSourceId(), game); player.shuffleLibrary(source, game); } diff --git a/Mage.Sets/src/mage/cards/b/BottledCloister.java b/Mage.Sets/src/mage/cards/b/BottledCloister.java index dc06c89dce..7b13322429 100644 --- a/Mage.Sets/src/mage/cards/b/BottledCloister.java +++ b/Mage.Sets/src/mage/cards/b/BottledCloister.java @@ -103,7 +103,7 @@ class BottledCloisterExileEffect extends OneShotEffect { card.moveToExile(exileId, sourcePermanent.getName(), source.getSourceId(), game); card.setFaceDown(true, game); } - game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") +")"); + game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " exiles his or her hand face down (" + numberOfCards + "card" + (numberOfCards > 1 ?"s":"") + ')'); } return true; } diff --git a/Mage.Sets/src/mage/cards/b/BrainGorgers.java b/Mage.Sets/src/mage/cards/b/BrainGorgers.java index 2707fdeac0..3edc103928 100644 --- a/Mage.Sets/src/mage/cards/b/BrainGorgers.java +++ b/Mage.Sets/src/mage/cards/b/BrainGorgers.java @@ -99,9 +99,9 @@ class BrainGorgersCounterSourceEffect extends OneShotEffect { cost.clearPaid(); Player player = game.getPlayer(playerId); if (cost.canPay(source, source.getSourceId(), player.getId(), game) - && player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + "?", source, game)) { + && player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { - game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + "."); + game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + '.'); Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/b/BrilliantUltimatum.java b/Mage.Sets/src/mage/cards/b/BrilliantUltimatum.java index bd1b7b99c9..6f892ed356 100644 --- a/Mage.Sets/src/mage/cards/b/BrilliantUltimatum.java +++ b/Mage.Sets/src/mage/cards/b/BrilliantUltimatum.java @@ -135,8 +135,8 @@ class BrilliantUltimatumEffect extends OneShotEffect { selectedPileCards = pileTwo; selectedPile = pile2; } - game.informPlayers(controller.getLogName() + " chose " + selectedPileName + "."); - while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + "?", source, game)) { + game.informPlayers(controller.getLogName() + " chose " + selectedPileName + '.'); + while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + '?', source, game)) { TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard()); if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) { Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game); diff --git a/Mage.Sets/src/mage/cards/c/Cannibalize.java b/Mage.Sets/src/mage/cards/c/Cannibalize.java index 8ec6596b60..d466822acb 100644 --- a/Mage.Sets/src/mage/cards/c/Cannibalize.java +++ b/Mage.Sets/src/mage/cards/c/Cannibalize.java @@ -95,7 +95,7 @@ class CannibalizeEffect extends OneShotEffect { for(UUID targetId: getTargetPointer().getTargets(game, source)) { Permanent creature = game.getPermanent(targetId); if (creature != null) { - if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() +"?", source, game)) + if ((count == 0 && controller.chooseUse(Outcome.Exile, "Exile " + creature.getLogName() + '?', source, game)) || (count == 1 && !exileDone)) { controller.moveCardToExileWithInfo(creature, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); exileDone = true; diff --git a/Mage.Sets/src/mage/cards/c/ChainLightning.java b/Mage.Sets/src/mage/cards/c/ChainLightning.java index dc2dcd0cab..bb06d3431b 100644 --- a/Mage.Sets/src/mage/cards/c/ChainLightning.java +++ b/Mage.Sets/src/mage/cards/c/ChainLightning.java @@ -106,7 +106,7 @@ class ChainLightningEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { spell.createCopyOnStack(game, source, affectedPlayer.getId(), true); - game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + "."); + game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.'); } } } diff --git a/Mage.Sets/src/mage/cards/c/ChainOfVapor.java b/Mage.Sets/src/mage/cards/c/ChainOfVapor.java index fbfb18babb..5efbb59dd3 100644 --- a/Mage.Sets/src/mage/cards/c/ChainOfVapor.java +++ b/Mage.Sets/src/mage/cards/c/ChainOfVapor.java @@ -96,7 +96,7 @@ class ChainOfVaporEffect extends OneShotEffect { if (permanent != null) { controller.moveCards(permanent, Zone.HAND, source, game); Player player = game.getPlayer(permanent.getControllerId()); - TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ")"), true); + TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ')'), true); if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) { Permanent land = game.getPermanent(target.getFirstTarget()); if (land != null && land.sacrifice(source.getSourceId(), game)) { @@ -109,7 +109,7 @@ class ChainOfVaporEffect extends OneShotEffect { if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); } - game.informPlayers(player.getLogName() + " " + activateMessage); + game.informPlayers(player.getLogName() + ' ' + activateMessage); } } } diff --git a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java index c08a79536b..3901ba4f8f 100644 --- a/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java +++ b/Mage.Sets/src/mage/cards/c/ChorusOfTheConclave.java @@ -151,7 +151,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { payed = true; } } - game.informPlayers(player.getLogName() + " pays {" + xValue + "}"); + game.informPlayers(player.getLogName() + " pays {" + xValue + '}'); return xValue; } diff --git a/Mage.Sets/src/mage/cards/c/ChromeMox.java b/Mage.Sets/src/mage/cards/c/ChromeMox.java index d0ccd0356b..a7c8406e39 100644 --- a/Mage.Sets/src/mage/cards/c/ChromeMox.java +++ b/Mage.Sets/src/mage/cards/c/ChromeMox.java @@ -114,7 +114,7 @@ class ChromeMoxEffect extends OneShotEffect { if (cardToImprint != null) { controller.moveCardsToExile(cardToImprint, source, game, true, source.getSourceId(), sourceObject.getIdName() + " (Imprint)"); sourcePermanent.imprint(cardToImprint.getId(), game); - sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + "]"), game); + sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + ']'), game); } else { sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - None]"), game); } diff --git a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java index 6930843c56..7a2bfb2fb3 100644 --- a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java +++ b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java @@ -127,7 +127,7 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility { public String getRule() { StringBuilder sb = new StringBuilder(super.getRule()); sb.deleteCharAt(sb.length() - 1); // remove last '.' - sb.append(" and only if ").append(condition.toString()).append("."); + sb.append(" and only if ").append(condition.toString()).append('.'); return sb.toString(); } } diff --git a/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java b/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java index d0cf351fc6..a956c84595 100644 --- a/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java +++ b/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java @@ -80,7 +80,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) { int domainValue = new DomainValue().calculate(game, source, this); if (domainValue > 0) { - return new ManaCostsImpl<>("{" + domainValue + "}"); + return new ManaCostsImpl<>("{" + domainValue + '}'); } return null; } diff --git a/Mage.Sets/src/mage/cards/c/ConfiscationCoup.java b/Mage.Sets/src/mage/cards/c/ConfiscationCoup.java index 4636fbfd09..35d8f7aa7a 100644 --- a/Mage.Sets/src/mage/cards/c/ConfiscationCoup.java +++ b/Mage.Sets/src/mage/cards/c/ConfiscationCoup.java @@ -108,7 +108,7 @@ class ConfiscationCoupEffect extends OneShotEffect { for (int i = 0; i < targetPermanent.getManaCost().convertedManaCost(); i++) { energy += "{E}"; } - if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { ContinuousEffect controllEffect = new GainControlTargetEffect(Duration.Custom); controllEffect.setTargetPointer(new FixedTarget(targetPermanent, game)); diff --git a/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java b/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java index d2f3b5856c..9ce9bb67b4 100644 --- a/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java +++ b/Mage.Sets/src/mage/cards/c/ConfusionInTheRanks.java @@ -106,7 +106,7 @@ public class ConfusionInTheRanks extends CardImpl { if (!message.isEmpty()) { message += "or "; } - message += cardTypeEntering.toString().toLowerCase() + " "; + message += cardTypeEntering.toString().toLowerCase() + ' '; } filterTarget.add(Predicates.or(cardTypesPredicates)); message += "you do not control"; diff --git a/Mage.Sets/src/mage/cards/c/ConundrumSphinx.java b/Mage.Sets/src/mage/cards/c/ConundrumSphinx.java index 85bada78c2..7defd8d789 100644 --- a/Mage.Sets/src/mage/cards/c/ConundrumSphinx.java +++ b/Mage.Sets/src/mage/cards/c/ConundrumSphinx.java @@ -100,7 +100,7 @@ class ConundrumSphinxEffect extends OneShotEffect { } } String cardName = cardChoice.getChoice(); - game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + "]"); + game.informPlayers("Conundrum Sphinx, player: " + player.getLogName() + ", named card: [" + cardName + ']'); Card card = player.getLibrary().removeFromTop(game); Cards cards = new CardsImpl(); cards.add(card); diff --git a/Mage.Sets/src/mage/cards/c/CosmicHorror.java b/Mage.Sets/src/mage/cards/c/CosmicHorror.java index 201165802f..464a0cabb4 100644 --- a/Mage.Sets/src/mage/cards/c/CosmicHorror.java +++ b/Mage.Sets/src/mage/cards/c/CosmicHorror.java @@ -93,7 +93,7 @@ class CosmicHorrorEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && cosmicHorror != null) { - StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + StringBuilder sb = new StringBuilder(cost.getText()).append('?'); if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { sb.insert(0, "Pay "); } diff --git a/Mage.Sets/src/mage/cards/c/CouncilGuardian.java b/Mage.Sets/src/mage/cards/c/CouncilGuardian.java index a2bf0f3aa1..cee931c9f5 100644 --- a/Mage.Sets/src/mage/cards/c/CouncilGuardian.java +++ b/Mage.Sets/src/mage/cards/c/CouncilGuardian.java @@ -118,7 +118,7 @@ class CouncilsGuardianEffect extends OneShotEffect { } chosenColors.put(color, 1); } - game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + "."); + game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + '.'); } } } diff --git a/Mage.Sets/src/mage/cards/c/CranialExtraction.java b/Mage.Sets/src/mage/cards/c/CranialExtraction.java index 5a03316013..8d871d7e39 100644 --- a/Mage.Sets/src/mage/cards/c/CranialExtraction.java +++ b/Mage.Sets/src/mage/cards/c/CranialExtraction.java @@ -98,7 +98,7 @@ class CranialExtractionEffect extends SearchTargetGraveyardHandLibraryForCardNam String cardName = cardChoice.getChoice(); MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject != null) { - game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]"); + game.informPlayers(sourceObject.getName() + " named card: [" + cardName + ']'); } super.applySearchAndExile(game, source, cardName, player.getId()); } diff --git a/Mage.Sets/src/mage/cards/d/DashHopes.java b/Mage.Sets/src/mage/cards/d/DashHopes.java index a55550a166..aa197c6381 100644 --- a/Mage.Sets/src/mage/cards/d/DashHopes.java +++ b/Mage.Sets/src/mage/cards/d/DashHopes.java @@ -95,9 +95,9 @@ class DashHopesCounterSourceEffect extends OneShotEffect { Player player = game.getPlayer(playerId); cost.clearPaid(); if (cost.canPay(source, source.getSourceId(), player.getId(), game) - && player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + "?", source, game)) { + && player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { - game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + "."); + game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + '.'); Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/d/DecayingSoil.java b/Mage.Sets/src/mage/cards/d/DecayingSoil.java index e06cb61391..530a6910c0 100644 --- a/Mage.Sets/src/mage/cards/d/DecayingSoil.java +++ b/Mage.Sets/src/mage/cards/d/DecayingSoil.java @@ -172,7 +172,7 @@ class DecayingSoilEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { UUID target = this.getTargetPointer().getFirst(game, source); diff --git a/Mage.Sets/src/mage/cards/d/DeepfireElemental.java b/Mage.Sets/src/mage/cards/d/DeepfireElemental.java index 4c76862c89..fa3b71d630 100644 --- a/Mage.Sets/src/mage/cards/d/DeepfireElemental.java +++ b/Mage.Sets/src/mage/cards/d/DeepfireElemental.java @@ -79,7 +79,7 @@ public class DeepfireElemental extends CardImpl { if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterPermanent newFilter = filter.copy(); - newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString()); + newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append('}').toString()); newFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, ability.getManaCostsToPay().getX())); Target target = new TargetPermanent(newFilter); ability.addTarget(target); diff --git a/Mage.Sets/src/mage/cards/d/DemonicHordes.java b/Mage.Sets/src/mage/cards/d/DemonicHordes.java index d5212f9e02..1019b6d746 100644 --- a/Mage.Sets/src/mage/cards/d/DemonicHordes.java +++ b/Mage.Sets/src/mage/cards/d/DemonicHordes.java @@ -104,7 +104,7 @@ class DemonicHordesEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent demonicHordes = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && demonicHordes != null) { - StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + StringBuilder sb = new StringBuilder(cost.getText()).append('?'); if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { sb.insert(0, "Pay "); } diff --git a/Mage.Sets/src/mage/cards/d/DieYoung.java b/Mage.Sets/src/mage/cards/d/DieYoung.java index e9cb79068f..8b5c4037ab 100644 --- a/Mage.Sets/src/mage/cards/d/DieYoung.java +++ b/Mage.Sets/src/mage/cards/d/DieYoung.java @@ -93,7 +93,7 @@ class DieYoungEffect extends OneShotEffect { if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); int max = controller.getCounters().getCount(CounterType.ENERGY); - int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ")", game); + int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ')', game); if (numberToPayed > 0) { Cost cost = new PayEnergyCost(numberToPayed); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { diff --git a/Mage.Sets/src/mage/cards/d/DiluvianPrimordial.java b/Mage.Sets/src/mage/cards/d/DiluvianPrimordial.java index 5844aeb3ee..cb84ea95cd 100644 --- a/Mage.Sets/src/mage/cards/d/DiluvianPrimordial.java +++ b/Mage.Sets/src/mage/cards/d/DiluvianPrimordial.java @@ -126,7 +126,7 @@ class DiluvianPrimordialEffect extends OneShotEffect { if (target instanceof TargetCardInOpponentsGraveyard) { Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + '?', source, game)) { if (controller.cast(targetCard.getSpellAbility(), game, true)) { ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId()))); diff --git a/Mage.Sets/src/mage/cards/d/Duplicant.java b/Mage.Sets/src/mage/cards/d/Duplicant.java index f0dd4a0346..2132a893d4 100644 --- a/Mage.Sets/src/mage/cards/d/Duplicant.java +++ b/Mage.Sets/src/mage/cards/d/Duplicant.java @@ -108,7 +108,7 @@ class ExileTargetEffect extends OneShotEffect { if (permanent != null) { if(sourcePermananent != null){ sourcePermananent.imprint(permanent.getId(), game); - sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append("]").toString(), game); + sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game); } return permanent.moveToExile(null, null, source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/d/DustOfMoments.java b/Mage.Sets/src/mage/cards/d/DustOfMoments.java index 658d0dc24b..529125a9d1 100644 --- a/Mage.Sets/src/mage/cards/d/DustOfMoments.java +++ b/Mage.Sets/src/mage/cards/d/DustOfMoments.java @@ -144,8 +144,8 @@ public class DustOfMoments extends CardImpl { } if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ") - .append(controller.getLogName()).append(getActionStr()).append("s") - .append(counter.getCount()).append(" ").append(counterName.toLowerCase()) + .append(controller.getLogName()).append(getActionStr()).append('s') + .append(counter.getCount()).append(' ').append(counterName.toLowerCase()) .append(" counter on ").append(card.getName()).toString()); } } @@ -170,7 +170,7 @@ public class DustOfMoments extends CardImpl { if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ") .append(controller.getLogName()).append(getActionStr()).append("s ") - .append(counter.getCount()).append(" ").append(counterName.toLowerCase()) + .append(counter.getCount()).append(' ').append(counterName.toLowerCase()) .append(" counter on ").append(card.getName()).toString()); } } @@ -185,7 +185,7 @@ public class DustOfMoments extends CardImpl { StringBuilder sb = new StringBuilder(); sb.append(getActionStr()); if (counter.getCount() > 1) { - sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName().toLowerCase()).append(" counters on each "); + sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase()).append(" counters on each "); } else { sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each "); } diff --git a/Mage.Sets/src/mage/cards/e/EliteArcanist.java b/Mage.Sets/src/mage/cards/e/EliteArcanist.java index 7098eb85dc..f4fa74b99b 100644 --- a/Mage.Sets/src/mage/cards/e/EliteArcanist.java +++ b/Mage.Sets/src/mage/cards/e/EliteArcanist.java @@ -128,7 +128,7 @@ class EliteArcanistImprintEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); - permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append("]").toString(), game); + permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append(']').toString(), game); } return true; } diff --git a/Mage.Sets/src/mage/cards/e/EpiphanyAtTheDrownyard.java b/Mage.Sets/src/mage/cards/e/EpiphanyAtTheDrownyard.java index 8548373f18..0bf68ea784 100644 --- a/Mage.Sets/src/mage/cards/e/EpiphanyAtTheDrownyard.java +++ b/Mage.Sets/src/mage/cards/e/EpiphanyAtTheDrownyard.java @@ -160,13 +160,13 @@ class EpiphanyAtTheDrownyardEffect extends OneShotEffect { } game.informPlayers(sb.toString()); - sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(":"); + sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':'); i = 0; for (UUID cardUuid : pile2CardsIds) { Card card = game.getCard(cardUuid); if (card != null) { i++; - sb.append(" ").append(GameLog.getColoredObjectName(card)); + sb.append(' ').append(GameLog.getColoredObjectName(card)); if (i < pile2CardsIds.size()) { sb.append(", "); } diff --git a/Mage.Sets/src/mage/cards/e/Expropriate.java b/Mage.Sets/src/mage/cards/e/Expropriate.java index 7c17bd8d09..db60697b19 100644 --- a/Mage.Sets/src/mage/cards/e/Expropriate.java +++ b/Mage.Sets/src/mage/cards/e/Expropriate.java @@ -156,7 +156,7 @@ class ExpropriateDilemmaEffect extends CouncilsDilemmaVoteEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + "?", source, game)) { + if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + '?', source, game)) { voteOneCount++; game.informPlayers(player.getName() + " has voted for " + choiceOne); } else { diff --git a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java index 8ee5606259..962a277092 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java +++ b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java @@ -103,7 +103,7 @@ class ExtraplanarLensImprintEffect extends OneShotEffect { if (targetLand != null) { targetLand.moveToExile(null, extraplanarLens.getName() + " (Imprint)", source.getSourceId(), game); extraplanarLens.imprint(targetLand.getId(), game); - extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + "]"), game); + extraplanarLens.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + targetLand.getLogName() + ']'), game); } } return true; diff --git a/Mage.Sets/src/mage/cards/f/FactOrFiction.java b/Mage.Sets/src/mage/cards/f/FactOrFiction.java index 6a93b12673..1bc2dc39e8 100644 --- a/Mage.Sets/src/mage/cards/f/FactOrFiction.java +++ b/Mage.Sets/src/mage/cards/f/FactOrFiction.java @@ -137,11 +137,11 @@ class FactOrFictionEffect extends OneShotEffect { } game.informPlayers(sb.toString()); - sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":"); + sb = new StringBuilder("Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':'); i = 0; for (Card card: pile2) { i++; - sb.append(" ").append(card.getName()); + sb.append(' ').append(card.getName()); if (i < pile2.size()) { sb.append(", "); } diff --git a/Mage.Sets/src/mage/cards/f/FaerieArtisans.java b/Mage.Sets/src/mage/cards/f/FaerieArtisans.java index fb99035e3e..80a433d0fb 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieArtisans.java +++ b/Mage.Sets/src/mage/cards/f/FaerieArtisans.java @@ -121,7 +121,7 @@ class FaerieArtisansEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); for (Permanent permanent : effect.getAddedPermanent()) { if (sb.length() > 0) { - sb.append(";"); + sb.append(';'); } sb.append(permanent.getId()); } diff --git a/Mage.Sets/src/mage/cards/f/Fatespinner.java b/Mage.Sets/src/mage/cards/f/Fatespinner.java index 7ed714bf29..6078d1eb96 100644 --- a/Mage.Sets/src/mage/cards/f/Fatespinner.java +++ b/Mage.Sets/src/mage/cards/f/Fatespinner.java @@ -113,7 +113,7 @@ class FatespinnerChooseEffect extends OneShotEffect { } } String chosenPhase = choice.getChoice(); - game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + "."); + game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + '.'); game.addEffect(new FatespinnerSkipEffect(chosenPhase), source); return true; } diff --git a/Mage.Sets/src/mage/cards/f/FellShepherd.java b/Mage.Sets/src/mage/cards/f/FellShepherd.java index bb01cc12f7..c4db208110 100644 --- a/Mage.Sets/src/mage/cards/f/FellShepherd.java +++ b/Mage.Sets/src/mage/cards/f/FellShepherd.java @@ -162,7 +162,7 @@ class FellShepherdEffect extends OneShotEffect { Card card = game.getCard(creatureId); if (card != null) { card.moveToZone(Zone.HAND, source.getSourceId(), game, false); - sb.append(" ").append(card.getName()); + sb.append(' ').append(card.getName()); } } } diff --git a/Mage.Sets/src/mage/cards/f/Flash.java b/Mage.Sets/src/mage/cards/f/Flash.java index c52032bb75..0cf62455aa 100644 --- a/Mage.Sets/src/mage/cards/f/Flash.java +++ b/Mage.Sets/src/mage/cards/f/Flash.java @@ -101,7 +101,7 @@ class FlashEffect extends OneShotEffect { card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); ManaCosts reducedCost = CardUtil.removeVariableManaCost(CardUtil.reduceCost(card.getManaCost(), 2)); - StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append("?"); + StringBuilder sb = new StringBuilder("Pay ").append(reducedCost.getText()).append('?'); if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) { reducedCost.clearPaid(); if (reducedCost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { diff --git a/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java b/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java index c830de50e3..69507915ee 100644 --- a/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java +++ b/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java @@ -124,14 +124,16 @@ class FlowstoneSculptureEffect extends OneShotEffect { } else { Ability gainedAbility; - if(chosen.equals("Flying")) { - gainedAbility = FlyingAbility.getInstance(); - } - else if(chosen.equals("First strike")) { - gainedAbility = FirstStrikeAbility.getInstance(); - } - else { - gainedAbility = TrampleAbility.getInstance(); + switch (chosen) { + case "Flying": + gainedAbility = FlyingAbility.getInstance(); + break; + case "First strike": + gainedAbility = FirstStrikeAbility.getInstance(); + break; + default: + gainedAbility = TrampleAbility.getInstance(); + break; } game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), source); return true; diff --git a/Mage.Sets/src/mage/cards/f/ForgottenAncient.java b/Mage.Sets/src/mage/cards/f/ForgottenAncient.java index d13001fa77..7513d62d57 100644 --- a/Mage.Sets/src/mage/cards/f/ForgottenAncient.java +++ b/Mage.Sets/src/mage/cards/f/ForgottenAncient.java @@ -124,7 +124,7 @@ public class ForgottenAncient extends CardImpl { continue; } - int amountToMove = controller.getAmount(0, numCounters, "How many counters do you want to move? " + "(" + numCounters + ")" + " counters remaining.", game); + int amountToMove = controller.getAmount(0, numCounters, "How many counters do you want to move? " + '(' + numCounters + ')' + " counters remaining.", game); if(amountToMove > 0) { boolean previouslyChosen = false; diff --git a/Mage.Sets/src/mage/cards/g/GoblinDarkDwellers.java b/Mage.Sets/src/mage/cards/g/GoblinDarkDwellers.java index 7a5e27bc3a..bd4243485f 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinDarkDwellers.java +++ b/Mage.Sets/src/mage/cards/g/GoblinDarkDwellers.java @@ -113,7 +113,7 @@ class GoblinDarkDwellersEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); if (card != null) { - if (controller.chooseUse(outcome, "Cast " + card.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Cast " + card.getLogName() + '?', source, game)) { if (controller.cast(card.getSpellAbility(), game, true)) { ContinuousEffect effect = new GoblinDarkDwellersReplacementEffect(card.getId()); effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId()))); diff --git a/Mage.Sets/src/mage/cards/g/Godsend.java b/Mage.Sets/src/mage/cards/g/Godsend.java index 42acb71b40..f0743615e1 100644 --- a/Mage.Sets/src/mage/cards/g/Godsend.java +++ b/Mage.Sets/src/mage/cards/g/Godsend.java @@ -191,7 +191,7 @@ class GodsendExileEffect extends OneShotEffect { if (creature != null && controller != null && sourcePermanent != null) { UUID exileId = CardUtil.getCardExileZoneId(game, source); controller.moveCardToExileWithInfo(creature, exileId, - sourcePermanent.getIdName() + " (" + sourcePermanent.getZoneChangeCounter(game) + ")", source.getSourceId(), game, Zone.BATTLEFIELD, true); + sourcePermanent.getIdName() + " (" + sourcePermanent.getZoneChangeCounter(game) + ')', source.getSourceId(), game, Zone.BATTLEFIELD, true); } return false; @@ -218,7 +218,7 @@ class GodsendRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast this spell because a card with the same name is exiled by " + mageObject.getLogName() + "."; + return "You can't cast this spell because a card with the same name is exiled by " + mageObject.getLogName() + '.'; } return null; } diff --git a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java index 1201a553fb..3eb9c5964b 100644 --- a/Mage.Sets/src/mage/cards/g/GrandAbolisher.java +++ b/Mage.Sets/src/mage/cards/g/GrandAbolisher.java @@ -98,7 +98,7 @@ class GrandAbolisherEffect extends ContinuousRuleModifyingEffectImpl { MageObject mageObject = game.getObject(source.getSourceId()); if (activePlayer != null && mageObject != null) { return "You can't cast spells or activate abilities of artifacts, creatures, or enchantments during the turns of " + activePlayer.getLogName() + - " (" + mageObject.getLogName() + ")"; + " (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage.Sets/src/mage/cards/h/Heartmender.java b/Mage.Sets/src/mage/cards/h/Heartmender.java index 5211a7a058..05b9db5c38 100644 --- a/Mage.Sets/src/mage/cards/h/Heartmender.java +++ b/Mage.Sets/src/mage/cards/h/Heartmender.java @@ -100,7 +100,7 @@ class HeartmenderEffect extends OneShotEffect { if (creature != null && creature.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { creature.removeCounters(counter.getName(), counter.getCount(), game); - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) + game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(' ').append(counter.getName()) .append(" counter from ").append(creature.getName()).toString()); applied = true; } diff --git a/Mage.Sets/src/mage/cards/h/HellkiteCharger.java b/Mage.Sets/src/mage/cards/h/HellkiteCharger.java index 5151be6ed3..40e0435a31 100644 --- a/Mage.Sets/src/mage/cards/h/HellkiteCharger.java +++ b/Mage.Sets/src/mage/cards/h/HellkiteCharger.java @@ -96,7 +96,7 @@ class HellkiteChargerEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { ManaCosts cost = new ManaCostsImpl("{5}{R}{R}"); - if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { new UntapAllControllerEffect(new FilterAttackingCreature(),"").apply(game, source); diff --git a/Mage.Sets/src/mage/cards/h/HiddenStrings.java b/Mage.Sets/src/mage/cards/h/HiddenStrings.java index a29f12c38e..52b47eb6b7 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenStrings.java +++ b/Mage.Sets/src/mage/cards/h/HiddenStrings.java @@ -98,11 +98,11 @@ class HiddenStringsEffect extends OneShotEffect { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { if (permanent.isTapped()) { - if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), source, game)) { + if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append('?').toString(), source, game)) { permanent.untap(game); } } else { - if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), source, game)) { + if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append('?').toString(), source, game)) { permanent.tap(game); } } diff --git a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java index 411652317c..a34d13da76 100644 --- a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java +++ b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java @@ -132,7 +132,7 @@ class HopeOfGhirapurCantCastEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ")"; + return "You can't cast noncreature spells this turn (you were dealt damage by " + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage.Sets/src/mage/cards/i/InfiniteObliteration.java b/Mage.Sets/src/mage/cards/i/InfiniteObliteration.java index 2d91175784..ecd3f9cce6 100644 --- a/Mage.Sets/src/mage/cards/i/InfiniteObliteration.java +++ b/Mage.Sets/src/mage/cards/i/InfiniteObliteration.java @@ -97,7 +97,7 @@ class InfiniteObliterationEffect extends SearchTargetGraveyardHandLibraryForCard cardName = cardChoice.getChoice(); MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject != null) { - game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]"); + game.informPlayers(sourceObject.getName() + " named card: [" + cardName + ']'); } super.applySearchAndExile(game, source, cardName, player.getId()); diff --git a/Mage.Sets/src/mage/cards/i/IntetTheDreamer.java b/Mage.Sets/src/mage/cards/i/IntetTheDreamer.java index b6185063b0..f58b9d92ca 100644 --- a/Mage.Sets/src/mage/cards/i/IntetTheDreamer.java +++ b/Mage.Sets/src/mage/cards/i/IntetTheDreamer.java @@ -162,7 +162,7 @@ class IntetTheDreamerCastEffect extends AsThoughEffectImpl { if (zone != null && zone.contains(card.getId())/* && CardUtil.cardCanBePlayedNow(card, controller.getId(), game)*/) { if (card.getCardType().contains(CardType.LAND)) { if (game.canPlaySorcery(controller.getId()) && game.getPlayer(controller.getId()).canPlayLand()) { - return controller.chooseUse(outcome, "Play " + card.getIdName() + "?", source, game); + return controller.chooseUse(outcome, "Play " + card.getIdName() + '?', source, game); } } else { controller.setCastSourceIdWithAlternateMana(objectId, null, null); diff --git a/Mage.Sets/src/mage/cards/i/IsochronScepter.java b/Mage.Sets/src/mage/cards/i/IsochronScepter.java index b23de5bf68..96407d8af2 100644 --- a/Mage.Sets/src/mage/cards/i/IsochronScepter.java +++ b/Mage.Sets/src/mage/cards/i/IsochronScepter.java @@ -113,7 +113,7 @@ class IsochronScepterImprintEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); - permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game); + permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game); } } } @@ -155,7 +155,7 @@ class IsochronScepterCopyEffect extends OneShotEffect { if (scepter != null && scepter.getImprinted() != null && !scepter.getImprinted().isEmpty()) { Card imprintedInstant = game.getCard(scepter.getImprinted().get(0)); if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) { - if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) { + if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) { Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId()); if (copiedCard != null) { game.getExile().add(source.getSourceId(), "", copiedCard); diff --git a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java index f6c11df488..c589670c0b 100644 --- a/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/cards/j/JaceArchitectOfThought.java @@ -264,7 +264,7 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect { private void postPileToLog(String pileName, Set cards, Game game) { StringBuilder message = new StringBuilder(pileName).append(": "); for (Card card : cards) { - message.append(card.getName()).append(" "); + message.append(card.getName()).append(' '); } if (cards.isEmpty()) { message.append(" (empty)"); diff --git a/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java b/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java index 30fd18f176..9ff74ced51 100644 --- a/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java +++ b/Mage.Sets/src/mage/cards/k/KalitasBloodchiefOfGhet.java @@ -103,7 +103,7 @@ class KalitasDestroyEffect extends OneShotEffect { class VampireToken extends Token { public VampireToken(int tokenPower, int tokenToughness) { - super("Vampire", new StringBuilder(tokenPower).append("/").append(tokenToughness).append(" black Vampire creature token").toString()); + super("Vampire", new StringBuilder(tokenPower).append('/').append(tokenToughness).append(" black Vampire creature token").toString()); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Vampire"); diff --git a/Mage.Sets/src/mage/cards/k/KnowledgePool.java b/Mage.Sets/src/mage/cards/k/KnowledgePool.java index 0fb3745420..1a83a89bb8 100644 --- a/Mage.Sets/src/mage/cards/k/KnowledgePool.java +++ b/Mage.Sets/src/mage/cards/k/KnowledgePool.java @@ -101,7 +101,7 @@ class KnowledgePoolEffect1 extends OneShotEffect { if (player != null) { player.moveCardsToExile(player.getLibrary().getTopCards(game, 3), source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), - sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ")"); + sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ')'); } } return true; diff --git a/Mage.Sets/src/mage/cards/l/LunarAvenger.java b/Mage.Sets/src/mage/cards/l/LunarAvenger.java index de4a09a51f..232b503747 100644 --- a/Mage.Sets/src/mage/cards/l/LunarAvenger.java +++ b/Mage.Sets/src/mage/cards/l/LunarAvenger.java @@ -119,12 +119,16 @@ class LunarAvengerEffect extends OneShotEffect { Ability gainedAbility; String chosen = choice.getChoice(); - if (chosen.equals("Flying")) { - gainedAbility = FlyingAbility.getInstance(); - } else if (chosen.equals("First strike")) { - gainedAbility = FirstStrikeAbility.getInstance(); - } else { - gainedAbility = HasteAbility.getInstance(); + switch (chosen) { + case "Flying": + gainedAbility = FlyingAbility.getInstance(); + break; + case "First strike": + gainedAbility = FirstStrikeAbility.getInstance(); + break; + default: + gainedAbility = HasteAbility.getInstance(); + break; } game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source); diff --git a/Mage.Sets/src/mage/cards/m/Magmasaur.java b/Mage.Sets/src/mage/cards/m/Magmasaur.java index a6e8c573f6..82fe68b611 100644 --- a/Mage.Sets/src/mage/cards/m/Magmasaur.java +++ b/Mage.Sets/src/mage/cards/m/Magmasaur.java @@ -108,7 +108,7 @@ class MagmasaurEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game); if (sourceObject != null && controller != null) { - if (controller.chooseUse(outcome, "Remove a +1/+1 counter from " + sourceObject.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Remove a +1/+1 counter from " + sourceObject.getLogName() + '?', source, game)) { sourceObject.removeCounters(CounterType.P1P1.getName(), 1, game); } else { int counters = sourceObject.getCounters(game).getCount(CounterType.P1P1); diff --git a/Mage.Sets/src/mage/cards/m/ManaVortex.java b/Mage.Sets/src/mage/cards/m/ManaVortex.java index f46e2b3237..9ca657b5ad 100644 --- a/Mage.Sets/src/mage/cards/m/ManaVortex.java +++ b/Mage.Sets/src/mage/cards/m/ManaVortex.java @@ -110,10 +110,10 @@ class CounterSourceEffect extends OneShotEffect { } if(spell != null){ Player controller = game.getPlayer(source.getControllerId()); - if(controller.chooseUse(Outcome.Detriment, "Sacrifice a land to not counter " + spell.getName() + "?", source, game)){ + if(controller.chooseUse(Outcome.Detriment, "Sacrifice a land to not counter " + spell.getName() + '?', source, game)){ SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent())); if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)){ - game.informPlayers(controller.getLogName() + " sacrifices a land to not counter " + spell.getName() + "."); + game.informPlayers(controller.getLogName() + " sacrifices a land to not counter " + spell.getName() + '.'); return true; } else { diff --git a/Mage.Sets/src/mage/cards/m/Mindblaze.java b/Mage.Sets/src/mage/cards/m/Mindblaze.java index 4917ffdac8..6bb549849b 100644 --- a/Mage.Sets/src/mage/cards/m/Mindblaze.java +++ b/Mage.Sets/src/mage/cards/m/Mindblaze.java @@ -113,8 +113,8 @@ class MindblazeEffect extends OneShotEffect { } } - game.informPlayers("Mindblaze, named card: [" + cardChoice.getChoice() + "]"); - game.informPlayers("Mindblaze, chosen number: [" + numberChoice.getChoice() + "]"); + game.informPlayers("Mindblaze, named card: [" + cardChoice.getChoice() + ']'); + game.informPlayers("Mindblaze, chosen number: [" + numberChoice.getChoice() + ']'); Cards cards = new CardsImpl(); cards.addAll(player.getLibrary().getCards(game)); diff --git a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java index 67cf0f96a7..175418106f 100644 --- a/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java +++ b/Mage.Sets/src/mage/cards/m/MogisGodOfSlaughter.java @@ -124,7 +124,7 @@ class DoUnlessTargetPaysCost extends OneShotEffect { if (player != null && mageObject != null) { String message = userMessage; if (message == null) { - message = getCostText() + " to prevent " + executingEffect.getText(source.getModes().getMode()) + "?"; + message = getCostText() + " to prevent " + executingEffect.getText(source.getModes().getMode()) + '?'; } message = CardUtil.replaceSourceName(message, mageObject.getLogName()); cost.clearPaid(); diff --git a/Mage.Sets/src/mage/cards/m/MysticRemora.java b/Mage.Sets/src/mage/cards/m/MysticRemora.java index b69bda270e..62c0dd8dc4 100644 --- a/Mage.Sets/src/mage/cards/m/MysticRemora.java +++ b/Mage.Sets/src/mage/cards/m/MysticRemora.java @@ -145,7 +145,7 @@ class MysticRemoraTriggeredAbility extends TriggeredAbilityImpl { Cost cost = new GenericManaCost(4); String message = "Would you like to pay {4} to prevent the opponent to draw a card?"; if (!(opponent.chooseUse(Outcome.Benefit, message, source, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false, null))) { - if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", source, game)) { + if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) { controller.drawCards(1, game); } } diff --git a/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java b/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java index 5ab434ecab..289300c2c2 100644 --- a/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java +++ b/Mage.Sets/src/mage/cards/n/NahiriTheLithomancer.java @@ -134,7 +134,7 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect { //TODO: Make sure the Equipment can legally enchant the token, preferably on targetting. Target target = new TargetControlledPermanent(0, 1, filter, true); if (target.canChoose(source.getSourceId(), controller.getId(), game) - && controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + "?", source, game)) { + && controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + '?', source, game)) { if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) { Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget()); if (equipmentPermanent != null) { diff --git a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java index 2565deb3f8..a4480cfdbb 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/cards/n/NarsetTranscendent.java @@ -257,7 +257,7 @@ class NarsetTranscendentCantCastEffect extends ContinuousRuleModifyingEffectImpl public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast can't cast noncreature spells (it is prevented by emblem of " + mageObject.getLogName() + ")"; + return "You can't cast can't cast noncreature spells (it is prevented by emblem of " + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage.Sets/src/mage/cards/n/NayaSoulbeast.java b/Mage.Sets/src/mage/cards/n/NayaSoulbeast.java index e00bef79a6..e7e24c4f24 100644 --- a/Mage.Sets/src/mage/cards/n/NayaSoulbeast.java +++ b/Mage.Sets/src/mage/cards/n/NayaSoulbeast.java @@ -110,7 +110,7 @@ class NayaSoulbeastCastEffect extends OneShotEffect { if (player.getLibrary().size() > 0) { Card card = player.getLibrary().getFromTop(game); cmc += card.getConvertedManaCost(); - player.revealCards(sourceObject.getName() + " (" + player.getName() + ")", new CardsImpl(card), game); + player.revealCards(sourceObject.getName() + " (" + player.getName() + ')', new CardsImpl(card), game); } } } diff --git a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java index 1049bba9b9..8b53dab95e 100644 --- a/Mage.Sets/src/mage/cards/n/NimDeathmantle.java +++ b/Mage.Sets/src/mage/cards/n/NimDeathmantle.java @@ -151,7 +151,7 @@ class NimDeathmantleEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent equipment = game.getPermanent(source.getSourceId()); if (controller != null && equipment != null) { - if (controller.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", source, game)) { + if (controller.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { UUID target = targetPointer.getFirst(game, source); diff --git a/Mage.Sets/src/mage/cards/p/PardicDragon.java b/Mage.Sets/src/mage/cards/p/PardicDragon.java index d80d164648..066c516b47 100644 --- a/Mage.Sets/src/mage/cards/p/PardicDragon.java +++ b/Mage.Sets/src/mage/cards/p/PardicDragon.java @@ -113,7 +113,7 @@ class PardicDragonEffect extends OneShotEffect { Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source)); Card sourceCard = game.getCard(source.getSourceId()); if (opponent != null && sourceCard != null) { - if (opponent.chooseUse(outcome, new StringBuilder("Put a time counter on ").append(sourceCard.getName()).append("?").toString(), source, game)) { + if (opponent.chooseUse(outcome, new StringBuilder("Put a time counter on ").append(sourceCard.getName()).append('?').toString(), source, game)) { sourceCard.addCounters(CounterType.TIME.createInstance(), source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/p/Phantasmagorian.java b/Mage.Sets/src/mage/cards/p/Phantasmagorian.java index 0640ffcbd9..e58c48dfc6 100644 --- a/Mage.Sets/src/mage/cards/p/Phantasmagorian.java +++ b/Mage.Sets/src/mage/cards/p/Phantasmagorian.java @@ -101,9 +101,9 @@ class CounterSourceEffect extends OneShotEffect { Player player = game.getPlayer(playerId); cost.clearPaid(); if (cost.canPay(source, source.getSourceId(), player.getId(), game) - && player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + "?", source, game)) { + && player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), playerId, false, null)) { - game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + "."); + game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + '.'); Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianMarauder.java b/Mage.Sets/src/mage/cards/p/PhyrexianMarauder.java index eda4cad154..68bf40ed5b 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianMarauder.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianMarauder.java @@ -100,7 +100,7 @@ class PhyrexianMarauderCantAttackUnlessYouPayEffect extends CantAttackBlockUnles if (sourceObject != null) { int counter = sourceObject.getCounters(game).getCount(CounterType.P1P1); if (counter > 0) { - return new ManaCostsImpl<>("{" + counter + "}"); + return new ManaCostsImpl<>("{" + counter + '}'); } } return null; diff --git a/Mage.Sets/src/mage/cards/p/PowerSink.java b/Mage.Sets/src/mage/cards/p/PowerSink.java index 2273f48fce..6876100c93 100644 --- a/Mage.Sets/src/mage/cards/p/PowerSink.java +++ b/Mage.Sets/src/mage/cards/p/PowerSink.java @@ -98,7 +98,7 @@ class PowerSinkCounterUnlessPaysEffect extends OneShotEffect { int amount = source.getManaCostsToPay().getX(); if (amount > 0) { GenericManaCost cost = new GenericManaCost(amount); - StringBuilder sb = new StringBuilder("Pay ").append(cost.getText()).append("?"); + StringBuilder sb = new StringBuilder("Pay ").append(cost.getText()).append('?'); if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost was paid").toString()); diff --git a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java index 6db2e4c42a..73c19fe322 100644 --- a/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java +++ b/Mage.Sets/src/mage/cards/p/PyxisOfPandemonium.java @@ -122,7 +122,7 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect { exileId = UUID.randomUUID(); exileIds.put(exileKey, exileId); } - player.moveCardsToExile(card, source, game, false, exileId, sourceObject.getIdName() + " (" + player.getName() + ")"); + player.moveCardsToExile(card, source, game, false, exileId, sourceObject.getIdName() + " (" + player.getName() + ')'); card.setFaceDown(true, game); } } diff --git a/Mage.Sets/src/mage/cards/q/Quicken.java b/Mage.Sets/src/mage/cards/q/Quicken.java index 41162038ec..04b2d4a018 100644 --- a/Mage.Sets/src/mage/cards/q/Quicken.java +++ b/Mage.Sets/src/mage/cards/q/Quicken.java @@ -153,12 +153,12 @@ class QuickenWatcher extends Watcher { } public void addQuickenSpell(UUID playerId, UUID sourceId, int zoneChangeCounter) { - String spellKey = playerId.toString() + sourceId.toString() + "_" + zoneChangeCounter; + String spellKey = playerId.toString() + sourceId.toString() + '_' + zoneChangeCounter; activeQuickenSpells.add(spellKey); } public boolean isQuickenSpellActive(UUID playerId, UUID sourceId, int zoneChangeCounter) { - String spellKey = playerId.toString() + sourceId.toString() + "_" + zoneChangeCounter; + String spellKey = playerId.toString() + sourceId.toString() + '_' + zoneChangeCounter; return activeQuickenSpells.contains(spellKey); } diff --git a/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java b/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java index 9601fb20d3..1646982006 100644 --- a/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java +++ b/Mage.Sets/src/mage/cards/r/ResearchDevelopment.java @@ -127,7 +127,7 @@ class ResearchEffect extends OneShotEffect { textToAsk = new StringBuilder(choiceText); textToAsk.append(" ("); textToAsk.append(count); - textToAsk.append(")"); + textToAsk.append(')'); } } @@ -170,7 +170,7 @@ class DevelopmentEffect extends OneShotEffect { for (UUID opponentUuid : opponents) { Player opponent = game.getPlayer(opponentUuid); if (opponent != null && opponent.chooseUse(Outcome.Detriment, - "Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ")", source, game)) { + "Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ')', source, game)) { game.informPlayers(opponent.getLogName() + " had chosen to let " + player.getLogName() + " draw a card."); player.drawCards(1, game); putToken = false; diff --git a/Mage.Sets/src/mage/cards/r/ReverseTheSands.java b/Mage.Sets/src/mage/cards/r/ReverseTheSands.java index 6053a99996..970864b126 100644 --- a/Mage.Sets/src/mage/cards/r/ReverseTheSands.java +++ b/Mage.Sets/src/mage/cards/r/ReverseTheSands.java @@ -105,7 +105,7 @@ class ReverseTheSandsEffect extends OneShotEffect { } else { selectedChoice = choices.iterator().next(); } - int index = selectedChoice.indexOf(" "); + int index = selectedChoice.indexOf(' '); if (index > 0) { String lifeString = selectedChoice.substring(0, index); int life = Integer.parseInt(lifeString); diff --git a/Mage.Sets/src/mage/cards/r/RhysticStudy.java b/Mage.Sets/src/mage/cards/r/RhysticStudy.java index d00a339e8d..41e2e18fda 100644 --- a/Mage.Sets/src/mage/cards/r/RhysticStudy.java +++ b/Mage.Sets/src/mage/cards/r/RhysticStudy.java @@ -92,7 +92,7 @@ class RhysticStudyDrawEffect extends OneShotEffect { Cost cost = new GenericManaCost(1); String message = "Would you like to pay {1} to prevent the opponent to draw a card?"; if (!(opponent.chooseUse(Outcome.Benefit, message, source, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false, null))) { - if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", source, game)) { + if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) { controller.drawCards(1, game); } } diff --git a/Mage.Sets/src/mage/cards/r/RidersOfGavony.java b/Mage.Sets/src/mage/cards/r/RidersOfGavony.java index 074ada3a05..4c1fae2158 100644 --- a/Mage.Sets/src/mage/cards/r/RidersOfGavony.java +++ b/Mage.Sets/src/mage/cards/r/RidersOfGavony.java @@ -114,7 +114,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { if (permanent != null) { String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); if (subtype != null) { - protectionFilter = new FilterPermanent(subtype + "s"); + protectionFilter = new FilterPermanent(subtype + 's'); protectionFilter.add(new SubtypePredicate(subtype)); } } diff --git a/Mage.Sets/src/mage/cards/r/RunedHalo.java b/Mage.Sets/src/mage/cards/r/RunedHalo.java index 7e5a7d8e0d..f6d89e6dfb 100644 --- a/Mage.Sets/src/mage/cards/r/RunedHalo.java +++ b/Mage.Sets/src/mage/cards/r/RunedHalo.java @@ -96,7 +96,7 @@ class RunedHaloSetProtectionEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); if (controller != null && cardName != null && !cardName.isEmpty()) { - FilterObject filter = new FilterObject("the name [" + cardName + "]"); + FilterObject filter = new FilterObject("the name [" + cardName + ']'); filter.add(new NamePredicate(cardName)); ContinuousEffect effect = new GainAbilityControllerEffect(new ProtectionAbility(filter), Duration.Custom); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/s/SarpadianEmpiresVolVii.java b/Mage.Sets/src/mage/cards/s/SarpadianEmpiresVolVii.java index f205359c8a..d2effe914a 100644 --- a/Mage.Sets/src/mage/cards/s/SarpadianEmpiresVolVii.java +++ b/Mage.Sets/src/mage/cards/s/SarpadianEmpiresVolVii.java @@ -135,20 +135,22 @@ class CreateSelectedTokenEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { String tokenType = game.getState().getValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii").toString(); Token token; - if(tokenType.equals("White Citizen")) { - token = new CitizenToken(); - } - else if(tokenType.equals("Blue Camarid")) { - token = new CamaridToken(); - } - else if(tokenType.equals("Black Thrull")) { - token = new ThrullToken(); - } - else if(tokenType.equals("Red Goblin")) { - token = new GoblinToken(); - } - else { - token = new SaprolingToken(); + switch (tokenType) { + case "White Citizen": + token = new CitizenToken(); + break; + case "Blue Camarid": + token = new CamaridToken(); + break; + case "Black Thrull": + token = new ThrullToken(); + break; + case "Red Goblin": + token = new GoblinToken(); + break; + default: + token = new SaprolingToken(); + break; } token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; diff --git a/Mage.Sets/src/mage/cards/s/SavageSummoning.java b/Mage.Sets/src/mage/cards/s/SavageSummoning.java index 645a1bf1bd..1633ecd3f6 100644 --- a/Mage.Sets/src/mage/cards/s/SavageSummoning.java +++ b/Mage.Sets/src/mage/cards/s/SavageSummoning.java @@ -182,7 +182,7 @@ class SavageSummoningWatcher extends Watcher { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getCardType().contains(CardType.CREATURE)) { spellsCastWithSavageSummoning.put(spell.getId(), new HashSet<>(savageSummoningSpells)); - String cardKey = new StringBuilder(spell.getCard().getId().toString()).append("_").append(spell.getCard().getZoneChangeCounter(game)).toString(); + String cardKey = new StringBuilder(spell.getCard().getId().toString()).append('_').append(spell.getCard().getZoneChangeCounter(game)).toString(); cardsCastWithSavageSummoning.put(cardKey, new HashSet<>(savageSummoningSpells)); savageSummoningSpells.clear(); } @@ -191,7 +191,7 @@ class SavageSummoningWatcher extends Watcher { } public void setSavageSummoningSpellActive(Card card, Game game) { - String cardKey = new StringBuilder(card.getId().toString()).append("_").append(card.getZoneChangeCounter(game)).toString(); + String cardKey = new StringBuilder(card.getId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString(); savageSummoningSpells.add(cardKey); } @@ -200,15 +200,15 @@ class SavageSummoningWatcher extends Watcher { } public boolean isSpellCastWithThisSavageSummoning(UUID spellId, UUID cardId, int zoneChangeCounter) { - String cardKey = new StringBuilder(cardId.toString()).append("_").append(zoneChangeCounter).toString(); + String cardKey = new StringBuilder(cardId.toString()).append('_').append(zoneChangeCounter).toString(); HashSet savageSpells = (HashSet) spellsCastWithSavageSummoning.get(spellId); return savageSpells != null && savageSpells.contains(cardKey); } public boolean isCardCastWithThisSavageSummoning(Card card, UUID cardId, int zoneChangeCounter, Game game) { - String creatureCardKey = card.getId().toString() + "_" + (card.getZoneChangeCounter(game)); + String creatureCardKey = card.getId().toString() + '_' + (card.getZoneChangeCounter(game)); // add one because card is now gone to battlefield as creature - String cardKey = cardId.toString() + "_" + zoneChangeCounter; + String cardKey = cardId.toString() + '_' + zoneChangeCounter; HashSet savageSpells = (HashSet) cardsCastWithSavageSummoning.get(creatureCardKey); return savageSpells != null && savageSpells.contains(cardKey); } diff --git a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java index 5eab7fabbf..bf81872687 100644 --- a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java +++ b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java @@ -152,12 +152,12 @@ class ScoutsWarningWatcher extends Watcher { } public void addScoutsWarningSpell(UUID sourceId, int zoneChangeCounter) { - String spellKey = new StringBuilder(sourceId.toString()).append("_").append(zoneChangeCounter).toString(); + String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString(); activeScoutsWarningSpells.add(spellKey); } public boolean isScoutsWarningSpellActive(UUID sourceId, int zoneChangeCounter) { - String spellKey = new StringBuilder(sourceId.toString()).append("_").append(zoneChangeCounter).toString(); + String spellKey = new StringBuilder(sourceId.toString()).append('_').append(zoneChangeCounter).toString(); return activeScoutsWarningSpells.contains(spellKey); } diff --git a/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java b/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java index 3c06e7928e..e9e815b992 100644 --- a/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java +++ b/Mage.Sets/src/mage/cards/s/SealOfTheGuildpact.java @@ -132,7 +132,7 @@ class SealOfTheGuildpactChooseColorEffect extends OneShotEffect { } String color2 = choice2.getChoice(); if (!game.isSimulation()) { - game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + color1 + " and " + color2 + "."); + game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + color1 + " and " + color2 + '.'); } game.getState().setValue(mageObject.getId() + "_color1", choice1.getColor()); game.getState().setValue(mageObject.getId() + "_color2", choice2.getColor()); diff --git a/Mage.Sets/src/mage/cards/s/SenTriplets.java b/Mage.Sets/src/mage/cards/s/SenTriplets.java index 4a260e2a05..715c6d9873 100644 --- a/Mage.Sets/src/mage/cards/s/SenTriplets.java +++ b/Mage.Sets/src/mage/cards/s/SenTriplets.java @@ -112,7 +112,7 @@ class SenTripletsRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { MageObject mageObject = game.getObject(source.getSourceId()); if (targetPlayer != null && mageObject != null) { return "This turn you can't cast spells or activate abilities" + - " (" + mageObject.getLogName() + ")"; + " (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage.Sets/src/mage/cards/s/Shapeshifter.java b/Mage.Sets/src/mage/cards/s/Shapeshifter.java index b17dce99c4..4194f86be8 100644 --- a/Mage.Sets/src/mage/cards/s/Shapeshifter.java +++ b/Mage.Sets/src/mage/cards/s/Shapeshifter.java @@ -119,7 +119,7 @@ class ShapeshifterEffect extends OneShotEffect { return false; } } - game.informPlayers("Shapeshifter, chosen number: [" + numberChoice.getChoice() + "]"); + game.informPlayers("Shapeshifter, chosen number: [" + numberChoice.getChoice() + ']'); game.getState().setValue(source.getSourceId().toString() + "_Shapeshifter", numberChoice.getChoice()); if (mageObject instanceof Permanent) { ((Permanent) mageObject).addInfo("lastChosenNumber", CardUtil.addToolTipMarkTags("Last chosen number: " + numberChoice.getChoice()), game); diff --git a/Mage.Sets/src/mage/cards/s/SharedFate.java b/Mage.Sets/src/mage/cards/s/SharedFate.java index f3bb10985c..1d12d4d225 100644 --- a/Mage.Sets/src/mage/cards/s/SharedFate.java +++ b/Mage.Sets/src/mage/cards/s/SharedFate.java @@ -109,7 +109,7 @@ class SharedFateReplacementEffect extends ReplacementEffectImpl { game, false, CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + playerToDraw.getId().toString(), game), - "Shared Fate (" + playerToDraw.getName() + ")"); + "Shared Fate (" + playerToDraw.getName() + ')'); card.setFaceDown(true, game); } } @@ -159,7 +159,7 @@ class SharedFatePlayEffect extends AsThoughEffectImpl { if (exileId != null) { ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null && exileZone.contains(objectId)) { - if (player.chooseUse(outcome, "Play " + game.getCard(objectId).getIdName() + "?", source, game)) { + if (player.chooseUse(outcome, "Play " + game.getCard(objectId).getIdName() + '?', source, game)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SimicManipulator.java b/Mage.Sets/src/mage/cards/s/SimicManipulator.java index 79db02c1e2..28682aea6f 100644 --- a/Mage.Sets/src/mage/cards/s/SimicManipulator.java +++ b/Mage.Sets/src/mage/cards/s/SimicManipulator.java @@ -143,6 +143,6 @@ class SimicManipulatorGainControlTargetEffect extends ContinuousEffectImpl { @Override public String getText(Mode mode) { - return "Gain control of target " + mode.getTargets().get(0).getTargetName() + " " + duration.toString(); + return "Gain control of target " + mode.getTargets().get(0).getTargetName() + ' ' + duration.toString(); } } diff --git a/Mage.Sets/src/mage/cards/s/SoulFoundry.java b/Mage.Sets/src/mage/cards/s/SoulFoundry.java index 4d8651a89a..1b2c712dba 100644 --- a/Mage.Sets/src/mage/cards/s/SoulFoundry.java +++ b/Mage.Sets/src/mage/cards/s/SoulFoundry.java @@ -137,7 +137,7 @@ class SoulFoundryImprintEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); - permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game); + permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game); } } } diff --git a/Mage.Sets/src/mage/cards/s/SparkOfCreativity.java b/Mage.Sets/src/mage/cards/s/SparkOfCreativity.java index 9c4acfb0be..1db8aab6db 100644 --- a/Mage.Sets/src/mage/cards/s/SparkOfCreativity.java +++ b/Mage.Sets/src/mage/cards/s/SparkOfCreativity.java @@ -98,7 +98,7 @@ class SparkOfCreativityEffect extends OneShotEffect { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { int cmc = card.getManaCost().convertedManaCost(); - if (controller.chooseUse(outcome, "Let " + sourceObject.getLogName() + " deal " + cmc + " damage to " + targetCreature.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Let " + sourceObject.getLogName() + " deal " + cmc + " damage to " + targetCreature.getLogName() + '?', source, game)) { targetCreature.damage(cmc, source.getSourceId(), game, false, true); return true; } diff --git a/Mage.Sets/src/mage/cards/s/Spellbinder.java b/Mage.Sets/src/mage/cards/s/Spellbinder.java index 1012fc39c7..482c7e4d19 100644 --- a/Mage.Sets/src/mage/cards/s/Spellbinder.java +++ b/Mage.Sets/src/mage/cards/s/Spellbinder.java @@ -147,7 +147,7 @@ class SpellbinderImprintEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); - permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game); + permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + ']'), game); } } } @@ -189,7 +189,7 @@ class SpellbinderCopyEffect extends OneShotEffect { if (spellbinder != null && spellbinder.getImprinted() != null && !spellbinder.getImprinted().isEmpty()) { Card imprintedInstant = game.getCard(spellbinder.getImprinted().get(0)); if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) { - if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) { + if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) { Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId()); if (copiedCard != null) { game.getExile().add(source.getSourceId(), "", copiedCard); diff --git a/Mage.Sets/src/mage/cards/s/SphereOfSafety.java b/Mage.Sets/src/mage/cards/s/SphereOfSafety.java index af97aa7eae..af2255a56f 100644 --- a/Mage.Sets/src/mage/cards/s/SphereOfSafety.java +++ b/Mage.Sets/src/mage/cards/s/SphereOfSafety.java @@ -81,7 +81,7 @@ class SphereOfSafetyPayManaToAttackAllEffect extends CantAttackYouUnlessPayManaA public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) { int enchantments = game.getBattlefield().countAll(new FilterEnchantmentPermanent(), source.getControllerId(), game); if (enchantments > 0) { - return new ManaCostsImpl<>("{" + enchantments + "}"); + return new ManaCostsImpl<>("{" + enchantments + '}'); } return null; } diff --git a/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java b/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java index 1c2a4b062f..d2bd6f6fdd 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java +++ b/Mage.Sets/src/mage/cards/s/SphinxAmbassador.java @@ -121,7 +121,7 @@ class SphinxAmbassadorEffect extends OneShotEffect { } String cardName = cardChoice.getChoice(); - game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(", named card: [").append(cardName).append("]").toString()); + game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(", named card: [").append(cardName).append(']').toString()); if (!card.getName().equals(cardName) && card.getCardType().contains(CardType.CREATURE)) { if (controller.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append(" onto the battlefield?").toString(), source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/s/SphinxOfUthuun.java b/Mage.Sets/src/mage/cards/s/SphinxOfUthuun.java index 3731a6102f..15dbf48a6a 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxOfUthuun.java +++ b/Mage.Sets/src/mage/cards/s/SphinxOfUthuun.java @@ -162,13 +162,13 @@ class SphinxOfUthuunEffect extends OneShotEffect { } game.informPlayers(sb.toString()); - sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (":"); + sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':'); i = 0; for (UUID cardUuid : pile2CardsIds) { Card card = game.getCard(cardUuid); if (card != null) { i++; - sb.append(" ").append(card.getName()); + sb.append(' ').append(card.getName()); if (i < pile2CardsIds.size()) { sb.append(", "); } diff --git a/Mage.Sets/src/mage/cards/s/SqueesRevenge.java b/Mage.Sets/src/mage/cards/s/SqueesRevenge.java index e7d050422c..b360c55ac5 100644 --- a/Mage.Sets/src/mage/cards/s/SqueesRevenge.java +++ b/Mage.Sets/src/mage/cards/s/SqueesRevenge.java @@ -80,7 +80,7 @@ class SqueesRevengeEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if(player != null) { int number = player.announceXMana(0, Integer.MAX_VALUE, "Choose how many times to flip a coin", game, source); - game.informPlayers(player.getLogName() + " chooses " + number + "."); + game.informPlayers(player.getLogName() + " chooses " + number + '.'); for(int i = 0; i < number; i++) { if(!player.flipCoin(game)) { return true; diff --git a/Mage.Sets/src/mage/cards/s/SteamAugury.java b/Mage.Sets/src/mage/cards/s/SteamAugury.java index e6287d3ac4..7644421780 100644 --- a/Mage.Sets/src/mage/cards/s/SteamAugury.java +++ b/Mage.Sets/src/mage/cards/s/SteamAugury.java @@ -161,13 +161,13 @@ class SteamAuguryEffect extends OneShotEffect { } game.informPlayers(sb.toString()); - sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(":"); + sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':'); i = 0; for (UUID cardUuid : pile2CardsIds) { Card card = game.getCard(cardUuid); if (card != null) { i++; - sb.append(" ").append(GameLog.getColoredObjectName(card)); + sb.append(' ').append(GameLog.getColoredObjectName(card)); if (i < pile2CardsIds.size()) { sb.append(", "); } diff --git a/Mage.Sets/src/mage/cards/s/StonewiseFortifier.java b/Mage.Sets/src/mage/cards/s/StonewiseFortifier.java index 2f8726a477..772587ec89 100644 --- a/Mage.Sets/src/mage/cards/s/StonewiseFortifier.java +++ b/Mage.Sets/src/mage/cards/s/StonewiseFortifier.java @@ -104,7 +104,7 @@ class StonewiseFortifierPreventAllDamageToEffect extends PreventionEffectImpl { if (damageSource != null && preventionSource != null) { StringBuilder message = new StringBuilder(preventedDamage).append(" damage from "); message.append(damageSource.getName()).append(" prevented "); - message.append("(").append(preventionSource).append(")"); + message.append('(').append(preventionSource).append(')'); game.informPlayers(message.toString()); } event.setAmount(0); diff --git a/Mage.Sets/src/mage/cards/s/StrongholdGambit.java b/Mage.Sets/src/mage/cards/s/StrongholdGambit.java index 0d4c93bd21..f1b9620544 100644 --- a/Mage.Sets/src/mage/cards/s/StrongholdGambit.java +++ b/Mage.Sets/src/mage/cards/s/StrongholdGambit.java @@ -106,7 +106,7 @@ class StrongholdGambitEffect extends OneShotEffect { Card card = game.getCard(choosenCard.get(playerId)); if (card != null) { Cards cardsToReveal = new CardsImpl(card); - player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cardsToReveal, game); + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cardsToReveal, game); if (card.getCardType().contains(CardType.CREATURE) && lowestCMC > card.getConvertedManaCost()) { lowestCMC = card.getConvertedManaCost(); diff --git a/Mage.Sets/src/mage/cards/t/TemporalExtortion.java b/Mage.Sets/src/mage/cards/t/TemporalExtortion.java index ee47429139..832f9a188d 100644 --- a/Mage.Sets/src/mage/cards/t/TemporalExtortion.java +++ b/Mage.Sets/src/mage/cards/t/TemporalExtortion.java @@ -89,10 +89,10 @@ class TemporalExtortionCounterSourceEffect extends OneShotEffect { if (sourceObject != null) { for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { Player player = game.getPlayer(playerId); - if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + sourceObject.getIdName() + "?", source, game)) { + if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + sourceObject.getIdName() + '?', source, game)) { Integer amount = (int) Math.ceil(player.getLife() / 2f); player.loseLife(amount, game, false); - game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + sourceObject.getIdName() + "."); + game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + sourceObject.getIdName() + '.'); Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/t/TheTabernacleAtPendrellVale.java b/Mage.Sets/src/mage/cards/t/TheTabernacleAtPendrellVale.java index 2efb2539a5..07dd69ea82 100644 --- a/Mage.Sets/src/mage/cards/t/TheTabernacleAtPendrellVale.java +++ b/Mage.Sets/src/mage/cards/t/TheTabernacleAtPendrellVale.java @@ -89,7 +89,7 @@ class DestroySourceUnlessPaysEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { - if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; diff --git a/Mage.Sets/src/mage/cards/t/ThoughtPrison.java b/Mage.Sets/src/mage/cards/t/ThoughtPrison.java index 085d39a818..606a57c384 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtPrison.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtPrison.java @@ -120,7 +120,7 @@ class ThoughtPrisonImprintEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); - permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append("]").toString(), game); + permanent.addInfo("imprint", new StringBuilder("[Exiled card - ").append(card.getName()).append(']').toString(), game); } return true; } diff --git a/Mage.Sets/src/mage/cards/t/TimeVault.java b/Mage.Sets/src/mage/cards/t/TimeVault.java index d118f7be6a..29b20b4893 100644 --- a/Mage.Sets/src/mage/cards/t/TimeVault.java +++ b/Mage.Sets/src/mage/cards/t/TimeVault.java @@ -118,7 +118,7 @@ class TimeVaultReplacementEffect extends ReplacementEffectImpl { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { - if (player.chooseUse(Outcome.Untap, "Skip your turn to untap " + permanent.getName() + "?", source, game)) { + if (player.chooseUse(Outcome.Untap, "Skip your turn to untap " + permanent.getName() + '?', source, game)) { permanent.untap(game); game.informPlayers(player.getLogName() + " skips his or her turn to untap " + permanent.getLogName()); return true; diff --git a/Mage.Sets/src/mage/cards/t/ToilsOfNightAndDay.java b/Mage.Sets/src/mage/cards/t/ToilsOfNightAndDay.java index bf645b6178..5ce5b0c0a0 100644 --- a/Mage.Sets/src/mage/cards/t/ToilsOfNightAndDay.java +++ b/Mage.Sets/src/mage/cards/t/ToilsOfNightAndDay.java @@ -89,9 +89,9 @@ public class ToilsOfNightAndDay extends CardImpl { for (UUID targetId : source.getTargets().get(0).getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), source, game)) { + if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append('?').toString(), source, game)) { permanent.tap(game); - } else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), source, game)) { + } else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append('?').toString(), source, game)) { permanent.untap(game); } } diff --git a/Mage.Sets/src/mage/cards/t/TorrentialGearhulk.java b/Mage.Sets/src/mage/cards/t/TorrentialGearhulk.java index 39ebe3e996..0f5bcee906 100644 --- a/Mage.Sets/src/mage/cards/t/TorrentialGearhulk.java +++ b/Mage.Sets/src/mage/cards/t/TorrentialGearhulk.java @@ -112,7 +112,7 @@ class TorrentialGearhulkEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); if (card != null) { - if (controller.chooseUse(outcome, "Cast " + card.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Cast " + card.getLogName() + '?', source, game)) { if (controller.cast(card.getSpellAbility(), game, true)) { ContinuousEffect effect = new TorrentialGearhulkReplacementEffect(card.getId()); effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId()))); diff --git a/Mage.Sets/src/mage/cards/w/WarCadence.java b/Mage.Sets/src/mage/cards/w/WarCadence.java index 76dd94dfbb..2a5f38d0f3 100644 --- a/Mage.Sets/src/mage/cards/w/WarCadence.java +++ b/Mage.Sets/src/mage/cards/w/WarCadence.java @@ -87,7 +87,7 @@ class WarCadenceReplacementEffect extends ReplacementEffectImpl { if (player != null) { int amount = xCosts.calculate(game, source, this); if (amount > 0) { - String mana = "{" + amount + "}"; + String mana = "{" + amount + '}'; ManaCostsImpl cost = new ManaCostsImpl(mana); if (cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && player.chooseUse(Outcome.Benefit, "Pay " + mana + " to declare blocker?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/w/WarTax.java b/Mage.Sets/src/mage/cards/w/WarTax.java index 2beac05396..5cae163e64 100644 --- a/Mage.Sets/src/mage/cards/w/WarTax.java +++ b/Mage.Sets/src/mage/cards/w/WarTax.java @@ -87,7 +87,7 @@ class WarTaxReplacementEffect extends ReplacementEffectImpl { if (player != null) { int amount = xCosts.calculate(game, source, this); if (amount > 0) { - String mana = "{" + amount + "}"; + String mana = "{" + amount + '}'; ManaCostsImpl cost = new ManaCostsImpl(mana); if (cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && player.chooseUse(Outcome.Benefit, "Pay " + mana + " to declare attacker?", source, game)) { diff --git a/Mage.Sets/src/mage/cards/w/WarpWorld.java b/Mage.Sets/src/mage/cards/w/WarpWorld.java index 2608475d80..b74b899fa9 100644 --- a/Mage.Sets/src/mage/cards/w/WarpWorld.java +++ b/Mage.Sets/src/mage/cards/w/WarpWorld.java @@ -132,7 +132,7 @@ class WarpWorldEffect extends OneShotEffect { if (player != null) { CardsImpl cards = new CardsImpl(); cards.addAll(player.getLibrary().getTopCards(game, permanentsCount.get(player.getId()))); - player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cards, game); + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cards, game); cardsRevealed.put(player.getId(), cards); } } diff --git a/Mage.Sets/src/mage/cards/w/WeirdHarvest.java b/Mage.Sets/src/mage/cards/w/WeirdHarvest.java index c6ffb034ee..96091a99d6 100644 --- a/Mage.Sets/src/mage/cards/w/WeirdHarvest.java +++ b/Mage.Sets/src/mage/cards/w/WeirdHarvest.java @@ -118,7 +118,7 @@ class WeirdHarvestEffect extends OneShotEffect { if (target.getTargets().size() > 0) { Cards cards = new CardsImpl(target.getTargets()); player.moveCards(cards, Zone.HAND, source, game); - player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cards, game); + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cards, game); } } } diff --git a/Mage.Sets/src/mage/cards/w/WellOfLostDreams.java b/Mage.Sets/src/mage/cards/w/WellOfLostDreams.java index 81a4686a1e..9eb26ebc9c 100644 --- a/Mage.Sets/src/mage/cards/w/WellOfLostDreams.java +++ b/Mage.Sets/src/mage/cards/w/WellOfLostDreams.java @@ -87,7 +87,7 @@ class WellOfLostDreamsEffect extends OneShotEffect { int xValue = controller.announceXMana(0, amount, "Announce X Value", game, source); if (xValue > 0) { if (new GenericManaCost(xValue).pay(source, game, source.getSourceId(), controller.getId(), false)) { - game.informPlayers(new StringBuilder(controller.getLogName()).append(" payed {").append(xValue).append("}").toString()); + game.informPlayers(new StringBuilder(controller.getLogName()).append(" payed {").append(xValue).append('}').toString()); controller.drawCards(xValue, game); } else { return false; diff --git a/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java b/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java index 30f70be1ad..327b53cef5 100644 --- a/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java +++ b/Mage.Sets/src/mage/cards/w/WhimsOfTheFates.java @@ -143,7 +143,7 @@ class WhimsOfTheFateEffect extends OneShotEffect { for (UUID permanentId : target.getTargets()) { Permanent permanent = game.getPermanent(permanentId); if (permanent != null) { - message.append(permanent.getName()).append(" "); + message.append(permanent.getName()).append(' '); } } } @@ -156,7 +156,7 @@ class WhimsOfTheFateEffect extends OneShotEffect { for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(currentPlayer.getId())) { if (!playerPiles.get(1).contains(permanent.getId()) && !playerPiles.get(2).contains(permanent.getId())) { playerPiles.get(3).add(permanent.getId()); - message.append(permanent.getName()).append(" "); + message.append(permanent.getName()).append(' '); } } if (playerPiles.get(3).isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/w/WoodSage.java b/Mage.Sets/src/mage/cards/w/WoodSage.java index 1838a6a47d..c562393390 100644 --- a/Mage.Sets/src/mage/cards/w/WoodSage.java +++ b/Mage.Sets/src/mage/cards/w/WoodSage.java @@ -107,7 +107,7 @@ class WoodSageEffect extends OneShotEffect { } String cardName = cardChoice.getChoice(); if (!game.isSimulation()) { - game.informPlayers(sourceObject.getLogName() + ", named card: [" + cardName + "]"); + game.informPlayers(sourceObject.getLogName() + ", named card: [" + cardName + ']'); } FilterCreatureCard filter = new FilterCreatureCard("all of them with that name"); diff --git a/Mage.Sets/src/mage/cards/z/ZursWeirding.java b/Mage.Sets/src/mage/cards/z/ZursWeirding.java index b50b3f5b6e..4026213b23 100644 --- a/Mage.Sets/src/mage/cards/z/ZursWeirding.java +++ b/Mage.Sets/src/mage/cards/z/ZursWeirding.java @@ -101,7 +101,7 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl { Card card = player.getLibrary().getFromTop(game); if (card != null) { // reveals it instead - player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + "|" + game.getPhase().getType() + ")", new CardsImpl(card), game); + player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getPhase().getType() + ')', new CardsImpl(card), game); // Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard String message = "Pay 2 life to put " + card.getLogName() + " into graveyard?"; diff --git a/Mage.Stats/src/main/java/com/xmage/ws/util/json/JSONParser.java b/Mage.Stats/src/main/java/com/xmage/ws/util/json/JSONParser.java index 62e000d45c..3654f32585 100644 --- a/Mage.Stats/src/main/java/com/xmage/ws/util/json/JSONParser.java +++ b/Mage.Stats/src/main/java/com/xmage/ws/util/json/JSONParser.java @@ -97,9 +97,9 @@ public class JSONParser { json = (JSONObject) jsonArray.get(index); jsonArray = null; } else if (param.contains("[")) { - int find = param.indexOf("["); + int find = param.indexOf('['); String newParam = param.substring(0, find); - String s = param.substring(find+1, param.indexOf("]")); + String s = param.substring(find+1, param.indexOf(']')); if (s.isEmpty()) { jsonArray = (JSONArray) json.get(newParam); json = null; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/BattlefieldThaumaturgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/BattlefieldThaumaturgeTest.java index a779b7e5ee..9b446aee8c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/BattlefieldThaumaturgeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/BattlefieldThaumaturgeTest.java @@ -201,7 +201,7 @@ public class BattlefieldThaumaturgeTest extends CardTestPlayerBase { * For each creature destroyed this way, its controller puts a 4/4 red Dragon creature token with flying onto the battlefield. * Battlefield Thaumaturge should reduce the cost of the spell when cast, before he is destroyed and replaced with a dragon. */ - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Descent of the Dragons", createTargetingString(playerACreatures) + "^" + createTargetingString(playerBCreatures)); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Descent of the Dragons", createTargetingString(playerACreatures) + '^' + createTargetingString(playerBCreatures)); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java index b611c66f88..821954e2d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/RandomPlayer.java @@ -200,7 +200,7 @@ public class RandomPlayer extends ComputerPlayer { StringBuilder binary = new StringBuilder(); binary.append(Integer.toBinaryString(value)); while (binary.length() < attackersList.size()) { - binary.insert(0, "0"); //pad with zeros + binary.insert(0, '0'); //pad with zeros } for (int i = 0; i < attackersList.size(); i++) { if (binary.charAt(i) == '1') { diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index e86fc59995..5d98013248 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -491,7 +491,7 @@ public class TestPlayer implements Player { if (numberOfActions == actions.size()) { foundNoAction++; if (foundNoAction > maxCallsWithoutAction) { - throw new AssertionError("More priority calls to " + getName() + " and doing no action than allowed (" + maxCallsWithoutAction + ")"); + throw new AssertionError("More priority calls to " + getName() + " and doing no action than allowed (" + maxCallsWithoutAction + ')'); } } else { foundNoAction = 0; @@ -671,7 +671,7 @@ public class TestPlayer implements Player { break; } } - } else if ((permanent.getName() + "-" + permanent.getExpansionSetCode()).equals(targetName)) { + } else if ((permanent.getName() + '-' + permanent.getExpansionSetCode()).equals(targetName)) { if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), source, game)) { if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) { target.add(permanent.getId(), game); @@ -816,7 +816,7 @@ public class TestPlayer implements Player { filter = ((FilterCreatureOrPlayer) filter).getCreatureFilter(); } for (Permanent permanent : game.getBattlefield().getAllActivePermanents((FilterPermanent) filter, game)) { - if (permanent.getName().equals(targetName) || (permanent.getName() + "-" + permanent.getExpansionSetCode()).equals(targetName)) { + if (permanent.getName().equals(targetName) || (permanent.getName() + '-' + permanent.getExpansionSetCode()).equals(targetName)) { if (target.canTarget(abilityControllerId, permanent.getId(), source, game) && !target.getTargets().contains(permanent.getId())) { if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) { target.add(permanent.getId(), game); @@ -841,7 +841,7 @@ public class TestPlayer implements Player { boolean targetFound = false; for (String targetName : targetList) { for (Card card : computerPlayer.getHand().getCards(((TargetCardInHand) target).getFilter(), game)) { - if (card.getName().equals(targetName) || (card.getName() + "-" + card.getExpansionSetCode()).equals(targetName)) { + if (card.getName().equals(targetName) || (card.getName() + '-' + card.getExpansionSetCode()).equals(targetName)) { if (((TargetCardInHand) target).canTarget(abilityControllerId, card.getId(), source, game) && !target.getTargets().contains(card.getId())) { target.add(card.getId(), game); targetFound = true; @@ -863,7 +863,7 @@ public class TestPlayer implements Player { boolean targetFound = false; for (String targetName : targetList) { for (Card card : computerPlayer.getGraveyard().getCards(((TargetCardInYourGraveyard) target).getFilter(), game)) { - if (card.getName().equals(targetName) || (card.getName() + "-" + card.getExpansionSetCode()).equals(targetName)) { + if (card.getName().equals(targetName) || (card.getName() + '-' + card.getExpansionSetCode()).equals(targetName)) { if (((TargetCardInYourGraveyard) target).canTarget(abilityControllerId, card.getId(), source, game) && !target.getTargets().contains(card.getId())) { target.add(card.getId(), game); targetFound = true; @@ -890,7 +890,7 @@ public class TestPlayer implements Player { if (computerPlayer.hasOpponent(opponentId, game)) { Player opponent = game.getPlayer(opponentId); for (Card card : opponent.getGraveyard().getCards(((TargetCardInOpponentsGraveyard) target).getFilter(), game)) { - if (card.getName().equals(targetName) || (card.getName() + "-" + card.getExpansionSetCode()).equals(targetName)) { + if (card.getName().equals(targetName) || (card.getName() + '-' + card.getExpansionSetCode()).equals(targetName)) { if (((TargetCardInOpponentsGraveyard) target).canTarget(abilityControllerId, card.getId(), source, game) && !target.getTargets().contains(card.getId())) { target.add(card.getId(), game); targetFound = true; diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java index 0db848daf4..84fb5ef357 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java @@ -120,7 +120,7 @@ public abstract class MageTestBase { private static Class loadPlugin(Plugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading plugin: " + plugin.getClassName()); return Class.forName(plugin.getClassName(), true, classLoader); } catch (ClassNotFoundException ex) { @@ -133,7 +133,7 @@ public abstract class MageTestBase { private static MatchType loadGameType(GamePlugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading game type: " + plugin.getClassName()); return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); } catch (ClassNotFoundException ex) { @@ -146,7 +146,7 @@ public abstract class MageTestBase { private static TournamentType loadTournamentType(GamePlugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading tournament type: " + plugin.getClassName()); return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); } catch (ClassNotFoundException ex) { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java index 9cdd524421..265495fbe9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java @@ -106,7 +106,7 @@ public abstract class MageTestPlayerBase { private static Class loadPlugin(Plugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading plugin: " + plugin.getClassName()); return Class.forName(plugin.getClassName(), true, classLoader); } catch (ClassNotFoundException ex) { @@ -119,7 +119,7 @@ public abstract class MageTestPlayerBase { private static MatchType loadGameType(GamePlugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading game type: " + plugin.getClassName()); return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); } catch (ClassNotFoundException ex) { @@ -132,7 +132,7 @@ public abstract class MageTestPlayerBase { private static TournamentType loadTournamentType(GamePlugin plugin) { try { - classLoader.addURL(new File(pluginFolder + "/" + plugin.getJar()).toURI().toURL()); + classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL()); logger.info("Loading tournament type: " + plugin.getClassName()); return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance(); } catch (ClassNotFoundException ex) { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java index ed59291a0b..8825bc72b7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestAPIImpl.java @@ -290,9 +290,9 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP if (permanent.getName().equals(cardName)) { count++; if (scope.equals(Filter.ComparisonScope.All)) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", + Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ')', power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", + Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ')', toughness, permanent.getToughness().getValue()); } else if (scope.equals(Filter.ComparisonScope.Any)) { if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { @@ -372,7 +372,7 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP } } } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ')', count, actualCount); } public Permanent getPermanent(String cardName, UUID controller) { @@ -387,7 +387,7 @@ public abstract class CardTestAPIImpl extends MageTestBase implements CardTestAP } } Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); - Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); + Assert.assertEquals("More than one permanent was found: " + cardName + '(' + count + ')', 1, count); return permanent0; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index c2b6e993c4..9aa176560d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -446,9 +446,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement if (permanent.getName().equals(cardName) && permanent.getControllerId().equals(player.getId())) { count++; if (scope.equals(Filter.ComparisonScope.All)) { - Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")", + Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ')', power, permanent.getPower().getValue()); - Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ")", + Assert.assertEquals("Toughness is not the same (" + toughness + " vs. " + permanent.getToughness().getValue() + ')', toughness, permanent.getToughness().getValue()); } else if (scope.equals(Filter.ComparisonScope.Any)) { if (power == permanent.getPower().getValue() && toughness == permanent.getToughness().getValue()) { @@ -466,8 +466,8 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement + ", cardName=" + cardName, count > 0); if (scope.equals(Filter.ComparisonScope.Any)) { - Assert.assertTrue("There is no such creature under player's control with specified p/t of " + power + "/" + toughness + ", player=" + player.getName() - + ", cardName=" + cardName + " (found similar: " + found + ", one of them: power=" + foundPower + " toughness=" + foundToughness + ")", fit > 0); + Assert.assertTrue("There is no such creature under player's control with specified p/t of " + power + '/' + toughness + ", player=" + player.getName() + + ", cardName=" + cardName + " (found similar: " + found + ", one of them: power=" + foundPower + " toughness=" + foundToughness + ')', fit > 0); } } @@ -584,7 +584,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } } - Assert.assertEquals("(Battlefield) Permanents counts for " + player.getName() + " are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Battlefield) Permanents counts for " + player.getName() + " are not equal (" + cardName + ')', count, actualCount); } @Override @@ -595,7 +595,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement actualCount++; } } - Assert.assertEquals("(Command Zone) Card counts are not equal (" + commandZoneObjectName + ")", count, actualCount); + Assert.assertEquals("(Command Zone) Card counts are not equal (" + commandZoneObjectName + ')', count, actualCount); } /** @@ -636,7 +636,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } Assert.assertNotNull("There is no such permanent " + (player == null ? "" : "for player " + player.getName()) + " on the battlefield, cardName=" + cardName, found); - Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters(currentGame).getCount(type)); + Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ':' + type + ')', count, found.getCounters(currentGame).getCount(type)); } /** @@ -659,7 +659,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } Assert.assertNotNull("There is no such card in the exile, cardName=" + cardName, found); - Assert.assertEquals("(Exile) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters(currentGame).getCount(type)); + Assert.assertEquals("(Exile) Counter counts are not equal (" + cardName + ':' + type + ')', count, found.getCounters(currentGame).getCount(type)); } /** @@ -670,7 +670,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param count Expected count. */ public void assertCounterCount(Player player, CounterType type, int count) throws AssertionError { - Assert.assertEquals("(Battlefield) Counter counts are not equal (" + player.getName() + ":" + type + ")", count, player.getCounters().getCount(type)); + Assert.assertEquals("(Battlefield) Counter counts are not equal (" + player.getName() + ':' + type + ')', count, player.getCounters().getCount(type)); } /** @@ -691,7 +691,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - Assert.assertTrue("(Battlefield) card type not found (" + cardName + ":" + type + ")", (found.getCardType().contains(type) == flag)); + Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', (found.getCardType().contains(type) == flag)); } @@ -713,9 +713,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - Assert.assertTrue("(Battlefield) card type not found (" + cardName + ":" + type + ")", found.getCardType().contains(type)); + Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType().contains(type)); if (subType != null) { - Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ":" + subType + ")", found.getSubtype(currentGame).contains(subType)); + Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType + ')', found.getSubtype(currentGame).contains(subType)); } } @@ -740,7 +740,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - Assert.assertEquals("(Battlefield) Tapped state is not equal (" + cardName + ")", tapped, found.isTapped()); + Assert.assertEquals("(Battlefield) Tapped state is not equal (" + cardName + ')', tapped, found.isTapped()); } /** @@ -781,7 +781,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); - Assert.assertEquals("(Battlefield) Attacking state is not equal (" + cardName + ")", attacking, found.isAttacking()); + Assert.assertEquals("(Battlefield) Attacking state is not equal (" + cardName + ')', attacking, found.isAttacking()); } /** @@ -836,7 +836,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - Assert.assertEquals("(Exile) Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Exile) Card counts are not equal (" + cardName + ')', count, actualCount); } /** @@ -873,7 +873,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - Assert.assertEquals("(Graveyard " + player.getName() + ") Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Graveyard " + player.getName() + ") Card counts are not equal (" + cardName + ')', count, actualCount); } /** @@ -904,7 +904,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - Assert.assertEquals("(Library " + player.getName() + ") Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Library " + player.getName() + ") Card counts are not equal (" + cardName + ')', count, actualCount); } /** @@ -938,7 +938,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } Assert.assertNotNull("Couldn't find a card with specified name: " + cardName, permanent0); - Assert.assertEquals("More than one permanent was found: " + cardName + "(" + count + ")", 1, count); + Assert.assertEquals("More than one permanent was found: " + cardName + '(' + count + ')', 1, count); return permanent0; } @@ -1021,11 +1021,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, String targetName, String spellOnStack, StackClause clause) { if (StackClause.WHILE_ON_STACK.equals(clause)) { player.addAction(turnNum, step, "activate:Cast " + cardName - + "$" + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName) + + '$' + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName) + "$spellOnStack=" + spellOnStack); } else { player.addAction(turnNum, step, "activate:Cast " + cardName - + "$" + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName) + + '$' + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName) + "$!spellOnStack=" + spellOnStack); } } @@ -1077,13 +1077,13 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement sb.append("$target=").append(targetName); } if (spellOnStack != null && !spellOnStack.isEmpty()) { - sb.append("$").append(StackClause.WHILE_ON_STACK.equals(clause) ? "" : "!").append("spellOnStack=").append(spellOnStack); + sb.append('$').append(StackClause.WHILE_ON_STACK.equals(clause) ? "" : "!").append("spellOnStack=").append(spellOnStack); } player.addAction(turnNum, step, sb.toString()); } public void addCounters(int turnNum, PhaseStep step, TestPlayer player, String cardName, CounterType type, int count) { - player.addAction(turnNum, step, "addCounters:" + cardName + "$" + type.getName() + "$" + count); + player.addAction(turnNum, step, "addCounters:" + cardName + '$' + type.getName() + '$' + count); } public void attack(int turnNum, TestPlayer player, String attacker) { @@ -1099,7 +1099,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } public void block(int turnNum, TestPlayer player, String blocker, String attacker) { - player.addAction(turnNum, PhaseStep.DECLARE_BLOCKERS, "block:" + blocker + "$" + attacker); + player.addAction(turnNum, PhaseStep.DECLARE_BLOCKERS, "block:" + blocker + '$' + attacker); } /** diff --git a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java index 5b3ce77e29..8dd6fa7187 100644 --- a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java @@ -77,7 +77,7 @@ public class BoosterGenerationTest extends MageTestBase { sb.append(", "); } } - sb.append("] (").append(cards.size()).append(")"); + sb.append("] (").append(cards.size()).append(')'); return sb.toString(); } diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index d2fd8a0d57..f4140b0703 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -194,7 +194,7 @@ public class VerifyCardDataTest { private void checkPT(Card card, JsonCard ref) { if (!eqPT(card.getPower().toString(), ref.power) || !eqPT(card.getToughness().toString(), ref.toughness)) { String pt = card.getPower() + "/" + card.getToughness(); - String expected = ref.power + "/" + ref.toughness; + String expected = ref.power + '/' + ref.toughness; fail(card, "pt", pt + " != " + expected); } } diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index 0e7df0a0e6..19f2ac9dcc 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -108,7 +108,7 @@ public abstract class MageObjectImpl implements MageObject { @Override public String getIdName() { - return getName() + " [" + getId().toString().substring(0, 3) + "]"; + return getName() + " [" + getId().toString().substring(0, 3) + ']'; } @Override diff --git a/Mage/src/main/java/mage/Mana.java b/Mage/src/main/java/mage/Mana.java index 329aba528c..7a7ff39d6b 100644 --- a/Mage/src/main/java/mage/Mana.java +++ b/Mage/src/main/java/mage/Mana.java @@ -443,7 +443,7 @@ public class Mana implements Comparable, Serializable, Copyable { public String toString() { StringBuilder sbMana = new StringBuilder(); if (generic > 0) { - sbMana.append("{").append(Integer.toString(generic)).append("}"); + sbMana.append('{').append(Integer.toString(generic)).append('}'); } for (int i = 0; i < colorless; i++) { sbMana.append("{C}"); diff --git a/Mage/src/main/java/mage/ObjectColor.java b/Mage/src/main/java/mage/ObjectColor.java index c151245260..fe73f3d829 100644 --- a/Mage/src/main/java/mage/ObjectColor.java +++ b/Mage/src/main/java/mage/ObjectColor.java @@ -231,19 +231,19 @@ public class ObjectColor implements Serializable, Copyable, Compara public String toString() { StringBuilder sb = new StringBuilder(5); if (white) { - sb.append("W"); + sb.append('W'); } if (blue) { - sb.append("U"); + sb.append('U'); } if (black) { - sb.append("B"); + sb.append('B'); } if (red) { - sb.append("R"); + sb.append('R'); } if (green) { - sb.append("G"); + sb.append('G'); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index a259bee667..41e362a34c 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -345,7 +345,7 @@ public abstract class AbilityImpl implements Ability { for (Cost cost : optionalCosts) { if (cost instanceof ManaCost) { cost.clearPaid(); - if (controller.chooseUse(Outcome.Benefit, "Pay optional cost " + cost.getText() + "?", this, game)) { + if (controller.chooseUse(Outcome.Benefit, "Pay optional cost " + cost.getText() + '?', this, game)) { manaCostsToPay.add((ManaCost) cost); } } @@ -504,11 +504,11 @@ public abstract class AbilityImpl implements Ability { // set the xcosts to paid variableCost.setAmount(xValue); ((Cost) variableCost).setPaid(); - String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ")"; + String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ')'; if (announceString == null) { announceString = message; } else { - announceString = announceString + " " + message; + announceString = announceString + ' ' + message; } } } @@ -543,7 +543,7 @@ public abstract class AbilityImpl implements Ability { int amountMana = xValue * variableManaCost.getMultiplier(); StringBuilder manaString = threadLocalBuilder.get(); if (variableManaCost.getFilter() == null || variableManaCost.getFilter().isGeneric()) { - manaString.append("{").append(amountMana).append("}"); + manaString.append('{').append(amountMana).append('}'); } else { String manaSymbol = null; if (variableManaCost.getFilter().isBlack()) { @@ -561,7 +561,7 @@ public abstract class AbilityImpl implements Ability { throw new UnsupportedOperationException("ManaFilter is not supported: " + this.toString()); } for (int i = 0; i < amountMana; i++) { - manaString.append("{").append(manaSymbol).append("}"); + manaString.append('{').append(manaSymbol).append('}'); } } manaCostsToPay.add(new ManaCostsImpl(manaString.toString())); @@ -742,7 +742,7 @@ public abstract class AbilityImpl implements Ability { } if (costs.size() > 0) { if (sbRule.length() > 0) { - sbRule.append(","); + sbRule.append(','); } sbRule.append(costs.getText()); } @@ -1066,7 +1066,7 @@ public abstract class AbilityImpl implements Ability { for (Mode mode : spellModes.values()) { item++; if (mode.getId().equals(selectedMode.getId())) { - sb.append(" (mode ").append(item).append(")"); + sb.append(" (mode ").append(item).append(')'); sb.append(getTargetDescriptionForLog(selectedMode.getTargets(), game)); break; } diff --git a/Mage/src/main/java/mage/abilities/ActivationInfo.java b/Mage/src/main/java/mage/abilities/ActivationInfo.java index bf322f03af..016b76fe35 100644 --- a/Mage/src/main/java/mage/abilities/ActivationInfo.java +++ b/Mage/src/main/java/mage/abilities/ActivationInfo.java @@ -53,7 +53,7 @@ public class ActivationInfo { Integer activations = (Integer) game.getState().getValue(key); ActivationInfo activationInfo; if (activations != null) { - Integer turnNum = (Integer) game.getState().getValue(key + "T"); + Integer turnNum = (Integer) game.getState().getValue(key + 'T'); activationInfo = new ActivationInfo(game, turnNum, activations); } else { activationInfo = new ActivationInfo(game, game.getTurnNum(), 0); @@ -79,7 +79,7 @@ public class ActivationInfo { activationCounter++; } game.getState().setValue(key, activationCounter); - game.getState().setValue(key + "T", turnNum); + game.getState().setValue(key + 'T', turnNum); } public int getActivationCounter() { diff --git a/Mage/src/main/java/mage/abilities/abilityword/KinshipAbility.java b/Mage/src/main/java/mage/abilities/abilityword/KinshipAbility.java index 201b23fca8..cc5c531c57 100644 --- a/Mage/src/main/java/mage/abilities/abilityword/KinshipAbility.java +++ b/Mage/src/main/java/mage/abilities/abilityword/KinshipAbility.java @@ -127,7 +127,7 @@ class KinshipBaseEffect extends OneShotEffect { Cards cards = new CardsImpl(card); controller.lookAtCards(sourcePermanent.getName(), cards, game); if (CardUtil.shareSubtypes(sourcePermanent, card, game)) { - if (controller.chooseUse(outcome,new StringBuilder("Kinship - Reveal ").append(card.getLogName()).append("?").toString(), source, game)) { + if (controller.chooseUse(outcome,new StringBuilder("Kinship - Reveal ").append(card.getLogName()).append('?').toString(), source, game)) { controller.revealCards(sourcePermanent.getName(), cards, game); for (Effect effect: kinshipEffects) { effect.setTargetPointer(new FixedTarget(card.getId())); diff --git a/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java b/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java index 80b1ec132b..430d82f3e8 100644 --- a/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ActivateIfConditionActivatedAbility.java @@ -92,7 +92,7 @@ public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl { !condition.toString().startsWith("before")) { sb.append("if "); } - sb.append(condition.toString()).append("."); + sb.append(condition.toString()).append('.'); } else { sb.append(" [Condition toSting() == null] "); } diff --git a/Mage/src/main/java/mage/abilities/common/ChancellorAbility.java b/Mage/src/main/java/mage/abilities/common/ChancellorAbility.java index 80e6c235b1..bfa5a4cd67 100644 --- a/Mage/src/main/java/mage/abilities/common/ChancellorAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ChancellorAbility.java @@ -70,7 +70,7 @@ public class ChancellorAbility extends StaticAbility implements OpeningHandActio @Override public boolean askUseOpeningHandAction(Card card, Player player, Game game) { - return player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getIdName() + "?", this, game); + return player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getIdName() + '?', this, game); } @Override diff --git a/Mage/src/main/java/mage/abilities/common/PutCardIntoGraveFromAnywhereAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/PutCardIntoGraveFromAnywhereAllTriggeredAbility.java index 0635847f29..048400d92d 100644 --- a/Mage/src/main/java/mage/abilities/common/PutCardIntoGraveFromAnywhereAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/PutCardIntoGraveFromAnywhereAllTriggeredAbility.java @@ -78,7 +78,7 @@ public class PutCardIntoGraveFromAnywhereAllTriggeredAbility extends TriggeredAb sb.append("your"); break; default: - sb.append("a"); + sb.append('a'); } sb.append(" graveyard, "); ruleText = sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromAnywhereSourceAbility.java b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromAnywhereSourceAbility.java index 4272b15086..4658bed21e 100644 --- a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromAnywhereSourceAbility.java +++ b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromAnywhereSourceAbility.java @@ -148,7 +148,7 @@ class PutIntoGraveFromAnywhereEffect extends ReplacementEffectImpl { if (controller == null || object == null) { return false; } - if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append("?").toString(), source, game)) { + if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append('?').toString(), source, game)) { return false; } } diff --git a/Mage/src/main/java/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java index 5451a2fda6..363962126b 100644 --- a/Mage/src/main/java/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java @@ -98,7 +98,7 @@ class PactEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)){ return true; diff --git a/Mage/src/main/java/mage/abilities/condition/common/CreatureCountCondition.java b/Mage/src/main/java/mage/abilities/condition/common/CreatureCountCondition.java index c4cfce4e97..89705f8e40 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/CreatureCountCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/CreatureCountCondition.java @@ -67,14 +67,14 @@ public class CreatureCountCondition implements Condition { case ANY: sb.append("if "); sb.append(creatureCount); - sb.append(" "); + sb.append(' '); sb.append(filter.getMessage()); sb.append(" are on the battlefield"); return sb.toString(); } sb.append(" control exactly "); sb.append(creatureCount); - sb.append(" "); + sb.append(' '); sb.append(filter.getMessage()); return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java b/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java index 65e1d4fabe..b6937c67a3 100644 --- a/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java +++ b/Mage/src/main/java/mage/abilities/costs/AlternativeCostSourceAbility.java @@ -160,7 +160,7 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter if (dynamicCost != null) { costChoiceText = dynamicCost.getText(ability, game); } else { - costChoiceText = alternativeCostsToCheck.isEmpty() ? "Cast without paying its mana cost?" : "Pay alternative costs? (" + alternativeCostsToCheck.getText() + ")"; + costChoiceText = alternativeCostsToCheck.isEmpty() ? "Cast without paying its mana cost?" : "Pay alternative costs? (" + alternativeCostsToCheck.getText() + ')'; } if (alternativeCostsToCheck.canPay(ability, ability.getSourceId(), ability.getControllerId(), game) @@ -263,9 +263,9 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter } else if (alternateCosts.isEmpty()) { sb.append("cast {this} without paying its mana cost"); } - sb.append("."); + sb.append('.'); if (numberCosts == 1 && remarkText != null) { - sb.append(" ").append(remarkText); + sb.append(' ').append(remarkText); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/costs/OrCost.java b/Mage/src/main/java/mage/abilities/costs/OrCost.java index a2bd70c0bb..0b921701c2 100644 --- a/Mage/src/main/java/mage/abilities/costs/OrCost.java +++ b/Mage/src/main/java/mage/abilities/costs/OrCost.java @@ -99,7 +99,7 @@ public class OrCost implements Cost { if (firstCost instanceof ManaCost) { sb.append("Pay "); } - sb.append(firstCost.getText()).append("?"); + sb.append(firstCost.getText()).append('?'); if (controller.chooseUse(Outcome.Detriment, sb.toString(), ability, game)) { selectedCost = firstCost; } else { diff --git a/Mage/src/main/java/mage/abilities/costs/common/DiscardXTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/DiscardXTargetCost.java index bd2fc1dd1b..51c084654b 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/DiscardXTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/DiscardXTargetCost.java @@ -52,7 +52,7 @@ public class DiscardXTargetCost extends VariableCostImpl { public DiscardXTargetCost(FilterCard filter, boolean additionalCostText) { super(new StringBuilder(filter.getMessage()).append(" to discard").toString()); this.text = new StringBuilder(additionalCostText ? "As an additional cost to cast {source}, discard ":"Discard ") - .append(xText).append(" ").append(filter.getMessage()).toString(); + .append(xText).append(' ').append(filter.getMessage()).toString(); this.filter = filter; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ExileFromGraveCost.java b/Mage/src/main/java/mage/abilities/costs/common/ExileFromGraveCost.java index 6e267bcc56..c639e0dc70 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ExileFromGraveCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ExileFromGraveCost.java @@ -59,7 +59,7 @@ public class ExileFromGraveCost extends CostImpl { + (target.getNumberOfTargets() == 1 && target.getMaxNumberOfTargets() == Integer.MAX_VALUE ? "one or more" : ((target.getNumberOfTargets() < target.getMaxNumberOfTargets() ? "up to " : "")) + CardUtil.numberToText(target.getMaxNumberOfTargets())) - + " " + target.getTargetName(); + + ' ' + target.getTargetName(); } else { this.text = "Exile " + target.getTargetName(); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ExileXFromYourGraveCost.java b/Mage/src/main/java/mage/abilities/costs/common/ExileXFromYourGraveCost.java index e3c070c1b7..317b5e45ac 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ExileXFromYourGraveCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ExileXFromYourGraveCost.java @@ -50,7 +50,7 @@ public class ExileXFromYourGraveCost extends VariableCostImpl { public ExileXFromYourGraveCost(FilterCard filter, boolean additionalCostText) { super(filter.getMessage() + " to exile"); this.filter = filter; - this.text = (additionalCostText ? "As an additional cost to cast {source}, exile " : "Exile ") + xText + " " + filter.getMessage(); + this.text = (additionalCostText ? "As an additional cost to cast {source}, exile " : "Exile ") + xText + ' ' + filter.getMessage(); } public ExileXFromYourGraveCost(final ExileXFromYourGraveCost cost) { diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java index 9944d89abc..64945cb846 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayLoyaltyCost.java @@ -47,7 +47,7 @@ public class PayLoyaltyCost extends CostImpl { this.amount = amount; this.text = Integer.toString(amount); if (amount >= 0) { - this.text = "+" + this.text; + this.text = '+' + this.text; } } diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java index 5fb4cea23c..5577627230 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java @@ -48,7 +48,7 @@ public class PayVariableLifeCost extends VariableCostImpl { public PayVariableLifeCost(boolean additionalCostText) { super("life to pay"); this.text = new StringBuilder(additionalCostText ? "As an additional cost to cast {source}, pay ":"Pay ") - .append(xText).append(" ").append("life").toString(); + .append(xText).append(' ').append("life").toString(); } public PayVariableLifeCost(final PayVariableLifeCost cost) { diff --git a/Mage/src/main/java/mage/abilities/costs/common/PutCountersSourceCost.java b/Mage/src/main/java/mage/abilities/costs/common/PutCountersSourceCost.java index b5d98d44f1..336dddaabb 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PutCountersSourceCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PutCountersSourceCost.java @@ -51,7 +51,7 @@ public class PutCountersSourceCost extends CostImpl { this.amount = counter.getCount(); this.name = counter.getName(); this.text = new StringBuilder("Put ").append((amount == 1 ? "a" : CardUtil.numberToText(amount))) - .append(" ").append(name).append(" counter").append((amount != 1 ? "s" : "")) + .append(' ').append(name).append(" counter").append((amount != 1 ? "s" : "")) .append(" on {this}").toString(); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/RemoveCounterCost.java b/Mage/src/main/java/mage/abilities/costs/common/RemoveCounterCost.java index 100beada6c..f24a5dbf47 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/RemoveCounterCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/RemoveCounterCost.java @@ -133,7 +133,7 @@ public class RemoveCounterCost extends CostImpl { countersRemoved += numberOfCountersSelected; if (!game.isSimulation()) { game.informPlayers(new StringBuilder(controller.getLogName()) - .append(" removes ").append(numberOfCountersSelected == 1 ? "a" : numberOfCountersSelected).append(" ") + .append(" removes ").append(numberOfCountersSelected == 1 ? "a" : numberOfCountersSelected).append(' ') .append(counterName).append(numberOfCountersSelected == 1 ? " counter from " : " counters from ") .append(permanent.getName()).toString()); } @@ -158,7 +158,7 @@ public class RemoveCounterCost extends CostImpl { private String setText() { StringBuilder sb = new StringBuilder("Remove "); - sb.append(CardUtil.numberToText(countersToRemove, "a")).append(" "); + sb.append(CardUtil.numberToText(countersToRemove, "a")).append(' '); if (counterTypeToRemove != null) { sb.append(counterTypeToRemove.getName()); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/RemoveCountersSourceCost.java b/Mage/src/main/java/mage/abilities/costs/common/RemoveCountersSourceCost.java index 66b8f49efa..44677e4c90 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/RemoveCountersSourceCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/RemoveCountersSourceCost.java @@ -50,7 +50,7 @@ public class RemoveCountersSourceCost extends CostImpl { this.amount = counter.getCount(); this.name = counter.getName(); this.text = new StringBuilder("Remove ").append((amount == 1 ? "a" : CardUtil.numberToText(amount))) - .append(" ").append(name).append(" counter").append((amount != 1 ? "s" : "")) + .append(' ').append(name).append(" counter").append((amount != 1 ? "s" : "")) .append(" from {this}").toString(); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/RemoveVariableCountersTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/RemoveVariableCountersTargetCost.java index bb5160b012..5bdc1966e9 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/RemoveVariableCountersTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/RemoveVariableCountersTargetCost.java @@ -58,7 +58,7 @@ public class RemoveVariableCountersTargetCost extends VariableCostImpl { } public RemoveVariableCountersTargetCost(FilterPermanent filter, CounterType counterTypeToRemove, String xText, int minValue) { - super(xText, new StringBuilder(counterTypeToRemove != null ? counterTypeToRemove.getName() + " ":"").append("counters to remove").toString()); + super(xText, new StringBuilder(counterTypeToRemove != null ? counterTypeToRemove.getName() + ' ' :"").append("counters to remove").toString()); this.filter = filter; this.counterTypeToRemove = counterTypeToRemove; this.text = setText(); @@ -79,7 +79,7 @@ public class RemoveVariableCountersTargetCost extends VariableCostImpl { private String setText() { StringBuilder sb = new StringBuilder("Remove ").append(xText); if (counterTypeToRemove != null) { - sb.append(" ").append(counterTypeToRemove.getName()); + sb.append(' ').append(counterTypeToRemove.getName()); } sb.append(" counters from among ").append(filter.getMessage()); return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java b/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java index a0144cb7ec..df84b8d1f4 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java @@ -52,7 +52,7 @@ public class ReturnToHandChosenControlledPermanentCost extends CostImpl { target.setNotTarget(true); this.addTarget(target); if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { - this.text = "return " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + " " + target.getTargetName() + " you control to their owner's hand"; + this.text = "return " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + ' ' + target.getTargetName() + " you control to their owner's hand"; } else { this.text = "return " + target.getTargetName() + " you control to its owner's hand"; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java b/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java index 767d60cb32..e792c2d66f 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ReturnToHandFromGraveyardCost.java @@ -49,7 +49,7 @@ public class ReturnToHandFromGraveyardCost extends CostImpl { public ReturnToHandFromGraveyardCost(TargetCardInYourGraveyard target) { this.addTarget(target); if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { - this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(" ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString(); + this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(' ').append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString(); } else { this.text = new StringBuilder("return ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString(); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/SacrificeXTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/SacrificeXTargetCost.java index 7a5a26312d..e83014b796 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/SacrificeXTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/SacrificeXTargetCost.java @@ -48,7 +48,7 @@ public class SacrificeXTargetCost extends VariableCostImpl { public SacrificeXTargetCost(FilterControlledPermanent filter, boolean additionalCostText) { super(filter.getMessage() + " to sacrifice"); - this.text = (additionalCostText ? "As an additional cost to cast {source}, sacrifice " : "Sacrifice ") + xText + " " + filter.getMessage(); + this.text = (additionalCostText ? "As an additional cost to cast {source}, sacrifice " : "Sacrifice ") + xText + ' ' + filter.getMessage(); this.filter = filter; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/TapTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/TapTargetCost.java index 7f6eedbd10..ef095d353c 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/TapTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/TapTargetCost.java @@ -51,7 +51,7 @@ public class TapTargetCost extends CostImpl { this.text = new StringBuilder("Tap ") .append((target.getTargetName().startsWith("a ") || target.getTargetName().startsWith("an ") || target.getTargetName().startsWith("another")) - ? "" : CardUtil.numberToText(target.getMaxNumberOfTargets()) + " ") + ? "" : CardUtil.numberToText(target.getMaxNumberOfTargets()) + ' ') .append(target.getTargetName()).toString(); } diff --git a/Mage/src/main/java/mage/abilities/costs/common/TapVariableTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/TapVariableTargetCost.java index 7da86d69f6..5f2bc10650 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/TapVariableTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/TapVariableTargetCost.java @@ -51,7 +51,7 @@ public class TapVariableTargetCost extends VariableCostImpl { super(xText, new StringBuilder(filter.getMessage()).append(" to tap").toString()); this.filter = filter; this.text = new StringBuilder(additionalCostText ? "As an additional cost to cast {source}, tap ":"Tap ") - .append(this.xText).append(" ").append(filter.getMessage()).toString(); + .append(this.xText).append(' ').append(filter.getMessage()).toString(); } public TapVariableTargetCost(final TapVariableTargetCost cost) { diff --git a/Mage/src/main/java/mage/abilities/costs/common/UntapTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/UntapTargetCost.java index e0609fa9d9..6f58c745bd 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/UntapTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/UntapTargetCost.java @@ -49,7 +49,7 @@ public class UntapTargetCost extends CostImpl { public UntapTargetCost(TargetControlledPermanent target) { this.target = target; - this.text = "Untap " + target.getMaxNumberOfTargets() + " " + target.getTargetName(); + this.text = "Untap " + target.getMaxNumberOfTargets() + ' ' + target.getTargetName(); } public UntapTargetCost(final UntapTargetCost cost) { diff --git a/Mage/src/main/java/mage/abilities/costs/mana/ColoredManaCost.java b/Mage/src/main/java/mage/abilities/costs/mana/ColoredManaCost.java index e100bcc223..14ef126220 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/ColoredManaCost.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/ColoredManaCost.java @@ -69,7 +69,7 @@ public class ColoredManaCost extends ManaCostImpl { @Override public String getText() { - return "{" + mana.toString() + "}"; + return '{' + mana.toString() + '}'; } @Override diff --git a/Mage/src/main/java/mage/abilities/costs/mana/GenericManaCost.java b/Mage/src/main/java/mage/abilities/costs/mana/GenericManaCost.java index 32708f1a8e..102da50b9e 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/GenericManaCost.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/GenericManaCost.java @@ -73,7 +73,7 @@ public class GenericManaCost extends ManaCostImpl { @Override public String getText() { - return "{" + Integer.toString(mana) + "}"; + return '{' + Integer.toString(mana) + '}'; } @Override diff --git a/Mage/src/main/java/mage/abilities/costs/mana/HybridManaCost.java b/Mage/src/main/java/mage/abilities/costs/mana/HybridManaCost.java index ae57cd25c1..183150ecdd 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/HybridManaCost.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/HybridManaCost.java @@ -76,7 +76,7 @@ public class HybridManaCost extends ManaCostImpl { @Override public String getText() { - return "{" + mana1.toString() + "/" + mana2.toString() + "}"; + return '{' + mana1.toString() + '/' + mana2.toString() + '}'; } @Override diff --git a/Mage/src/main/java/mage/abilities/costs/mana/MonoHybridManaCost.java b/Mage/src/main/java/mage/abilities/costs/mana/MonoHybridManaCost.java index d02227d18b..e6571177bc 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/MonoHybridManaCost.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/MonoHybridManaCost.java @@ -77,7 +77,7 @@ public class MonoHybridManaCost extends ManaCostImpl { @Override public String getText() { - return "{2/" + mana.toString() + "}"; + return "{2/" + mana.toString() + '}'; } @Override diff --git a/Mage/src/main/java/mage/abilities/costs/mana/PhyrexianManaCost.java b/Mage/src/main/java/mage/abilities/costs/mana/PhyrexianManaCost.java index 885d9cf88b..703f61ddff 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/PhyrexianManaCost.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/PhyrexianManaCost.java @@ -57,7 +57,7 @@ public class PhyrexianManaCost extends ColoredManaCost { @Override public String getText() { - return "{" + mana.toString() + "P}"; + return '{' + mana.toString() + "P}"; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java index 70133b75d0..4903c8e82f 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java @@ -71,7 +71,7 @@ public class ParleyCount implements DynamicValue, MageSingleton { if (!card.getCardType().contains(CardType.LAND)) { parleyValue++; } - player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", new CardsImpl(card), game); + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', new CardsImpl(card), game); } } diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SignInversionDynamicValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SignInversionDynamicValue.java index 030870ebca..6f630c4861 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SignInversionDynamicValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SignInversionDynamicValue.java @@ -29,7 +29,7 @@ public class SignInversionDynamicValue implements DynamicValue { @Override public String toString() { - return "-" + value.toString(); + return '-' + value.toString(); } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java b/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java index 8386f2cef7..71d1e22817 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java @@ -85,7 +85,7 @@ public class AsTurnedFaceUpEffect extends ReplacementEffectImpl { if (controller == null || object == null) { return false; } - if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append("?").toString(), source, game)) { + if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append('?').toString(), source, game)) { return false; } } diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java index d78dea4be7..3450de2385 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java @@ -1234,9 +1234,9 @@ public class ContinuousEffects implements Serializable { for (Ability ability : entry.getValue()) { MageObject object = game.getObject(ability.getSourceId()); if (object != null) { - texts.put(ability.getId().toString() + "_" + entry.getKey().getId().toString(), object.getName() + ": " + ability.getRule(object.getName())); + texts.put(ability.getId().toString() + '_' + entry.getKey().getId().toString(), object.getName() + ": " + ability.getRule(object.getName())); } else { - texts.put(ability.getId().toString() + "_" + entry.getKey().getId().toString(), entry.getKey().getText(null)); + texts.put(ability.getId().toString() + '_' + entry.getKey().getId().toString(), entry.getKey().getText(null)); } } } else { diff --git a/Mage/src/main/java/mage/abilities/effects/Effects.java b/Mage/src/main/java/mage/abilities/effects/Effects.java index 9f207eeeca..f479863bfb 100644 --- a/Mage/src/main/java/mage/abilities/effects/Effects.java +++ b/Mage/src/main/java/mage/abilities/effects/Effects.java @@ -90,7 +90,7 @@ public class Effects extends ArrayList { !lastRule.startsWith("Level ") && !lastRule.endsWith(".)") && !lastRule.endsWith("") ) { - sbText.append("."); + sbText.append('.'); } return sbText.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/EntersBattlefieldEffect.java b/Mage/src/main/java/mage/abilities/effects/EntersBattlefieldEffect.java index 37589a698c..320ddaa08b 100644 --- a/Mage/src/main/java/mage/abilities/effects/EntersBattlefieldEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/EntersBattlefieldEffect.java @@ -129,7 +129,7 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl { if (controller == null || object == null) { return false; } - if (!controller.chooseUse(outcome, "Use effect of " + object.getLogName() + "?", source, game)) { + if (!controller.chooseUse(outcome, "Use effect of " + object.getLogName() + '?', source, game)) { return false; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java b/Mage/src/main/java/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java index 722fc0468d..72fae649de 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java @@ -134,7 +134,7 @@ public class AddManaInAnyCombinationEffect extends ManaEffect { if (i > 1) { sb.append(" and/or "); } - sb.append("{").append(coloredManaSymbol.toString()).append("}"); + sb.append('{').append(coloredManaSymbol.toString()).append('}'); } } sb.append(" to your mana pool"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedSourceEffect.java index 79f43448c9..34d107f71b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedSourceEffect.java @@ -78,11 +78,11 @@ public class CantBeRegeneratedSourceEffect extends ContinuousRuleModifyingEffect StringBuilder sb = new StringBuilder(); sb.append(" {this} can't be regenerated"); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append(" this turn"); } else { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedTargetEffect.java index d3720acb40..a5cb7335c2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeRegeneratedTargetEffect.java @@ -81,11 +81,11 @@ public class CantBeRegeneratedTargetEffect extends ContinuousRuleModifyingEffect } sb.append(" can't be regenerated"); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append(" this turn"); } else { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAllEffect.java index 40635ee0c3..29b32ee2d0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAllEffect.java @@ -118,7 +118,7 @@ public class CantBeTargetedAllEffect extends ContinuousRuleModifyingEffectImpl { sb.append("spells"); } if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java index c1bc1edec5..e4d0498e14 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java @@ -117,7 +117,7 @@ public class CantBeTargetedAttachedEffect extends ContinuousRuleModifyingEffectI sb.append(" can't be the target of "); sb.append(filterSource.getMessage()); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedSourceEffect.java index 2a09645f96..8c5744862a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedSourceEffect.java @@ -94,7 +94,7 @@ public class CantBeTargetedSourceEffect extends ContinuousRuleModifyingEffectImp StringBuilder sb = new StringBuilder(); sb.append("{this} can't be the target of "); sb.append(filterSource.getMessage()); - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedTargetEffect.java index 9e10bde4cb..977c48a5d4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CantBeTargetedTargetEffect.java @@ -114,7 +114,7 @@ public class CantBeTargetedTargetEffect extends ContinuousRuleModifyingEffectImp sb.append(" can't be the target of "); sb.append(filterSource.getMessage()); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java index 8884c6c141..4354f0904d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java @@ -83,7 +83,7 @@ public class ChangeATargetOfTargetSpellAbilityToSourceEffect extends OneShotEffe if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { validTargets = true; if (name != null - && controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + && controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + '?', source, game)) { oldTargetName = getTargetName(targetId, game); target.remove(targetId); // The source is still the spell on the stack @@ -97,7 +97,7 @@ public class ChangeATargetOfTargetSpellAbilityToSourceEffect extends OneShotEffe } } if (oldTargetName == null) { - game.informPlayer(controller, "You have to select at least one target to change to " + sourceObject.getIdName() + "!"); + game.informPlayer(controller, "You have to select at least one target to change to " + sourceObject.getIdName() + '!'); } } while (validTargets && oldTargetName == null); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java index 0d42a86272..44db56cada 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java @@ -134,7 +134,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton { cards.add(cardController); controller.revealCards(sourceObject.getIdName() + ": Clash card of " + controller.getName(), cards, game); cmcController = cardController.getConvertedManaCost(); - message.append(" (").append(cmcController).append(")"); + message.append(" (").append(cmcController).append(')'); } else { message.append(" no card"); } @@ -145,7 +145,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton { cards.add(cardOpponent); opponent.revealCards(sourceObject.getIdName() + ": Clash card of " + opponent.getName(), cards, game); cmcOpponent = cardOpponent.getConvertedManaCost(); - message.append(" (").append(cmcOpponent).append(")"); + message.append(" (").append(cmcOpponent).append(')'); } else { message.append(" no card"); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopySpellForEachItCouldTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopySpellForEachItCouldTargetEffect.java index 9fa78743ac..955ed8c3c4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopySpellForEachItCouldTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopySpellForEachItCouldTargetEffect.java @@ -466,11 +466,11 @@ class TargetWithAdditionalFilter extends TargetImpl { for (UUID targetId : getTargets()) { MageObject object = game.getObject(targetId); if (object != null) { - sb.append(object.getLogName()).append(" "); + sb.append(object.getLogName()).append(' '); } else { Player player = game.getPlayer(targetId); if (player != null) { - sb.append(player.getLogName()).append(" "); + sb.append(player.getLogName()).append(' '); } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CouncilsDilemmaVoteEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CouncilsDilemmaVoteEffect.java index 3402df0a00..f80cff7c1a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CouncilsDilemmaVoteEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CouncilsDilemmaVoteEffect.java @@ -55,7 +55,7 @@ public abstract class CouncilsDilemmaVoteEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + "?", source, game)) { + if (player.chooseUse(Outcome.Vote, "Choose " + choiceOne + '?', source, game)) { voteOneCount++; game.informPlayers(player.getName() + " has voted for " + choiceOne); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java index 422b4ec0fa..28a8e93b1c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java @@ -118,7 +118,7 @@ public class CreateTokenEffect extends OneShotEffect { } sb.append(token.getDescription()); } else { - sb.append(CardUtil.numberToText(amount.toString())).append(" "); + sb.append(CardUtil.numberToText(amount.toString())).append(' '); if (tapped && !attacking) { sb.append("tapped "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenTargetEffect.java index 0132ebf36b..5243e83300 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenTargetEffect.java @@ -69,7 +69,7 @@ public class CreateTokenTargetEffect extends OneShotEffect { } StringBuilder sb = new StringBuilder("put "); sb.append(CardUtil.numberToText(amount.toString(), "a")); - sb.append(" ").append(token.getDescription()).append(" onto the battlefield"); + sb.append(' ').append(token.getDescription()).append(" onto the battlefield"); if (tapped) { sb.append(" tapped"); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DestroyMultiTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DestroyMultiTargetEffect.java index 6be73a2eb9..b275b2f96a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DestroyMultiTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DestroyMultiTargetEffect.java @@ -87,7 +87,7 @@ public class DestroyMultiTargetEffect extends OneShotEffect { while (iterator.hasNext()) { Target target = iterator.next(); if (target.getNumberOfTargets() > 1) { - sb.append(target.getNumberOfTargets()).append(" "); + sb.append(target.getNumberOfTargets()).append(' '); } sb.append("target ").append(target.getTargetName()); if (iterator.hasNext()) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java index 6edef3c794..cc27e9ca5c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java @@ -59,7 +59,7 @@ public class DoIfCostPaid extends OneShotEffect { if (effectText.length() > 0 && effectText.charAt(effectText.length() - 1) == '.') { effectText = effectText.substring(0, effectText.length() - 1); } - message = getCostText() + " and " + effectText + "?"; + message = getCostText() + " and " + effectText + '?'; message = Character.toUpperCase(message.charAt(0)) + message.substring(1); } else { message = chooseUseText; diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java index 98973401bd..666aa0a08b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java @@ -37,7 +37,7 @@ public class DontUntapInControllersNextUntapStepSourceEffect extends ContinuousR public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "{this} doesn't untap (" + mageObject.getLogName() + ")"; + return "{this} doesn't untap (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java index f59773e1e4..d77a8abdb9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java @@ -100,7 +100,7 @@ public class DontUntapInControllersNextUntapStepTargetEffect extends ContinuousR MageObject mageObject = game.getObject(source.getSourceId()); Permanent permanentToUntap = game.getPermanent((event.getTargetId())); if (permanentToUntap != null && mageObject != null) { - return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ")"; + return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java index 1919824f29..f259f9568d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java @@ -43,7 +43,7 @@ public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRu if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); if (enchanted != null) { - return enchanted.getLogName() + " doesn't untap during its controller's untap step (" + enchantment.getLogName() + ")"; + return enchanted.getLogName() + " doesn't untap during its controller's untap step (" + enchantment.getLogName() + ')'; } } return null; diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java index 3eac0bd7e0..69118f2ac1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java @@ -69,7 +69,7 @@ public class DontUntapInControllersUntapStepTargetEffect extends ContinuousRuleM MageObject mageObject = game.getObject(source.getSourceId()); Permanent permanentToUntap = game.getPermanent((event.getTargetId())); if (permanentToUntap != null && mageObject != null) { - return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ")"; + return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInOpponentsNextUntapStepAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInOpponentsNextUntapStepAllEffect.java index 2a20c30e91..53a627a1d9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInOpponentsNextUntapStepAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInOpponentsNextUntapStepAllEffect.java @@ -85,7 +85,7 @@ public class DontUntapInOpponentsNextUntapStepAllEffect extends ContinuousRuleMo MageObject mageObject = game.getObject(source.getSourceId()); Permanent permanentToUntap = game.getPermanent((event.getTargetId())); if (permanentToUntap != null && mageObject != null) { - return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ")"; + return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ')'; } return null; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java index 2a152eebc1..62da3f0a0d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawCardSourceControllerEffect.java @@ -80,7 +80,7 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { || amount instanceof PermanentsOnBattlefieldCount || amount.toString().equals("1"); sb.append("draw ").append(oneCard ? "a" : CardUtil.numberToText(amount.toString())).append(" card"); if (!oneCard) { - sb.append("s"); + sb.append('s'); } String message = amount.getMessage(); if (message.length() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java index 76558defd9..ae0c85ec39 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -130,10 +130,10 @@ public class DrawCardTargetEffect extends OneShotEffect { sb.append(CardUtil.numberToText(amount.toString(), "a")).append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { - sb.append("s"); + sb.append('s'); } } catch (Exception e) { - sb.append("s"); + sb.append('s'); } String message = amount.getMessage(); if (message.length() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java b/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java index a695f7a936..87ddd2f748 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java @@ -100,7 +100,7 @@ class EpicReplacementEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "For the rest of the game, you can't cast spells (Epic - " + mageObject.getName() + ")"; + return "For the rest of the game, you can't cast spells (Epic - " + mageObject.getName() + ')'; } return null; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileCardYouChooseTargetOpponentEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileCardYouChooseTargetOpponentEffect.java index 5517e52b38..dc0d697844 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileCardYouChooseTargetOpponentEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileCardYouChooseTargetOpponentEffect.java @@ -68,7 +68,7 @@ public class ExileCardYouChooseTargetOpponentEffect extends OneShotEffect { Card sourceCard = game.getCard(source.getSourceId()); if (controller != null && opponent != null) { if (!opponent.getHand().isEmpty()) { - opponent.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ")" : "Exile", opponent.getHand(), game); + opponent.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ')' : "Exile", opponent.getHand(), game); TargetCard target = new TargetCard(Zone.HAND, filter); if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) { Card card = opponent.getHand().get(target.getFirstTarget(), game); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileFromZoneTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileFromZoneTargetEffect.java index 97ecc487a0..4ff7097f65 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileFromZoneTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileFromZoneTargetEffect.java @@ -106,6 +106,6 @@ public class ExileFromZoneTargetEffect extends OneShotEffect { } private void setText() { - staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + " " + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(); + staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + ' ' + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileSourceUnlessPaysEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileSourceUnlessPaysEffect.java index f6043e913f..1b10a2c554 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileSourceUnlessPaysEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileSourceUnlessPaysEffect.java @@ -60,7 +60,7 @@ public class ExileSourceUnlessPaysEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { - StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + StringBuilder sb = new StringBuilder(cost.getText()).append('?'); if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { sb.insert(0, "Pay "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/GainLifeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/GainLifeEffect.java index c01b6923cf..af86ff288c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/GainLifeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/GainLifeEffect.java @@ -87,9 +87,9 @@ public class GainLifeEffect extends OneShotEffect { String message = life.getMessage(); sb.append("you gain "); if (message.startsWith("that")) { - sb.append(message).append(" "); + sb.append(message).append(' '); } else if (message.isEmpty() || !message.equals("1")) { - sb.append(life).append(" "); + sb.append(life).append(' '); } sb.append("life"); if (message.length() > 0 && !message.startsWith("that")) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/GainLifeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/GainLifeTargetEffect.java index e51c820b5e..3e965d01ee 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/GainLifeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/GainLifeTargetEffect.java @@ -92,7 +92,7 @@ public class GainLifeTargetEffect extends OneShotEffect { } sb.append(" gains "); if (message.isEmpty() || !message.equals("1")) { - sb.append(life.toString()).append(" "); + sb.append(life.toString()).append(' '); } sb.append("life"); if (message.length() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/GetEmblemEffect.java b/Mage/src/main/java/mage/abilities/effects/common/GetEmblemEffect.java index cd7c4dd6b3..796fb67700 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/GetEmblemEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/GetEmblemEffect.java @@ -45,7 +45,7 @@ public class GetEmblemEffect extends OneShotEffect { public GetEmblemEffect(Emblem emblem) { super(Outcome.Benefit); this.emblem = emblem; - this.staticText = "You get an emblem with \"" + emblem.getAbilities().getRules(null) + "\""; + this.staticText = "You get an emblem with \"" + emblem.getAbilities().getRules(null) + '"'; } public GetEmblemEffect(final GetEmblemEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/GetEmblemTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/GetEmblemTargetPlayerEffect.java index 7f5daf3849..7c274efee2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/GetEmblemTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/GetEmblemTargetPlayerEffect.java @@ -79,6 +79,6 @@ public class GetEmblemTargetPlayerEffect extends OneShotEffect { if (staticText != null && !staticText.isEmpty()) { return staticText; } - return "Target " + mode.getTargets().get(0).getTargetName() + " gets an emblem with \"" + emblem.getAbilities().getRules(null) + "\""; + return "Target " + mode.getTargets().get(0).getTargetName() + " gets an emblem with \"" + emblem.getAbilities().getRules(null) + '"'; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index b8b7167858..0d1c9dda85 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -222,7 +222,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff sb.append("put ").append(filter.getMessage()).append(" into your graveyard"); break; } - return sb.append("?").toString(); + return sb.append('?').toString(); } private String getPickText() { diff --git a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java index f63c0f5011..7537b12f15 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeOpponentsEffect.java @@ -84,7 +84,7 @@ public class LoseLifeOpponentsEffect extends OneShotEffect { sb.append("each opponent loses "); if (message.isEmpty() || !message.equals("1")) { - sb.append(amount).append(" "); + sb.append(amount).append(' '); } sb.append("life"); if (message.length() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeTargetEffect.java index 38164b67db..2909da13cb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LoseLifeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LoseLifeTargetEffect.java @@ -88,7 +88,7 @@ public class LoseLifeTargetEffect extends OneShotEffect { } sb.append(" loses "); if (message.isEmpty() || !message.equals("1")) { - sb.append(amount).append(" "); + sb.append(amount).append(' '); } sb.append("life"); if (message.length() > 0) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java b/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java index dccac2abdc..3559542e8b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java @@ -108,7 +108,7 @@ public class NameACardEffect extends OneShotEffect { } String cardName = cardChoice.getChoice(); if (!game.isSimulation()) { - game.informPlayers(sourceObject.getLogName() + ", named card: [" + cardName + "]"); + game.informPlayers(sourceObject.getLogName() + ", named card: [" + cardName + ']'); } game.getState().setValue(source.getSourceId().toString() + INFO_KEY, cardName); if (sourceObject instanceof Permanent) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToAllEffect.java index 6fe9320041..b57ae00a4b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToAllEffect.java @@ -64,7 +64,7 @@ public class PreventAllDamageToAllEffect extends PreventionEffectImpl { + (onlyCombat ? "combat ":"") + "damage that would be dealt to " + filter.getMessage() - + (duration.toString().isEmpty() ?"": " "+ duration.toString()); + + (duration.toString().isEmpty() ?"": ' ' + duration.toString()); } public PreventAllDamageToAllEffect(final PreventAllDamageToAllEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java index e17d8dafaf..7a3ef9802b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventAllNonCombatDamageToAllEffect.java @@ -49,7 +49,7 @@ public class PreventAllNonCombatDamageToAllEffect extends PreventionEffectImpl { public PreventAllNonCombatDamageToAllEffect(Duration duration, FilterInPlay filter) { super(duration, Integer.MAX_VALUE, false); this.filter = filter; - staticText = "Prevent all non combat damage that would be dealt to " + filter.getMessage() + " " + duration.toString(); + staticText = "Prevent all non combat damage that would be dealt to " + filter.getMessage() + ' ' + duration.toString(); } public PreventAllNonCombatDamageToAllEffect(final PreventAllNonCombatDamageToAllEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToControllerEffect.java index 92ae7dcf75..a3a87151d1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToControllerEffect.java @@ -80,9 +80,9 @@ public class PreventDamageToControllerEffect extends PreventionEffectImpl { if (amountToPrevent == Integer.MAX_VALUE) { sb.append("all "); } else if (amountToPreventDynamic != null) { - sb.append("the next ").append(amountToPreventDynamic.toString()).append(" "); + sb.append("the next ").append(amountToPreventDynamic.toString()).append(' '); } else { - sb.append("the next ").append(amountToPrevent).append(" "); + sb.append("the next ").append(amountToPrevent).append(' '); } if (onlyCombat) { sb.append("combat "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToTargetEffect.java index c6aacddc43..6b651aa8e0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageToTargetEffect.java @@ -89,7 +89,7 @@ public class PreventDamageToTargetEffect extends PreventionEffectImpl { } sb.append(mode.getTargets().get(0).getTargetName()); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java index d5638262ca..0b71592368 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PutOnLibraryTargetEffect.java @@ -155,7 +155,7 @@ public class PutOnLibraryTargetEffect extends OneShotEffect { if (target.getMaxNumberOfTargets() > target.getNumberOfTargets()) { sb.append("up to "); } - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); } sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" on "); sb.append(onTop ? "top" : "the bottom").append(" of its owner's library"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java index cc449d0cec..90516fa4ff 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java @@ -97,7 +97,7 @@ public class ReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEffect if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) { sb.append("up to "); } - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); } sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" to the battlefield"); if (tapped) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java index fdd5ad5cf3..a78bd5c6b5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java @@ -78,7 +78,7 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect { if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) { sb.append("up to "); } - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); } if (!mode.getTargets().get(0).getTargetName().startsWith("another")) { sb.append("target "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenControlledPermanentEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenControlledPermanentEffect.java index 3d7d07cd2e..6a6949d37e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenControlledPermanentEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenControlledPermanentEffect.java @@ -68,7 +68,7 @@ public class ReturnToHandChosenControlledPermanentEffect extends ReturnToHandCho if (!filter.getMessage().startsWith("another")) { sb.append(CardUtil.numberToText(number, "a")); } - sb.append(" ").append(filter.getMessage()); + sb.append(' ').append(filter.getMessage()); if (number > 1) { sb.append(" to their owner's hand"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenPermanentEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenPermanentEffect.java index ccb9e97478..86538efe0b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenPermanentEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandChosenPermanentEffect.java @@ -90,7 +90,7 @@ public class ReturnToHandChosenPermanentEffect extends OneShotEffect { if (!filter.getMessage().startsWith("another")) { sb.append(CardUtil.numberToText(number, "a")); } - sb.append(" ").append(filter.getMessage()); + sb.append(' ').append(filter.getMessage()); sb.append(" he or she controls"); if (number > 1) { sb.append(" to their owner's hand"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java index 5e85cdfac7..2ab4c45591 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandTargetEffect.java @@ -110,7 +110,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect { return sb.toString(); } else { if (target.getNumberOfTargets() > 1) { - sb.append(CardUtil.numberToText(target.getNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getNumberOfTargets())).append(' '); } if (!target.getTargetName().startsWith("another")) { sb.append("target "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeAllEffect.java index b58d273475..84377c93b3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeAllEffect.java @@ -115,7 +115,7 @@ public class SacrificeAllEffect extends OneShotEffect { } else { sb.append(CardUtil.numberToText(amount.toString(), "a")); } - sb.append(" "); + sb.append(' '); sb.append(filter.getMessage()); staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeEffect.java index a821c35458..6950c5d43e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeEffect.java @@ -130,7 +130,7 @@ public class SacrificeEffect extends OneShotEffect{ sb.append(" sacrifice "); } } - sb.append(CardUtil.numberToText(count.toString(), "a")).append(" "); + sb.append(CardUtil.numberToText(count.toString(), "a")).append(' '); sb.append(filter.getMessage()); staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsEffect.java index 5cdc5da396..147df3a392 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsEffect.java @@ -114,13 +114,13 @@ public class SacrificeOpponentsEffect extends OneShotEffect { } else { if (amount.toString().equals("1")) { if (!filter.getMessage().startsWith("a ") && !filter.getMessage().startsWith("an ")) { - sb.append("a"); + sb.append('a'); } } else { sb.append(CardUtil.numberToText(amount.toString())); } } - sb.append(" "); + sb.append(' '); sb.append(filter.getMessage()); staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java index 1b6ccbcdaf..5c891be7df 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeOpponentsUnlessPayEffect.java @@ -189,14 +189,14 @@ public class SacrificeOpponentsUnlessPayEffect extends OneShotEffect{ } else { if (amount.toString().equals("1")) { if (!filter.getMessage().startsWith("a ") && !filter.getMessage().startsWith("an ")) { - sb.append("a"); + sb.append('a'); } } else { sb.append(CardUtil.numberToText(amount.toString())); } } - sb.append(" "); + sb.append(' '); sb.append(filter.getMessage()); sb.append(" unless he or she pays "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java index 3b8afb7944..e9990d91b1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java @@ -33,7 +33,7 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { - StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + StringBuilder sb = new StringBuilder(cost.getText()).append('?'); if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { sb.insert(0, "Pay "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java index dc98024dd9..f12a191f58 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SkipUntapOptionalSourceEffect.java @@ -60,7 +60,7 @@ public class SkipUntapOptionalSourceEffect extends RestrictionEffect { @Override public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { Player player = game.getPlayer(permanent.getControllerId()); - return player != null && player.chooseUse(Outcome.Benefit, "Untap " + permanent.getLogName() + "?", source, game); + return player != null && player.chooseUse(Outcome.Benefit, "Untap " + permanent.getLogName() + '?', source, game); } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/TapTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/TapTargetEffect.java index efc2b9321d..d92c01d4c7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/TapTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/TapTargetEffect.java @@ -83,9 +83,9 @@ public class TapTargetEffect extends OneShotEffect { Target target = mode.getTargets().get(0); if (target.getMaxNumberOfTargets() > 1) { if (target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { - return "tap " + CardUtil.numberToText(target.getNumberOfTargets()) + " target " + target.getTargetName() + "s"; + return "tap " + CardUtil.numberToText(target.getNumberOfTargets()) + " target " + target.getTargetName() + 's'; } else { - return "tap up to " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + " target " + target.getTargetName() + "s"; + return "tap up to " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + " target " + target.getTargetName() + 's'; } } else if (target.getMaxNumberOfTargets() == 0){ return "tap X target " + mode.getTargets().get(0).getTargetName(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java index 1347aeaeb1..57d5a9bbc0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/UntapTargetEffect.java @@ -81,7 +81,7 @@ public class UntapTargetEffect extends OneShotEffect { } if (target.getMaxNumberOfTargets() > 1 || target.getNumberOfTargets() == 0) { - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append("s"); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append('s'); } else { if (!target.getTargetName().startsWith("another")) { sb.append("target "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java b/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java index 05208eb958..e18709fa15 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/WishEffect.java @@ -101,7 +101,7 @@ public class WishEffect extends OneShotEffect { List exile = game.getExile().getAllCards(game); boolean noTargets = cards.isEmpty() && (alsoFromExile ? exile.isEmpty() : true); if (noTargets) { - game.informPlayer(controller, "You have no cards outside the game" + (alsoFromExile ? " or in exile" : "") + "."); + game.informPlayer(controller, "You have no cards outside the game" + (alsoFromExile ? " or in exile" : "") + '.'); return true; } @@ -118,7 +118,7 @@ public class WishEffect extends OneShotEffect { } } if (filteredCards.isEmpty()) { - game.informPlayer(controller, "You don't have " + filter.getMessage() + " outside the game" + (alsoFromExile ? " or in exile" : "") + "."); + game.informPlayer(controller, "You don't have " + filter.getMessage() + " outside the game" + (alsoFromExile ? " or in exile" : "") + '.'); return true; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java index 85a4e2eff6..1acbd8bba1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java @@ -86,7 +86,7 @@ public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffec } else { sb.append(duration.toString()); } - sb.append(" "); + sb.append(' '); } sb.append("as though they didn't have defender"); return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackAnyPlayerAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackAnyPlayerAllEffect.java index d5fa0b7dd9..436ed02beb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackAnyPlayerAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackAnyPlayerAllEffect.java @@ -49,11 +49,11 @@ public class CantAttackAnyPlayerAllEffect extends RestrictionEffect { this.filter = filter; StringBuilder sb = new StringBuilder(filter.getMessage()).append(" can't attack"); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append(" this turn"); } else { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } staticText = sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockAllEffect.java index 7fee1dd847..96a726b457 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantAttackBlockAllEffect.java @@ -47,11 +47,11 @@ public class CantAttackBlockAllEffect extends RestrictionEffect { this.filter = filter; StringBuilder sb = new StringBuilder(filter.getMessage()).append(" can't attack or block"); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append(" this turn"); } else { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } staticText = sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedTargetEffect.java index 121b5aa6ba..67abeff84d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedTargetEffect.java @@ -88,7 +88,7 @@ public class CantBeBlockedTargetEffect extends RestrictionEffect { } } if (target.getMaxNumberOfTargets() > 1) { - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); } sb.append("target ").append(mode.getTargets().get(0).getTargetName()); if (target.getMaxNumberOfTargets() > 1) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java index 2c5f215b82..50927b66ab 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java @@ -62,10 +62,10 @@ public class CantBlockAttachedEffect extends RestrictionEffect { sb.append("Equipped creature can't block"); } if (!filter.getMessage().equals("creature")) { - sb.append(" ").append(filter.getMessage()); + sb.append(' ').append(filter.getMessage()); } if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockTargetEffect.java index 940ab26b09..5e61b12edd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBlockTargetEffect.java @@ -75,17 +75,17 @@ public class CantBlockTargetEffect extends RestrictionEffect { } StringBuilder sb = new StringBuilder(); Target target = mode.getTargets().get(0); - if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { - sb.append("any number of "); - } else if (target.getMaxNumberOfTargets() > 1) { + if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { + sb.append("any number of "); + } else if (target.getMaxNumberOfTargets() > 1) { if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) { sb.append("up to "); } - sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); } sb.append("target ").append(mode.getTargets().get(0).getTargetName()); if (target.getMaxNumberOfTargets() > 1) { - sb.append("s"); + sb.append('s'); } sb.append(" can't block"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java index 380b3a1fff..9961a6f614 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java @@ -107,7 +107,7 @@ public class AssignNoCombatDamageSourceEffect extends ReplacementEffectImpl { break; default: if (duration.toString().length() > 0) { - text += " " + duration.toString(); + text += ' ' + duration.toString(); } } return text; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 22ccfa003e..ef525ea505 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -216,7 +216,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } } if (!duration.toString().isEmpty() && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java index 0f5244ef2b..a9312c85d3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java @@ -85,15 +85,15 @@ public class BecomesColorOrColorsTargetEffect extends OneShotEffect { game.informPlayers(target.getName() + ": " + controller.getLogName() + " has chosen " + choiceColor.getChoice()); } if (choiceColor.getColor().isBlack()) { - sb.append("B"); + sb.append('B'); } else if (choiceColor.getColor().isBlue()) { - sb.append("U"); + sb.append('U'); } else if (choiceColor.getColor().isRed()) { - sb.append("R"); + sb.append('R'); } else if (choiceColor.getColor().isGreen()) { - sb.append("G"); + sb.append('G'); } else if (choiceColor.getColor().isWhite()) { - sb.append("W"); + sb.append('W'); } } String colors = new String(sb); @@ -123,7 +123,7 @@ public class BecomesColorOrColorsTargetEffect extends OneShotEffect { sb.append(mode.getTargets().get(0).getFilter().getMessage()); sb.append(" becomes the color or colors of your choice"); if (duration.toString().length() > 0) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java index c945fbcd2a..2ab725e74a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java @@ -120,6 +120,6 @@ public class BecomesColorSourceEffect extends ContinuousEffectImpl { return staticText; } return "{this} becomes " + (setColor == null ? "the color of your choice" : setColor.getDescription()) - + " " + duration.toString(); + + ' ' + duration.toString(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorTargetEffect.java index f1d1369cdb..12675f6798 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorTargetEffect.java @@ -143,7 +143,7 @@ public class BecomesColorTargetEffect extends ContinuousEffectImpl { } else { sb.append(setColor.getDescription()); } - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); return sb.toString(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 00475d4f93..e16b52adcc 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -184,7 +184,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { sb.append(" becomes a "); } sb.append(token.getDescription()); - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); if (addStillALandText) { if (target.getMaxNumberOfTargets() > 1) { sb.append(". They're still lands"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java index 4837e258e1..f7bb98281d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java @@ -101,7 +101,7 @@ public class BecomesCreatureTypeTargetEffect extends ContinuousEffectImpl { StringBuilder sb = new StringBuilder(); sb.append("Target creature becomes that type"); if (!duration.toString().isEmpty() && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java index e1967e797a..7d38ce39c6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java @@ -105,7 +105,7 @@ public class BecomesSubtypeAllEffect extends ContinuousEffectImpl { sb.append("Target creature becomes that type"); if (!duration.toString().isEmpty() && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java index 74f5f39b5b..e16c81de1f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostAllEffect.java @@ -178,15 +178,15 @@ public class BoostAllEffect extends ContinuousEffectImpl { sb.append(filter.getMessage()).append(" get "); String p = power.toString(); if (!p.startsWith("-")) { - sb.append("+"); + sb.append('+'); } - sb.append(p).append("/"); + sb.append(p).append('/'); String t = toughness.toString(); if (!t.startsWith("-")) { if (p.startsWith("-")) { - sb.append("-"); + sb.append('-'); } else { - sb.append("+"); + sb.append('+'); } } sb.append(t); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java index 1ac09946b4..7a743e6f5e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java @@ -161,15 +161,15 @@ public class BoostControlledEffect extends ContinuousEffectImpl { String p = power.toString(); if (!p.startsWith("-")) { - sb.append("+"); + sb.append('+'); } - sb.append(p).append("/"); + sb.append(p).append('/'); String t = toughness.toString(); if (!t.startsWith("-")) { if (p.startsWith("-")) { - sb.append("-"); + sb.append('-'); } else { - sb.append("+"); + sb.append('+'); } } sb.append(t); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java index 4470727115..41d5d5dda2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java @@ -118,20 +118,20 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { sb.append("Enchanted creature gets "); String p = power.toString(); if (!p.startsWith("-")) { - sb.append("+"); + sb.append('+'); } - sb.append(p).append("/"); + sb.append(p).append('/'); String t = toughness.toString(); if (!t.startsWith("-")) { if (p.startsWith("-")) { - sb.append("-"); + sb.append('-'); } else { - sb.append("+"); + sb.append('+'); } } sb.append(t); if (duration != Duration.WhileOnBattlefield) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } String message = null; String fixedPart = null; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEquippedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEquippedEffect.java index dd3150b62e..33eff81c6a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEquippedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEquippedEffect.java @@ -119,18 +119,18 @@ public class BoostEquippedEffect extends ContinuousEffectImpl { sb.append("Equipped creature gets "); String p = power.toString(); if (!p.startsWith("-")) - sb.append("+"); - sb.append(p).append("/"); + sb.append('+'); + sb.append(p).append('/'); String t = toughness.toString(); if (!t.startsWith("-")) { if (p.startsWith("-")) - sb.append("-"); + sb.append('-'); else - sb.append("+"); + sb.append('+'); } sb.append(t); if (duration != Duration.WhileOnBattlefield) - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); String message = power.getMessage(); if (message.length() > 0) { sb.append(" for each "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostSourceEffect.java index 93ab0363ad..2442da61cf 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostSourceEffect.java @@ -121,21 +121,21 @@ public class BoostSourceEffect extends ContinuousEffectImpl implements SourceEff sb.append("{this} gets "); String p = power.toString(); if(!p.startsWith("-")) { - sb.append("+"); + sb.append('+'); } - sb.append(p).append("/"); + sb.append(p).append('/'); String t = toughness.toString(); if(!t.startsWith("-")){ if(t.startsWith("-")) { - sb.append("-"); + sb.append('-'); } else { - sb.append("+"); + sb.append('+'); } } sb.append(t); if (duration != Duration.WhileOnBattlefield) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } String message = null; String fixedPart = null; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java index 31655da573..6b8eaed477 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostTargetEffect.java @@ -133,20 +133,20 @@ public class BoostTargetEffect extends ContinuousEffectImpl { } String p = power.toString(); if (!p.startsWith("-")) { - sb.append("+"); + sb.append('+'); } - sb.append(p).append("/"); + sb.append(p).append('/'); String t = toughness.toString(); if (!t.startsWith("-")) { if (t.equals("0") && p.startsWith("-")) { - sb.append("-"); + sb.append('-'); } else { - sb.append("+"); + sb.append('+'); } } sb.append(t); if (duration != Duration.WhileOnBattlefield) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } String message = null; String fixedPart = null; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeAllEffect.java index e14041fc65..1e32816cce 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeAllEffect.java @@ -129,7 +129,7 @@ public class CantGainLifeAllEffect extends ContinuousEffectImpl { } sb.append(" can't gain life"); if (!this.duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeTargetEffect.java index a1dd5e5819..7ac097963a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CantGainLifeTargetEffect.java @@ -51,7 +51,7 @@ public class CantGainLifeTargetEffect extends ContinuousEffectImpl { if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn, "); } else { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } } sb.append("that player gains no life instead"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java index 5589f5e8ca..ab7967dc1d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastAsThoughItHadFlashAllEffect.java @@ -97,7 +97,8 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl { if (duration.equals(Duration.EndOfTurn)) { sb.append(" this turn"); } else { - sb.append(" "); + sb.append(' '); + sb.append(' '); sb.append(duration.toString()); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java index b7a948f298..66320f7a27 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java @@ -191,14 +191,14 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl { sb.append(" gain "); } if (quotes) { - sb.append("\""); + sb.append('"'); } sb.append(ability.getRule()); if (quotes) { - sb.append("\""); + sb.append('"'); } if (duration.toString().length() > 0) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java index d26eaf8ab7..90734de9f2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java @@ -137,7 +137,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { } sb.append(ability.getRule()); if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java index c20ada07bd..d9811387ea 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControlledEffect.java @@ -166,7 +166,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl { if (duration.equals(Duration.WhileOnBattlefield) || duration.equals(Duration.EndOfGame)) { sb.append("have "); if (gainedAbility.startsWith("Whenever ") || gainedAbility.startsWith("{T}")) { - gainedAbility = "\"" + gainedAbility + "\""; + gainedAbility = '"' + gainedAbility + '"'; } } else { @@ -174,7 +174,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl { } sb.append(gainedAbility); if (!duration.toString().isEmpty() && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java index a4842f68bb..2bd6476997 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java @@ -63,7 +63,7 @@ public class GainAbilityControllerEffect extends ContinuousEffectImpl { this.ability = ability; staticText = "You have " + ability.getRule(); if (!duration.toString().isEmpty()) { - staticText += " " + duration.toString(); + staticText += ' ' + duration.toString(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java index 609ad65d29..1d6666a93a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java @@ -64,7 +64,7 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl implements Sou public GainAbilitySourceEffect(Ability ability, Duration duration, boolean onCard) { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.ability = ability; - staticText = "{this} gains " + ability.getRule() + " " + duration.toString(); + staticText = "{this} gains " + ability.getRule() + ' ' + duration.toString(); this.onCard = onCard; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java index ac019f328d..b689d1224d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java @@ -162,11 +162,11 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { } StringBuilder sb = new StringBuilder(); Target target = mode.getTargets().get(0); - if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { - sb.append("any number of target ").append(target.getTargetName()).append(" gain "); - } else if (target.getMaxNumberOfTargets() > 1) { + if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { + sb.append("any number of target ").append(target.getTargetName()).append(" gain "); + } else if (target.getMaxNumberOfTargets() > 1) { if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) { - sb.append("up to "); + sb.append("up to "); } sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" gain "); } else { @@ -180,7 +180,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { if (durationPhaseStep != null) { sb.append(" until your next ").append(durationPhaseStep.toString().toLowerCase(Locale.ENGLISH)); } else if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java index 3927e34b34..9a3d9fedd4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainControlTargetEffect.java @@ -150,7 +150,7 @@ public class GainControlTargetEffect extends ContinuousEffectImpl { } sb.append(mode.getTargets().get(0).getTargetName()); if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainProtectionFromTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainProtectionFromTypeTargetEffect.java index 8cd87d07f1..2d51b991f3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/GainProtectionFromTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/GainProtectionFromTypeTargetEffect.java @@ -47,7 +47,7 @@ public class GainProtectionFromTypeTargetEffect extends GainAbilityTargetEffect super(new ProtectionAbility(new FilterCard()), duration); ((ProtectionAbility)ability).setFilter(protectionFrom); typeName = protectionFrom.getMessage(); - staticText = "Target creature gains protection from " + typeName + " " + duration.toString(); + staticText = "Target creature gains protection from " + typeName + ' ' + duration.toString(); } public GainProtectionFromTypeTargetEffect(final GainProtectionFromTypeTargetEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java index 3962f8f9a1..4e8e86e908 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java @@ -28,7 +28,7 @@ public class LoseAbilityAllEffect extends ContinuousEffectImpl { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.filter = filter; this.ability = ability; - staticText = filter.getMessage() + " lose " + ability.toString() + (duration.toString().isEmpty() ? "" : " " + duration.toString()); + staticText = filter.getMessage() + " lose " + ability.toString() + (duration.toString().isEmpty() ? "" : ' ' + duration.toString()); } public LoseAbilityAllEffect(final LoseAbilityAllEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityOrAnotherAbilityTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityOrAnotherAbilityTargetEffect.java index beec0ac0a2..aa7201f1f8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityOrAnotherAbilityTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityOrAnotherAbilityTargetEffect.java @@ -123,7 +123,7 @@ public class LoseAbilityOrAnotherAbilityTargetEffect extends LoseAbilityTargetEf sb.append(" or "); sb.append(ability2.getRule()); if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java index 785420e329..bbb09b1281 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java @@ -27,7 +27,7 @@ public class LoseAbilitySourceEffect extends ContinuousEffectImpl{ public LoseAbilitySourceEffect(Ability ability, Duration duration){ super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); this.ability = ability; - staticText = "{this} loses " + ability.getRule() + " " + duration.toString(); + staticText = "{this} loses " + ability.getRule() + ' ' + duration.toString(); } public LoseAbilitySourceEffect(final LoseAbilitySourceEffect effect){ diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityTargetEffect.java index 6ceab45adb..3ac29f8314 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/LoseAbilityTargetEffect.java @@ -93,7 +93,7 @@ public class LoseAbilityTargetEffect extends ContinuousEffectImpl { } sb.append(ability.getRule()); if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java index f6636df1e2..cb528774c9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java @@ -96,7 +96,7 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl { sb.append(" creature is a"); for (String subtype : this.setSubtypes) { - sb.append(" ").append(subtype); + sb.append(' ').append(subtype); } staticText = sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java index 8b1c6fa277..0e47cf0ea0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessAllEffect.java @@ -131,9 +131,9 @@ public class SetPowerToughnessAllEffect extends ContinuousEffectImpl { } else { sb.append(" have base power and toughness "); } - sb.append(power).append("/").append(toughness); + sb.append(power).append('/').append(toughness); if (!duration.toString().isEmpty()) { - sb.append(" ").append(duration.toString()); + sb.append(' ').append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java index 36e4ec09c1..5947dbdb31 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java @@ -66,7 +66,7 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); this.power = power; this.toughness = toughness; - staticText = "{this}'s power and toughness is " + power + "/" + toughness + " " + duration.toString(); + staticText = "{this}'s power and toughness is " + power + '/' + toughness + ' ' + duration.toString(); } public SetPowerToughnessSourceEffect(final SetPowerToughnessSourceEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java index 0824e1b523..f9cd504ccb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessTargetEffect.java @@ -96,7 +96,7 @@ public class SetPowerToughnessTargetEffect extends ContinuousEffectImpl { } StringBuilder sb = new StringBuilder(); sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" has base power and toughness "); - sb.append(power).append("/").append(toughness).append(" ").append(duration.toString()); + sb.append(power).append('/').append(toughness).append(' ').append(duration.toString()); return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java index 576aeaf0e6..d61932de00 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessAllEffect.java @@ -109,7 +109,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl { StringBuilder sb = new StringBuilder(); sb.append("Switch each creature's power and toughness"); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(' '); sb.append(duration.toString()); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java index bd1bbdb961..759ae59865 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SwitchPowerToughnessTargetEffect.java @@ -73,7 +73,7 @@ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl { public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); sb.append("Switch target ").append(mode.getTargets().get(0).getTargetName()).append("'s power and toughness") - .append(" ").append(duration.toString()); + .append(' ').append(duration.toString()); return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java index 50b4e1506a..e63c115b7e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionAllEffect.java @@ -67,7 +67,7 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl { this.amount = amount; this.upTo = upTo; - this.staticText = filter.getMessage() + " cost " + (upTo ? "up to " : "") + "{" + amount + "} less to cast"; + this.staticText = filter.getMessage() + " cost " + (upTo ? "up to " : "") + '{' + amount + "} less to cast"; } protected SpellsCostReductionAllEffect(SpellsCostReductionAllEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java index 9aa7fc3710..20d8ab95b7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java @@ -83,7 +83,7 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI this.filter = filter; this.amount = amount; this.upTo = upTo; - this.staticText = filter.getMessage() + " you cast cost " + (upTo ? "up to " : "") + "{" + amount + "} less to cast"; + this.staticText = filter.getMessage() + " you cast cost " + (upTo ? "up to " : "") + '{' + amount + "} less to cast"; } protected SpellsCostReductionControllerEffect(final SpellsCostReductionControllerEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java index 0dc24e8709..3bc9ba0e98 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAllEffect.java @@ -68,7 +68,7 @@ public class AddCountersAllEffect extends OneShotEffect { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { permanent.addCounters(counter.copy(), source, game); if (!game.isSimulation()) { - game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + " " + counter.getName().toLowerCase() + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + ' ' + counter.getName().toLowerCase() + " counter on " + permanent.getLogName()); } } @@ -82,7 +82,7 @@ public class AddCountersAllEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); sb.append("put "); if (counter.getCount() > 1) { - sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName().toLowerCase()).append(" counters on each "); + sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase()).append(" counters on each "); } else { sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAttachedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAttachedEffect.java index a96dfea05f..20554668e2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAttachedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersAttachedEffect.java @@ -95,7 +95,7 @@ public class AddCountersAttachedEffect extends OneShotEffect { // put a +1/+1 counter on it sb.append("put "); if (counter.getCount() > 1) { - sb.append(CardUtil.numberToText(counter.getCount())).append(" "); + sb.append(CardUtil.numberToText(counter.getCount())).append(' '); } else { sb.append("a "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java index 36234a508c..6e937a1c47 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersControllerEffect.java @@ -94,7 +94,7 @@ public class AddCountersControllerEffect extends OneShotEffect { private void setText() { if (counter.getCount() > 1) { StringBuilder sb = new StringBuilder(); - sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters"); + sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(' ').append(counter.getName()).append(" counters"); staticText = sb.toString(); } else { staticText = "its controller gets a " + counter.getName() + " counter"; diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersSourceEffect.java index 99f46c8f7a..f1b1bb981c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersSourceEffect.java @@ -107,7 +107,7 @@ public class AddCountersSourceEffect extends OneShotEffect { if (informPlayers && !game.isSimulation()) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(player.getLogName() + " puts " + newCounter.getCount() + " " + newCounter.getName().toLowerCase() + " counter on " + card.getLogName()); + game.informPlayers(player.getLogName() + " puts " + newCounter.getCount() + ' ' + newCounter.getName().toLowerCase() + " counter on " + card.getLogName()); } } } @@ -133,7 +133,7 @@ public class AddCountersSourceEffect extends OneShotEffect { int amountAdded = permanent.getCounters(game).getCount(newCounter.getName()) - before; Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(player.getLogName() + " puts " + amountAdded + " " + newCounter.getName().toLowerCase() + " counter on " + permanent.getLogName()); + game.informPlayers(player.getLogName() + " puts " + amountAdded + ' ' + newCounter.getName().toLowerCase() + " counter on " + permanent.getLogName()); } } } @@ -149,7 +149,7 @@ public class AddCountersSourceEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); sb.append("put "); if (counter.getCount() > 1) { - sb.append(CardUtil.numberToText(counter.getCount())).append(" "); + sb.append(CardUtil.numberToText(counter.getCount())).append(' '); } else { if (amount.toString().equals("X") && amount.getMessage().isEmpty()) { sb.append("X "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java index 05587f40fb..f2f40afefd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddCountersTargetEffect.java @@ -102,7 +102,7 @@ public class AddCountersTargetEffect extends OneShotEffect { affectedTargets++; if (!game.isSimulation()) { game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " - + numberAdded + " " + counter.getName().toLowerCase() + " counter on " + permanent.getLogName()); + + numberAdded + ' ' + counter.getName().toLowerCase() + " counter on " + permanent.getLogName()); } } else if (player != null) { Counter newCounter = counter.copy(); @@ -111,14 +111,14 @@ public class AddCountersTargetEffect extends OneShotEffect { affectedTargets++; if (!game.isSimulation()) { game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " - + counter.getCount() + " " + counter.getName().toLowerCase() + " counter on " + player.getLogName()); + + counter.getCount() + ' ' + counter.getName().toLowerCase() + " counter on " + player.getLogName()); } } else if (card != null) { card.addCounters(counter, source, game); if (!game.isSimulation()) { - game.informPlayers(new StringBuilder("Added ").append(counter.getCount()).append(" ").append(counter.getName()) + game.informPlayers(new StringBuilder("Added ").append(counter.getCount()).append(' ').append(counter.getName()) .append(" counter to ").append(card.getName()) - .append(" (").append(card.getCounters(game).getCount(counter.getName())).append(")").toString()); + .append(" (").append(card.getCounters(game).getCount(counter.getName())).append(')').toString()); } return true; } @@ -136,13 +136,13 @@ public class AddCountersTargetEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); sb.append("put "); if (counter.getCount() > 1) { - sb.append(CardUtil.numberToText(counter.getCount())).append(" "); + sb.append(CardUtil.numberToText(counter.getCount())).append(' '); } else { sb.append("a "); } sb.append(counter.getName().toLowerCase()).append(" counter"); if (counter.getCount() > 1) { - sb.append("s"); + sb.append('s'); } sb.append(" on "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/AddRemoveAllTimeSuspentCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/AddRemoveAllTimeSuspentCountersEffect.java index 6d84a0614f..0e59f9641e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/AddRemoveAllTimeSuspentCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/AddRemoveAllTimeSuspentCountersEffect.java @@ -98,7 +98,7 @@ public class AddRemoveAllTimeSuspentCountersEffect extends OneShotEffect { if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ") .append(controller.getLogName()).append(actionStr) - .append(counter.getCount()).append(" ").append(counterName.toLowerCase()) + .append(counter.getCount()).append(' ').append(counterName.toLowerCase()) .append(" counter on ").append(card.getName()).toString()); } } @@ -110,7 +110,7 @@ public class AddRemoveAllTimeSuspentCountersEffect extends OneShotEffect { final String actionsStr2 = removeCounter ? "remove " : " put "; sb.append(actionsStr2); if (counter.getCount() > 1) { - sb.append(Integer.toString(counter.getCount())).append(" ").append(counter.getName().toLowerCase()).append(" counters on each "); + sb.append(Integer.toString(counter.getCount())).append(' ').append(counter.getName().toLowerCase()).append(" counters on each "); } else { sb.append("a ").append(counter.getName().toLowerCase()).append(" counter on each "); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java index 0f74a9fb4c..6cb3f44bb1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/DistributeCountersEffect.java @@ -102,7 +102,7 @@ public class DistributeCountersEffect extends OneShotEffect { } String name = counterType.getName(); - String text = "distribute " + CardUtil.numberToText(amount) + " " + name + " counters among " + targetDescription + "."; + String text = "distribute " + CardUtil.numberToText(amount) + ' ' + name + " counters among " + targetDescription + '.'; if (removeAtEndOfTurn) { text += " For each " + name + " counter you put on a creature this way, remove a " + name + " counter from that creature at the beginning of the next cleanup step."; diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java index b255546221..983797d08c 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/GetEnergyCountersControllerEffect.java @@ -88,7 +88,7 @@ public class GetEnergyCountersControllerEffect extends OneShotEffect { sb.append(val > 1 ? "s" : ""); sb.append(")"); if ((value instanceof StaticValue)) { - sb.append("."); + sb.append('.'); } else { sb.append(" for each "); sb.append(value.getMessage()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/MoveCountersTargetsEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/MoveCountersTargetsEffect.java index 4979d2ca0f..c4fce2f0f1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/MoveCountersTargetsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/MoveCountersTargetsEffect.java @@ -70,7 +70,7 @@ public class MoveCountersTargetsEffect extends OneShotEffect { removeTargetCreature.removeCounters(counterType.createInstance(amount), game); addTargetCreature.addCounters(counterType.createInstance(amount), source, game); if (!game.isSimulation()) { - game.informPlayers("Moved " + amount + " " + counterType.getName() + " counter" + (amount > 1 ? "s" : "") + " from " + removeTargetCreature.getLogName() + " to " + addTargetCreature.getLogName()); + game.informPlayers("Moved " + amount + ' ' + counterType.getName() + " counter" + (amount > 1 ? "s" : "") + " from " + removeTargetCreature.getLogName() + " to " + addTargetCreature.getLogName()); } return true; } @@ -87,15 +87,15 @@ public class MoveCountersTargetsEffect extends OneShotEffect { if (amount > 1) { sb.append(amount); } else { - sb.append("a"); + sb.append('a'); } - sb.append(" "); + sb.append(' '); sb.append(counterType.getName()); sb.append(" counter"); if (amount > 1) { sb.append("s "); } else { - sb.append(" "); + sb.append(' '); } sb.append("from one target creature to another target creature"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/ProliferateEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/ProliferateEffect.java index 89f4ff24cd..b67caad706 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/ProliferateEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/ProliferateEffect.java @@ -88,7 +88,7 @@ public class ProliferateEffect extends OneShotEffect { choices.add(counter.getName()); } choice.setChoices(choices); - choice.setMessage("Choose a counter to proliferate (" + permanent.getIdName() + ")"); + choice.setMessage("Choose a counter to proliferate (" + permanent.getIdName() + ')'); controller.choose(Outcome.Benefit, choice, game); for (Counter counter : permanent.getCounters(game).values()) { if (counter.getName().equals(choice.getChoice())) { @@ -115,7 +115,7 @@ public class ProliferateEffect extends OneShotEffect { choices.add(counter.getName()); } choice.setChoices(choices); - choice.setMessage("Choose a counter to proliferate (" + player.getLogName() + ")"); + choice.setMessage("Choose a counter to proliferate (" + player.getLogName() + ')'); controller.choose(Outcome.Benefit, choice, game); for (Counter counter : player.getCounters().values()) { if (counter.getName().equals(choice.getChoice())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java index 6322b59d12..2e4feb8c52 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java @@ -62,7 +62,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect { if (toRemove > 0) { permanent.removeCounters(counter.getName(), toRemove, game); if (!game.isSimulation()) { - game.informPlayers("Removed " + toRemove + " " + counter.getName() + " counter from " + permanent.getLogName()); + game.informPlayers("Removed " + toRemove + ' ' + counter.getName() + " counter from " + permanent.getLogName()); } } return true; @@ -73,7 +73,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect { if (toRemove > 0) { card.removeCounters(counter.getName(), toRemove, game); if (!game.isSimulation()) { - game.informPlayers("Removed " + toRemove + " " + counter.getName() + game.informPlayers("Removed " + toRemove + ' ' + counter.getName() + " counter from " + card.getLogName() + " (" + card.getCounters(game).getCount(counter.getName()) + " left)"); } @@ -91,7 +91,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect { private void setText() { if (counter.getCount() > 1) { StringBuilder sb = new StringBuilder(); - sb.append("remove ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters from {this}"); + sb.append("remove ").append(Integer.toString(counter.getCount())).append(' ').append(counter.getName()).append(" counters from {this}"); staticText = sb.toString(); } else { staticText = "remove a " + counter.getName() + " counter from {this}"; diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java index ff8a03f950..3647644a9d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java @@ -74,7 +74,7 @@ public class RemoveCounterTargetEffect extends OneShotEffect { if(toRemove != null && p.getCounters(game).getCount(toRemove.getName()) >= toRemove.getCount()) { p.removeCounters(toRemove.getName(), toRemove.getCount(), game); if(!game.isSimulation()) - game.informPlayers("Removed " + toRemove.getCount() + " " + toRemove.getName() + game.informPlayers("Removed " + toRemove.getCount() + ' ' + toRemove.getName() + " counter from " + p.getName()); return true; } @@ -83,7 +83,7 @@ public class RemoveCounterTargetEffect extends OneShotEffect { if (c != null && counter != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { c.removeCounters(counter.getName(), counter.getCount(), game); if (!game.isSimulation()) - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) + game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(' ').append(counter.getName()) .append(" counter from ").append(c.getName()) .append(" (").append(c.getCounters(game).getCount(counter.getName())).append(" left)").toString()); return true; @@ -135,7 +135,7 @@ public class RemoveCounterTargetEffect extends OneShotEffect { text += "a counter"; } else { - text += CardUtil.numberToText(counter.getCount(), "a") + " " + counter.getName(); + text += CardUtil.numberToText(counter.getCount(), "a") + ' ' + counter.getName(); text += counter.getCount() > 1 ? " counters" : " counter"; } text += " from target " + mode.getTargets().get(0).getTargetName(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java index f0daee0174..b527f9073f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java @@ -151,7 +151,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { revealedCards.addAll(player.getHand()); } - player.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ")" : "Discard", revealedCards, game); + player.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ')' : "Discard", revealedCards, game); boolean result = true; int filteredCardsCount = revealedCards.count(filter, source.getSourceId(), source.getControllerId(), game); @@ -208,7 +208,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { sb.append(". You choose "); boolean discardMultipleCards = !numberCardsToDiscard.toString().equals("1"); if (discardMultipleCards) { - sb.append(numberCardsToDiscard).append(" "); + sb.append(numberCardsToDiscard).append(' '); } else { if (!filter.getMessage().startsWith("a ") && !filter.getMessage().startsWith("an ")) { sb.append("a "); diff --git a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardControllerEffect.java index fa9d314a21..e21c7574d8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardControllerEffect.java @@ -100,17 +100,17 @@ public class DiscardControllerEffect extends OneShotEffect { private void setText() { StringBuilder sb = new StringBuilder("discard "); if (amount.toString().equals("1")) { - sb.append("a"); + sb.append('a'); } else { sb.append(CardUtil.numberToText(amount.toString())); } sb.append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { - sb.append("s"); + sb.append('s'); } } catch (Exception e) { - sb.append("s"); + sb.append('s'); } if (randomDiscard) { sb.append(" at random"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardEachPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardEachPlayerEffect.java index c4817e5e59..7272b439ce 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardEachPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/discard/DiscardEachPlayerEffect.java @@ -140,10 +140,10 @@ public class DiscardEachPlayerEffect extends OneShotEffect { sb.append(CardUtil.numberToText(amount.toString(), "a")).append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { - sb.append("s"); + sb.append('s'); } } catch (Exception e) { - sb.append("s"); + sb.append('s'); } if (randomDiscard) { sb.append(" at random"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java index f506db3798..c20202dfc9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java @@ -72,7 +72,7 @@ public class CastOnlyDuringPhaseStepSourceEffect extends ContinuousRuleModifying sb.append("the ").append(phaseStep.getStepText()); } if (condition != null) { - sb.append(" ").append(condition.toString()); + sb.append(' ').append(condition.toString()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java index 0b007176b8..656a47b3e7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryGraveyardPutInHandEffect.java @@ -78,7 +78,7 @@ public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); Card cardFound = null; if (controller != null && sourceObject != null) { - if (forceToSearchBoth || controller.chooseUse(outcome, "Search your library for a card named " + filter.getMessage() + "?", source, game)) { + if (forceToSearchBoth || controller.chooseUse(outcome, "Search your library for a card named " + filter.getMessage() + '?', source, game)) { TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); target.clearChosen(); if (controller.searchLibrary(target, game)) { @@ -89,7 +89,7 @@ public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect { controller.shuffleLibrary(source, game); } - if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a card named " + filter.getMessage() + "?", source, game)) { + if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a card named " + filter.getMessage() + '?', source, game)) { TargetCard target = new TargetCard(0, 1, Zone.GRAVEYARD, filter); target.clearChosen(); if (controller.choose(outcome, controller.getGraveyard(), target, game)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java index a992a18e79..8ce316cfc5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java @@ -121,7 +121,7 @@ public class SearchLibraryPutInHandEffect extends SearchEffect { StringBuilder sb = new StringBuilder(); sb.append(rulePrefix); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { - sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); sb.append(target.getTargetName()).append(revealCards ? ", reveal them," : "").append(" and put them into your hand"); } else { sb.append("a ").append(target.getTargetName()).append(revealCards ? ", reveal it," : "").append(" and put that card into your hand"); diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java index c0b387f67d..39d26abaf5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java @@ -106,9 +106,9 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect { sb.append("search your library for "); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { - sb.append("any number of ").append(" "); + sb.append("any number of ").append(' '); } else { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(' '); } sb.append(target.getTargetName()).append(" and put them onto the battlefield"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java index 6b145d3a39..0b851ee858 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java @@ -92,9 +92,9 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { sb.append("target player searches his or her library for "); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { - sb.append("any number of ").append(" "); + sb.append("any number of ").append(' '); } else { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(' '); } sb.append(target.getTargetName()).append(" and put them onto the battlefield"); } else { diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java index 1f7ed73df7..184850b354 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java @@ -105,7 +105,7 @@ public class ManifestTargetPlayerEffect extends OneShotEffect { private String setText() { StringBuilder sb = new StringBuilder(); if (prefix != null && !prefix.isEmpty()) { - sb.append(prefix).append(" "); + sb.append(prefix).append(' '); } sb.append("manifest the top "); if (amount > 1) { diff --git a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java index c1ede4ef17..c2ae418441 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AuraSwapAbility.java @@ -104,7 +104,7 @@ class AuraSwapEffect extends OneShotEffect { game.getState().setValue("attachTo:" + auraInHand.getId(), enchantedPermanent); auraInHand.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId()); enchantedPermanent.addAttachment(auraInHand.getId(), game); - game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + enchantedPermanent.getLogName() + "."); + game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + enchantedPermanent.getLogName() + '.'); enchantedPermanent.removeAttachment(auraSourcePermanent.getId(), game); return controller.moveCards(game.getCard(source.getSourceId()), Zone.HAND, source, game); } diff --git a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java index 98eb6e7752..8bd67d0348 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java @@ -138,7 +138,7 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS StringBuilder sb = new StringBuilder(); if (buybackCost != null) { sb.append(buybackCost.getText(false)); - sb.append(" ").append(buybackCost.getReminderText()); + sb.append(' ').append(buybackCost.getReminderText()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java index 2cb6ca432b..dbe8a87d8d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CascadeAbility.java @@ -124,7 +124,7 @@ class CascadeEffect extends OneShotEffect { controller.getLibrary().reset(); // set back empty draw state if that caused an empty draw if (card != null) { - if (controller.chooseUse(outcome, "Use cascade effect on " + card.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Use cascade effect on " + card.getLogName() + '?', source, game)) { if (controller.cast(card.getSpellAbility(), game, true)) { exile.remove(card.getId()); } diff --git a/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java b/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java index 26b23a062c..fe9421ac61 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ConspireAbility.java @@ -195,7 +195,7 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional StringBuilder sb = new StringBuilder(); if (conspireCost != null) { sb.append(conspireCost.getText(false)); - sb.append(" ").append(conspireCost.getReminderText()); + sb.append(' ').append(conspireCost.getReminderText()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/CumulativeUpkeepAbility.java b/Mage/src/main/java/mage/abilities/keyword/CumulativeUpkeepAbility.java index eb8e0e7bac..f24a1a8817 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CumulativeUpkeepAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CumulativeUpkeepAbility.java @@ -104,7 +104,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { for (int i = 0; i < ageCounter; i++) { totalCost.add((ManaCost) cumulativeCost.copy()); } - if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + '?', source, game)) { totalCost.clearPaid(); if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())) { game.fireEvent(new GameEvent(EventType.PAID_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); @@ -119,7 +119,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { for (int i = 0; i < ageCounter; i++) { totalCost.add(cumulativeCost.copy()); } - if (player.chooseUse(Outcome.Benefit, totalCost.getText() + "?", source, game)) { + if (player.chooseUse(Outcome.Benefit, totalCost.getText() + '?', source, game)) { totalCost.clearPaid(); int bookmark = game.bookmarkState(); if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { diff --git a/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java b/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java index e52a77724c..3f9cc3700e 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CyclingAbility.java @@ -77,7 +77,7 @@ public class CyclingAbility extends ActivatedAbilityImpl { public String getRule() { StringBuilder rule = new StringBuilder(this.text); if(cost instanceof ManaCost){ - rule.append(" "); + rule.append(' '); } else{ rule.append("—"); diff --git a/Mage/src/main/java/mage/abilities/keyword/DashAbility.java b/Mage/src/main/java/mage/abilities/keyword/DashAbility.java index 6b862cff30..20a087dd96 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DashAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DashAbility.java @@ -179,7 +179,7 @@ public class DashAbility extends StaticAbility implements AlternativeSourceCosts ++numberCosts; } if (numberCosts == 1) { - sb.append(" ").append(remarkText); + sb.append(' ').append(remarkText); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java b/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java index e3c0531073..8b28bb0e00 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java @@ -118,7 +118,7 @@ public class EchoAbility extends TriggeredAbilityImpl { public String getRule() { StringBuilder sb = new StringBuilder("Echo"); if (manaEcho) { - sb.append(" "); + sb.append(' '); } else { sb.append("—"); } @@ -145,7 +145,7 @@ class EchoEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && source.getSourceObjectIfItStillExists(game) != null) { - if (controller.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", source, game)) { + if (controller.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; diff --git a/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java b/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java index c98c6334ec..a51b621d91 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java @@ -134,7 +134,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM StringBuilder sb = new StringBuilder(); if (additionalCost != null) { sb.append(additionalCost.getText(false)); - sb.append(" ").append(additionalCost.getReminderText()); + sb.append(' ').append(additionalCost.getReminderText()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java index d4aca82458..8253232c6e 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java @@ -171,7 +171,7 @@ public class EvokeAbility extends StaticAbility implements AlternativeSourceCost ++numberCosts; } if (numberCosts == 1) { - sb.append(" ").append(remarkText); + sb.append(' ').append(remarkText); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java b/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java index 63e7fda4e6..4ab4ff99c5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java @@ -101,7 +101,7 @@ class ExtortEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { - if (player.chooseUse(Outcome.Damage, new StringBuilder("Extort opponents? (").append(permanent.getName()).append(")").toString(), source, game)) { + if (player.chooseUse(Outcome.Damage, new StringBuilder("Extort opponents? (").append(permanent.getName()).append(')').toString(), source, game)) { Cost cost = new ManaCostsImpl("{W/B}"); if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { int loseLife = 0; diff --git a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java index 214d84e9c5..350cc8e517 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java @@ -126,7 +126,7 @@ public class FlashbackAbility extends SpellAbility { if (costs.size() > 0) { sbRule.append(" - "); } else { - sbRule.append(" "); + sbRule.append(' '); } if (manaCosts.size() > 0) { sbRule.append(manaCosts.getText()); @@ -136,10 +136,10 @@ public class FlashbackAbility extends SpellAbility { sbRule.append(", "); } sbRule.append(costs.getText()); - sbRule.append("."); + sbRule.append('.'); } if (abilityName != null) { - sbRule.append(" "); + sbRule.append(' '); sbRule.append(abilityName); } sbRule.append(" (You may cast this card from your graveyard for its flashback cost. Then exile it.)"); diff --git a/Mage/src/main/java/mage/abilities/keyword/GraftAbility.java b/Mage/src/main/java/mage/abilities/keyword/GraftAbility.java index 937501a4ea..6d6e781d6c 100644 --- a/Mage/src/main/java/mage/abilities/keyword/GraftAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/GraftAbility.java @@ -71,7 +71,7 @@ public class GraftAbility extends TriggeredAbilityImpl { this.amount = amount; StringBuilder sb = new StringBuilder(); for (CardType theCardtype : card.getCardType()) { - sb.append(theCardtype.toString().toLowerCase(Locale.ENGLISH)).append(" "); + sb.append(theCardtype.toString().toLowerCase(Locale.ENGLISH)).append(' '); } this.cardtype = sb.toString().trim(); addSubAbility(new GraftStaticAbility(amount)); @@ -113,7 +113,7 @@ public class GraftAbility extends TriggeredAbilityImpl { @Override public String getRule() { StringBuilder sb = new StringBuilder("Graft"); - sb.append(" ").append(amount).append(" (This ").append(cardtype).append(" enters the battlefield with ") + sb.append(' ').append(amount).append(" (This ").append(cardtype).append(" enters the battlefield with ") .append(amount == 1 ? "a" : CardUtil.numberToText(amount)) .append(" +1/+1 counter on it. Whenever a creature enters the battlefield, you may move a +1/+1 counter from this ") .append(cardtype).append(" onto it.)"); diff --git a/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java b/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java index e104a5e26c..5a033f3a2d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HauntAbility.java @@ -108,7 +108,7 @@ public class HauntAbility extends TriggeredAbilityImpl { if (zEvent.isDiesEvent()) { Card card = game.getCard(getSourceId()); if (card != null) { - String key = new StringBuilder("Haunting_").append(getSourceId().toString()).append("_").append(card.getZoneChangeCounter(game)).toString(); + String key = new StringBuilder("Haunting_").append(getSourceId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString(); Object object = game.getState().getValue(key); if (object != null && object instanceof FixedTarget) { FixedTarget target = (FixedTarget) object; @@ -209,7 +209,7 @@ class HauntEffect extends OneShotEffect { if (hauntedCreature != null) { if (card.moveToExile(source.getSourceId(), "Haunting", source.getSourceId(), game)) { // remember the haunted creature - String key = new StringBuilder("Haunting_").append(source.getSourceId().toString()).append("_").append(card.getZoneChangeCounter(game)).toString(); + String key = new StringBuilder("Haunting_").append(source.getSourceId().toString()).append('_').append(card.getZoneChangeCounter(game)).toString(); game.getState().setValue(key, new FixedTarget(targetPointer.getFirst(game, source))); card.addInfo("hauntinfo", new StringBuilder("Haunting ").append(hauntedCreature.getLogName()).toString(), game); hauntedCreature.addInfo("hauntinfo", new StringBuilder("Haunted by ").append(card.getLogName()).toString(), game); diff --git a/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java b/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java index 6052344429..bd839096a4 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HideawayAbility.java @@ -125,7 +125,7 @@ class HideawayExileEffect extends OneShotEffect { if (card != null) { cards.remove(card); controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), - "Hideaway (" + hideawaySource.getIdName() + ")", source.getSourceId(), game, Zone.LIBRARY, false); + "Hideaway (" + hideawaySource.getIdName() + ')', source.getSourceId(), game, Zone.LIBRARY, false); card.setFaceDown(true, game); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java index 138189fc08..e897faae38 100644 --- a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java @@ -291,7 +291,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo ++numberKicker; } if (numberKicker == 1) { - sb.append(" ").append(remarkText); + sb.append(' ').append(remarkText); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java b/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java index 950d40d008..0749bbe6c5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java +++ b/Mage/src/main/java/mage/abilities/keyword/LevelerCardBuilder.java @@ -210,13 +210,13 @@ public class LevelerCardBuilder { StringBuilder sb = new StringBuilder(); sb.append("Level ").append(level1); if (level2 == -1) { - sb.append("+"); + sb.append('+'); } else { - sb.append("-").append(level2); + sb.append('-').append(level2); } - sb.append(": ").append(power).append("/").append(toughness).append(" "); + sb.append(": ").append(power).append('/').append(toughness).append(' '); for (String rule : abilities.getRules("{this}")) { - sb.append(rule).append(" "); + sb.append(rule).append(' '); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/ModularAbility.java b/Mage/src/main/java/mage/abilities/keyword/ModularAbility.java index bcac6e5cd6..bb155c232b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ModularAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ModularAbility.java @@ -93,7 +93,7 @@ public class ModularAbility extends DiesTriggeredAbility { if (sunburst) { sb.append("-Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. When it dies, you may put its +1/+1 counters on target artifact creature.)"); } else { - sb.append(" ").append(amount).append(" (This enters the battlefield with ") + sb.append(' ').append(amount).append(" (This enters the battlefield with ") .append(CardUtil.numberToText(amount, "a")) .append(" +1/+1 counter").append(amount != 1 ? "s" : "") .append(" on it. When it dies, you may put its +1/+1 counters on target artifact creature.)"); diff --git a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java index 7ea7f48f7e..fa8f8b6e08 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java @@ -127,9 +127,9 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost this.setWorksFaceDown(true); StringBuilder sb = new StringBuilder(); if (megamorph) { - sb.append(ABILITY_KEYWORD_MEGA).append(" "); + sb.append(ABILITY_KEYWORD_MEGA).append(' '); } else { - sb.append(ABILITY_KEYWORD).append(" "); + sb.append(ABILITY_KEYWORD).append(' '); } name = ABILITY_KEYWORD; for (Cost cost : morphCosts) { @@ -138,7 +138,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost break; } } - sb.append(morphCosts.getText()).append(" "); + sb.append(morphCosts.getText()).append(' '); if (megamorph) { sb.append(REMINDER_TEXT_MEGA); } else { diff --git a/Mage/src/main/java/mage/abilities/keyword/MyriadAbility.java b/Mage/src/main/java/mage/abilities/keyword/MyriadAbility.java index 8fc0d734e3..d09b69ee59 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MyriadAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MyriadAbility.java @@ -101,7 +101,7 @@ class MyriadEffect extends OneShotEffect { if (!playerId.equals(defendingPlayerId) && controller.hasOpponent(playerId, game)) { Player opponent = game.getPlayer(playerId); if (opponent != null && controller.chooseUse(Outcome.PutCreatureInPlay, - "Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + "?", source, game)) { + "Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + '?', source, game)) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(controller.getId(), null, false, 1, true, true, playerId); effect.setTargetPointer(new FixedTarget(sourceObject, game)); effect.apply(game, source); diff --git a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java index 5f0532ee44..15d4747d69 100644 --- a/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/OfferingAbility.java @@ -159,7 +159,7 @@ class OfferingAsThoughEffect extends AsThoughEffectImpl { Card spellToCast = game.getCard(source.getSourceId()); Player player = game.getPlayer(source.getControllerId()); if (player != null && !CardUtil.isCheckPlayableMode(affectedAbility) && - player.chooseUse(Outcome.Benefit, "Offer a " + filter.getMessage() + " to cast " + spellToCast.getName() + "?", source, game)) { + player.chooseUse(Outcome.Benefit, "Offer a " + filter.getMessage() + " to cast " + spellToCast.getName() + '?', source, game)) { Target target = new TargetControlledCreaturePermanent(1,1,filter,true); player.chooseTarget(Outcome.Sacrifice, target, source, game); if (!target.isChosen()) { diff --git a/Mage/src/main/java/mage/abilities/keyword/ProwlAbility.java b/Mage/src/main/java/mage/abilities/keyword/ProwlAbility.java index b61921457f..9d59fdf140 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ProwlAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ProwlAbility.java @@ -167,7 +167,7 @@ public class ProwlAbility extends StaticAbility implements AlternativeSourceCost ++numberCosts; } if (numberCosts == 1) { - sb.append(" ").append(remarkText); + sb.append(' ').append(remarkText); } return sb.toString(); diff --git a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java index 55fbe2116d..dc9637865f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/RecoverAbility.java @@ -132,7 +132,7 @@ class RecoverEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); sb.append("Recover"); if (cost instanceof ManaCost) { - sb.append(" ").append(cost.getText()).append(" "); + sb.append(' ').append(cost.getText()).append(' '); } else { sb.append("—").append(cost.getText()).append(". "); } diff --git a/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java b/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java index 0499ba0d9e..13c064507b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ReplicateAbility.java @@ -143,7 +143,7 @@ public class ReplicateAbility extends StaticAbility implements OptionalAdditiona StringBuilder sb = new StringBuilder(); if (additionalCost != null) { sb.append(additionalCost.getText(false)); - sb.append(" ").append(additionalCost.getReminderText()); + sb.append(' ').append(additionalCost.getReminderText()); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java index 725d15424b..80b10df022 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SunburstAbility.java @@ -102,7 +102,7 @@ class SunburstEffect extends OneShotEffect { if (!game.isSimulation()) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(player.getLogName() + " puts " + counter.getCount() + " " + counter.getName() + " counter on " + permanent.getName()); + game.informPlayers(player.getLogName() + " puts " + counter.getCount() + ' ' + counter.getName() + " counter on " + permanent.getName()); } } } diff --git a/Mage/src/main/java/mage/abilities/keyword/UnleashAbility.java b/Mage/src/main/java/mage/abilities/keyword/UnleashAbility.java index 3f9cfbfcaf..6cdc697f12 100644 --- a/Mage/src/main/java/mage/abilities/keyword/UnleashAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/UnleashAbility.java @@ -101,7 +101,7 @@ class UnleashReplacementEffect extends ReplacementEffectImpl { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (creature != null && controller != null) { - if (controller.chooseUse(outcome, "Unleash " + creature.getLogName() + "?", source, game)) { + if (controller.chooseUse(outcome, "Unleash " + creature.getLogName() + '?', source, game)) { if (!game.isSimulation()) { game.informPlayers(controller.getLogName() + " unleashes " + creature.getName()); } diff --git a/Mage/src/main/java/mage/abilities/mana/ActivateIfConditionManaAbility.java b/Mage/src/main/java/mage/abilities/mana/ActivateIfConditionManaAbility.java index b7f846f957..f12d8e5565 100644 --- a/Mage/src/main/java/mage/abilities/mana/ActivateIfConditionManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/ActivateIfConditionManaAbility.java @@ -74,7 +74,7 @@ public class ActivateIfConditionManaAbility extends ActivatedManaAbilityImpl { @Override public String getRule() { - return new StringBuilder(super.getRule()).append(" Activate this ability only if ").append(condition.toString()).append(".").toString(); + return new StringBuilder(super.getRule()).append(" Activate this ability only if ").append(condition.toString()).append('.').toString(); } @Override diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java b/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java index 6b7a7c40b1..c1d071e93f 100644 --- a/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java +++ b/Mage/src/main/java/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java @@ -38,7 +38,7 @@ public class ConditionalSpellManaBuilder extends ConditionalManaBuilder { @Override public String getRule() { - return "Spend this mana only to cast " + filter.getMessage() + "."; + return "Spend this mana only to cast " + filter.getMessage() + '.'; } } @@ -46,7 +46,7 @@ class SpellCastConditionalMana extends ConditionalMana { SpellCastConditionalMana(Mana mana, FilterSpell filter) { super(mana); - staticText = "Spend this mana only to cast " + filter.getMessage() + "."; + staticText = "Spend this mana only to cast " + filter.getMessage() + '.'; addCondition(new SpellCastManaCondition(filter)); } } diff --git a/Mage/src/main/java/mage/actions/MageDrawAction.java b/Mage/src/main/java/mage/actions/MageDrawAction.java index f2513cc5e1..ba7922b590 100644 --- a/Mage/src/main/java/mage/actions/MageDrawAction.java +++ b/Mage/src/main/java/mage/actions/MageDrawAction.java @@ -83,7 +83,7 @@ public class MageDrawAction extends MageAction { drawnCards.add(card); card.moveToZone(Zone.HAND, null, game, false); if (player.isTopCardRevealed()) { - game.fireInformEvent(player.getLogName() + " draws a revealed card (" + card.getLogName() + ")"); + game.fireInformEvent(player.getLogName() + " draws a revealed card (" + card.getLogName() + ')'); } game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DREW_CARD, card.getId(), player.getId())); diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 10a0aa8d12..29aa92eb2f 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -483,7 +483,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { default: MageObject sourceObject = game.getObject(sourceId); logger.fatal("Invalid from zone [" + fromZone + "] for card [" + this.getIdName() - + "] source [" + (sourceObject != null ? sourceObject.getName() : "null") + "]"); + + "] source [" + (sourceObject != null ? sourceObject.getName() : "null") + ']'); break; } if (removed) { diff --git a/Mage/src/main/java/mage/cards/CardsImpl.java b/Mage/src/main/java/mage/cards/CardsImpl.java index c7228776be..49e0622ccd 100644 --- a/Mage/src/main/java/mage/cards/CardsImpl.java +++ b/Mage/src/main/java/mage/cards/CardsImpl.java @@ -206,7 +206,7 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl } Collections.sort(cards); for (String name : cards) { - sb.append(name).append(":"); + sb.append(name).append(':'); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/cards/Sets.java b/Mage/src/main/java/mage/cards/Sets.java index 4ea294f199..7fc0e1374e 100644 --- a/Mage/src/main/java/mage/cards/Sets.java +++ b/Mage/src/main/java/mage/cards/Sets.java @@ -193,7 +193,7 @@ public class Sets extends HashMap { List>> cardGrid = layout.getCards(); int height = cardGrid.size(); int width = (height > 0) ? cardGrid.get(0).size() : 0; - out.print("(" + height + "," + width + ")"); + out.print("(" + height + ',' + width + ')'); out.print(layout.getSettings()); out.print("|"); for (List> row : cardGrid) { diff --git a/Mage/src/main/java/mage/cards/decks/Deck.java b/Mage/src/main/java/mage/cards/decks/Deck.java index 7af38ed879..923d90b30e 100644 --- a/Mage/src/main/java/mage/cards/decks/Deck.java +++ b/Mage/src/main/java/mage/cards/decks/Deck.java @@ -122,7 +122,7 @@ public class Deck implements Serializable { cardInfo = CardRepository.instance.findCard("Silvercoat Lion"); Logger.getLogger(Deck.class).error("Tried to restart the DB: " + (cardInfo == null ? "not successful" : "successful")); } - return new GameException("Card not found - " + deckCardInfo.getCardName() + " - " + deckCardInfo.getSetCode() + " for deck - " + deckName + "\n" + return new GameException("Card not found - " + deckCardInfo.getCardName() + " - " + deckCardInfo.getSetCode() + " for deck - " + deckName + '\n' + "Possible reason is, that you use cards in your deck, that are only supported in newer versions of the server.\n" + "So it can help to use the same card from another set, that's already supported from this server."); diff --git a/Mage/src/main/java/mage/cards/decks/InvalidDeckException.java b/Mage/src/main/java/mage/cards/decks/InvalidDeckException.java index c67c7491d0..c4e70bcb68 100644 --- a/Mage/src/main/java/mage/cards/decks/InvalidDeckException.java +++ b/Mage/src/main/java/mage/cards/decks/InvalidDeckException.java @@ -52,9 +52,9 @@ public class InvalidDeckException extends GameException { @Override public String getMessage() { StringBuilder sb = new StringBuilder(); - sb.append(super.getMessage()).append("\n"); + sb.append(super.getMessage()).append('\n'); for (Entry entry: invalid.entrySet()) { - sb.append(entry.getKey()).append(" ").append(entry.getValue()).append("\n"); + sb.append(entry.getKey()).append(' ').append(entry.getValue()).append('\n'); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/cards/decks/importer/DckDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/DckDeckImporter.java index 9b042dc48c..6593401fc1 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/DckDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/DckDeckImporter.java @@ -93,7 +93,7 @@ public class DckDeckImporter extends DeckImporter { } } } else { - sbMessage.append("Could not find card '").append("' at line ").append(lineCount).append(": ").append(line).append("\n"); + sbMessage.append("Could not find card '").append("' at line ").append(lineCount).append(": ").append(line).append('\n'); } } else if (line.startsWith("NAME:")) { deckList.setName(line.substring(5, line.length())); diff --git a/Mage/src/main/java/mage/cards/decks/importer/DecDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/DecDeckImporter.java index 0dee3e9980..89a4b4d085 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/DecDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/DecDeckImporter.java @@ -57,7 +57,7 @@ public class DecDeckImporter extends DeckImporter { int num = Integer.parseInt(lineNum); CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); if (cardInfo == null) { - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append('\n'); } else { for (int i = 0; i < num; i++) { if (!sideboard) { @@ -68,7 +68,7 @@ public class DecDeckImporter extends DeckImporter { } } } catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append('\n'); } } diff --git a/Mage/src/main/java/mage/cards/decks/importer/DekDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/DekDeckImporter.java index f66158ff34..36e3a3c5f3 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/DekDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/DekDeckImporter.java @@ -23,7 +23,7 @@ public class DekDeckImporter extends DeckImporter { Boolean isSideboard = "true".equals(extractAttribute(line, "Sideboard")); CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardName, true); if (cardInfo == null) { - sbMessage.append("Could not find card: '").append(cardName).append("' at line ").append(lineCount).append("\n"); + sbMessage.append("Could not find card: '").append(cardName).append("' at line ").append(lineCount).append('\n'); } else { for (int i = 0; i < cardCount; i++) { DeckCardInfo deckCardInfo = new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode()); @@ -35,7 +35,7 @@ public class DekDeckImporter extends DeckImporter { } } }catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(extractAttribute(line, "Quantity")).append(" at line ").append(lineCount).append("\n"); + sbMessage.append("Invalid number: ").append(extractAttribute(line, "Quantity")).append(" at line ").append(lineCount).append('\n'); } } @@ -43,7 +43,7 @@ public class DekDeckImporter extends DeckImporter { private String extractAttribute(String line, String name) { String searchString = name+"=\""; int startDelim = line.indexOf(searchString)+searchString.length(); - int endDelim = line.substring(startDelim).indexOf("\""); + int endDelim = line.substring(startDelim).indexOf('\"'); return line.substring(startDelim, startDelim+endDelim); } diff --git a/Mage/src/main/java/mage/cards/decks/importer/MWSDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/MWSDeckImporter.java index fed0aa179f..797ff47ea5 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/MWSDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/MWSDeckImporter.java @@ -79,7 +79,7 @@ public class MWSDeckImporter extends DeckImporter { } if (cardInfo == null) { - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append('\n'); } else { for (int i = 0; i < num; i++) { if (!sideboard) { @@ -90,7 +90,7 @@ public class MWSDeckImporter extends DeckImporter { } } } catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append('\n'); } } } diff --git a/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java b/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java index 420553f0a9..089fbb1a6d 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java +++ b/Mage/src/main/java/mage/cards/decks/importer/TxtDeckImporter.java @@ -89,7 +89,7 @@ public class TxtDeckImporter extends DeckImporter { int num = Integer.parseInt(lineNum.replaceAll("\\D+", "")); CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); if (cardInfo == null) { - sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); + sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append('\n'); } else { for (int i = 0; i < num; i++) { if (!sideboard) { @@ -100,7 +100,7 @@ public class TxtDeckImporter extends DeckImporter { } } } catch (NumberFormatException nfe) { - sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n"); + sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append('\n'); } } diff --git a/Mage/src/main/java/mage/cards/repository/CardInfo.java b/Mage/src/main/java/mage/cards/repository/CardInfo.java index 3358bfa1fe..36f106eee9 100644 --- a/Mage/src/main/java/mage/cards/repository/CardInfo.java +++ b/Mage/src/main/java/mage/cards/repository/CardInfo.java @@ -183,7 +183,7 @@ public class CardInfo { if (spellAbility != null) { SpellAbilityType spellAbilityType = spellAbility.getSpellAbilityType(); if (spellAbilityType == SpellAbilityType.SPLIT_LEFT || spellAbilityType == SpellAbilityType.SPLIT_RIGHT) { - this.className = this.setCode + "." + this.name; + this.className = this.setCode + '.' + this.name; this.splitCardHalf = true; } } diff --git a/Mage/src/main/java/mage/cards/repository/CardRepository.java b/Mage/src/main/java/mage/cards/repository/CardRepository.java index 0662049895..0c9ef48cdd 100644 --- a/Mage/src/main/java/mage/cards/repository/CardRepository.java +++ b/Mage/src/main/java/mage/cards/repository/CardRepository.java @@ -400,7 +400,7 @@ public enum CardRepository { try { String sqlName = name.toLowerCase().replaceAll("\'", "\'\'"); GenericRawResults rawResults = cardDao.queryRaw( - "select * from " + CardRepository.VERSION_ENTITY_NAME + " where lower(name) = '" + sqlName + "'", + "select * from " + CardRepository.VERSION_ENTITY_NAME + " where lower(name) = '" + sqlName + '\'', cardDao.getRawRowMapper()); List result = new ArrayList<>(); for (CardInfo cardinfo : rawResults) { diff --git a/Mage/src/main/java/mage/designations/Designation.java b/Mage/src/main/java/mage/designations/Designation.java index 81e5682194..5636a0a295 100644 --- a/Mage/src/main/java/mage/designations/Designation.java +++ b/Mage/src/main/java/mage/designations/Designation.java @@ -71,7 +71,7 @@ public abstract class Designation implements MageObject { @Override public String getIdName() { - return getName() + " [" + getId().toString().substring(0, 3) + "]"; + return getName() + " [" + getId().toString().substring(0, 3) + ']'; } @Override diff --git a/Mage/src/main/java/mage/filter/FilterAbility.java b/Mage/src/main/java/mage/filter/FilterAbility.java index 6051f26f58..d1d8db8870 100644 --- a/Mage/src/main/java/mage/filter/FilterAbility.java +++ b/Mage/src/main/java/mage/filter/FilterAbility.java @@ -80,7 +80,7 @@ public class FilterAbility extends FilterImpl { @Override public String toString() { - return "Zone(" + zone.toString() + ")"; + return "Zone(" + zone.toString() + ')'; } } diff --git a/Mage/src/main/java/mage/filter/predicate/Predicates.java b/Mage/src/main/java/mage/filter/predicate/Predicates.java index 103217fbf8..30ad5956a4 100644 --- a/Mage/src/main/java/mage/filter/predicate/Predicates.java +++ b/Mage/src/main/java/mage/filter/predicate/Predicates.java @@ -150,7 +150,7 @@ public final class Predicates { @Override public String toString() { - return "Not(" + predicate.toString() + ")"; + return "Not(" + predicate.toString() + ')'; } private static final long serialVersionUID = 0; } @@ -178,7 +178,7 @@ public final class Predicates { @Override public String toString() { - return "And(" + commaJoin(components) + ")"; + return "And(" + commaJoin(components) + ')'; } private static final long serialVersionUID = 0; } @@ -206,7 +206,7 @@ public final class Predicates { @Override public String toString() { - return "Or(" + commaJoin(components) + ")"; + return "Or(" + commaJoin(components) + ')'; } private static final long serialVersionUID = 0; } diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/CardIdPredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/CardIdPredicate.java index 9eecf20a6d..34de046c35 100644 --- a/Mage/src/main/java/mage/filter/predicate/mageobject/CardIdPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/CardIdPredicate.java @@ -51,6 +51,6 @@ public class CardIdPredicate implements Predicate { @Override public String toString() { - return "CardId(" + cardId.toString() + ")"; + return "CardId(" + cardId.toString() + ')'; } } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/CanBeEnchantedByPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/CanBeEnchantedByPredicate.java index f9441f84d0..1852eca541 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/CanBeEnchantedByPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/CanBeEnchantedByPredicate.java @@ -50,6 +50,6 @@ public class CanBeEnchantedByPredicate implements Predicate { @Override public String toString() { - return "CanBeEnchanted(" + auraEnchantment.toString() + ")"; + return "CanBeEnchanted(" + auraEnchantment.toString() + ')'; } } diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/PermanentIdPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/PermanentIdPredicate.java index 268bcc305a..ec3b1231e4 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/PermanentIdPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/PermanentIdPredicate.java @@ -51,6 +51,6 @@ public class PermanentIdPredicate implements Predicate { @Override public String toString() { - return "PermanentId(" + permanentId + ")"; + return "PermanentId(" + permanentId + ')'; } } diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 68133f69ed..f24110ca59 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -780,19 +780,19 @@ public abstract class GameImpl implements Game, Serializable { } if (gameOver(null) && !isSimulation()) { winnerId = findWinnersAndLosers(); - StringBuilder sb = new StringBuilder("GAME END gameId: ").append(this.getId()).append(" "); + StringBuilder sb = new StringBuilder("GAME END gameId: ").append(this.getId()).append(' '); int count = 0; for (Player player : this.getState().getPlayers().values()) { if (count > 0) { sb.append(" - "); } - sb.append("[").append(player.getName()).append(" => "); + sb.append('[').append(player.getName()).append(" => "); sb.append(player.hasWon() ? "W" : ""); sb.append(player.hasLost() ? "L" : ""); sb.append(player.hasQuit() ? "Q" : ""); sb.append(player.hasIdleTimeout() ? "I" : ""); sb.append(player.hasTimerTimeout() ? "T" : ""); - sb.append("]"); + sb.append(']'); count++; } logger.info(sb.toString()); diff --git a/Mage/src/main/java/mage/game/GameTinyLeadersImpl.java b/Mage/src/main/java/mage/game/GameTinyLeadersImpl.java index 2a9405332f..70038ac643 100644 --- a/Mage/src/main/java/mage/game/GameTinyLeadersImpl.java +++ b/Mage/src/main/java/mage/game/GameTinyLeadersImpl.java @@ -94,7 +94,7 @@ public abstract class GameTinyLeadersImpl extends GameImpl { getState().getWatchers().add(watcher); watcher.addCardInfoToCommander(this); } else { - throw new UnknownError("Commander card could not be created. Name: [" + player.getMatchPlayer().getDeck().getName() + "]"); + throw new UnknownError("Commander card could not be created. Name: [" + player.getMatchPlayer().getDeck().getName() + ']'); } } diff --git a/Mage/src/main/java/mage/game/combat/Combat.java b/Mage/src/main/java/mage/game/combat/Combat.java index 8156532bed..edd139d5ab 100644 --- a/Mage/src/main/java/mage/game/combat/Combat.java +++ b/Mage/src/main/java/mage/game/combat/Combat.java @@ -399,7 +399,7 @@ public class Combat implements Serializable, Copyable { if (!effect.canAttackCheckAfter(numberAttackers, ability, game)) { MageObject sourceObject = ability.getSourceObject(game); if (attackingPlayer.isHuman()) { - game.informPlayer(attackingPlayer, attackingCreature.getIdName() + " can't attack this way (" + (sourceObject == null ? "null" : sourceObject.getIdName()) + ")"); + game.informPlayer(attackingPlayer, attackingCreature.getIdName() + " can't attack this way (" + (sourceObject == null ? "null" : sourceObject.getIdName()) + ')'); return false; } else { // remove attacking creatures for AI that are not allowed to attack @@ -504,7 +504,7 @@ public class Combat implements Serializable, Copyable { if (attackingCreature != null) { sb.append("Attacker: "); sb.append(attackingCreature.getLogName()).append(" ("); - sb.append(attackingCreature.getPower().getValue()).append("/").append(attackingCreature.getToughness().getValue()).append(") "); + sb.append(attackingCreature.getPower().getValue()).append('/').append(attackingCreature.getToughness().getValue()).append(") "); } else { // creature left battlefield attackingCreature = (Permanent) game.getLastKnownInformation(attackingCreatureId, Zone.BATTLEFIELD); @@ -520,7 +520,7 @@ public class Combat implements Serializable, Copyable { Permanent blockingCreature = game.getPermanent(blockingCreatureId); if (blockingCreature != null) { sb.append(blockingCreature.getLogName()).append(" ("); - sb.append(blockingCreature.getPower().getValue()).append("/").append(blockingCreature.getToughness().getValue()).append(") "); + sb.append(blockingCreature.getPower().getValue()).append('/').append(blockingCreature.getToughness().getValue()).append(") "); } } @@ -782,7 +782,7 @@ public class Combat implements Serializable, Copyable { possibleBlockerId, toBeBlockedCreatureId, mustBeBlockedByAtLeastOne, game); if (blockRequiredMessage != null) { // message means not required removeBlocker(possibleBlockerId, game); - game.informPlayer(controller, blockRequiredMessage + " Existing block removed. It's a requirement to block " + toBeBlockedCreature.getIdName() + "."); + game.informPlayer(controller, blockRequiredMessage + " Existing block removed. It's a requirement to block " + toBeBlockedCreature.getIdName() + '.'); return false; } } @@ -894,7 +894,7 @@ public class Combat implements Serializable, Copyable { } if (!blockIsValid) { - sb.append(" ").append(creatureForcedToBlock.getIdName()); + sb.append(' ').append(creatureForcedToBlock.getIdName()); } } if (sb.length() > 0) { diff --git a/Mage/src/main/java/mage/game/command/Commander.java b/Mage/src/main/java/mage/game/command/Commander.java index d31721b97b..2c77772d72 100644 --- a/Mage/src/main/java/mage/game/command/Commander.java +++ b/Mage/src/main/java/mage/game/command/Commander.java @@ -96,7 +96,7 @@ public class Commander implements CommandObject { @Override public String getIdName() { - return sourceObject.getName() + " [" + sourceObject.getId().toString().substring(0, 3) + "]"; + return sourceObject.getName() + " [" + sourceObject.getId().toString().substring(0, 3) + ']'; } @Override diff --git a/Mage/src/main/java/mage/game/command/Emblem.java b/Mage/src/main/java/mage/game/command/Emblem.java index 8501b2ea72..debb77a5bc 100644 --- a/Mage/src/main/java/mage/game/command/Emblem.java +++ b/Mage/src/main/java/mage/game/command/Emblem.java @@ -129,7 +129,7 @@ public class Emblem implements CommandObject { @Override public String getIdName() { - return getName() + " [" + getId().toString().substring(0, 3) + "]"; + return getName() + " [" + getId().toString().substring(0, 3) + ']'; } @Override diff --git a/Mage/src/main/java/mage/game/draft/DraftCube.java b/Mage/src/main/java/mage/game/draft/DraftCube.java index dc72fb3cf0..b120bb0a94 100644 --- a/Mage/src/main/java/mage/game/draft/DraftCube.java +++ b/Mage/src/main/java/mage/game/draft/DraftCube.java @@ -119,11 +119,11 @@ public abstract class DraftCube { booster.add(cardInfo.getCard()); done = true; } else { - logger.warn(new StringBuilder(this.getName()).append(" - Card not found: ").append(cardId.getName()).append(":").append(cardId.extension)); + logger.warn(new StringBuilder(this.getName()).append(" - Card not found: ").append(cardId.getName()).append(':').append(cardId.extension)); notValid++; } } else { - logger.error(new StringBuilder(this.getName()).append(" - Empty card name: ").append(cardId.getName()).append(":").append(cardId.extension)); + logger.error(new StringBuilder(this.getName()).append(" - Empty card name: ").append(cardId.getName()).append(':').append(cardId.extension)); notValid++; } diff --git a/Mage/src/main/java/mage/game/match/MatchImpl.java b/Mage/src/main/java/mage/game/match/MatchImpl.java index 28118e7548..4f52db281e 100644 --- a/Mage/src/main/java/mage/game/match/MatchImpl.java +++ b/Mage/src/main/java/mage/game/match/MatchImpl.java @@ -290,13 +290,13 @@ public abstract class MatchImpl implements Match { String duelingTime = ""; if (game.hasEnded()) { if (game.getEndTime() != null) { - duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + ')'; } state = "Finished" + duelingTime; result = game.getWinner(); } else { if (game.getStartTime() != null) { - duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + ')'; } state = "Dueling" + duelingTime; result = ""; diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index b8a2194209..3d93c69198 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -189,7 +189,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public String toString() { StringBuilder sb = threadLocalBuilder.get(); - sb.append(this.name).append("-").append(this.expansionSetCode); + sb.append(this.name).append('-').append(this.expansionSetCode); if (copy) { sb.append(" [Copy]"); } diff --git a/Mage/src/main/java/mage/game/permanent/token/Token.java b/Mage/src/main/java/mage/game/permanent/token/Token.java index 1c7845f5f0..ef5f13c824 100644 --- a/Mage/src/main/java/mage/game/permanent/token/Token.java +++ b/Mage/src/main/java/mage/game/permanent/token/Token.java @@ -130,7 +130,7 @@ public class Token extends MageObjectImpl { String subtype = this.subtype.toString().replaceAll("[^a-zA-Z0-9]", ""); String cardType = this.cardType.toString().replaceAll("[^a-zA-Z0-9]", ""); String originalset = this.getOriginalExpansionSetCode(); - String descriptor = name + "." + color + "." + subtype + "." + cardType + "." + this.power + "." + this.toughness; + String descriptor = name + '.' + color + '.' + subtype + '.' + cardType + '.' + this.power + '.' + this.toughness; descriptor = descriptor.toUpperCase(); return descriptor; } diff --git a/Mage/src/main/java/mage/game/permanent/token/ZombieToken2.java b/Mage/src/main/java/mage/game/permanent/token/ZombieToken2.java index 0b6967692e..fa95c4f401 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ZombieToken2.java +++ b/Mage/src/main/java/mage/game/permanent/token/ZombieToken2.java @@ -41,7 +41,7 @@ public class ZombieToken2 extends Token { } public ZombieToken2(int zPower, int zToughness) { - super("Zombie", String.valueOf(zPower) + "/" + String.valueOf(zToughness) + " black Zombie creature token"); + super("Zombie", String.valueOf(zPower) + '/' + String.valueOf(zToughness) + " black Zombie creature token"); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Zombie"); diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index bd421709e6..38c49d6ded 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -427,7 +427,7 @@ public class Spell extends StackObjImpl implements Card { } else { idName = getId().toString().substring(0, 3); } - return getName() + " [" + idName + "]"; + return getName() + " [" + idName + ']'; } @Override diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index 98a45a40ad..2ba1f248d6 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -87,7 +87,7 @@ public class StackAbility extends StackObjImpl implements Ability { public StackAbility(Ability ability, UUID controllerId) { this.ability = ability; this.controllerId = controllerId; - this.name = "stack ability (" + ability.getRule() + ")"; + this.name = "stack ability (" + ability.getRule() + ')'; } public StackAbility(final StackAbility stackAbility) { @@ -142,7 +142,7 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public String getIdName() { - return getName() + " [" + getId().toString().substring(0, 3) + "]"; + return getName() + " [" + getId().toString().substring(0, 3) + ']'; } @Override diff --git a/Mage/src/main/java/mage/game/stack/StackObjImpl.java b/Mage/src/main/java/mage/game/stack/StackObjImpl.java index d0012217a7..9d175b0599 100644 --- a/Mage/src/main/java/mage/game/stack/StackObjImpl.java +++ b/Mage/src/main/java/mage/game/stack/StackObjImpl.java @@ -165,7 +165,7 @@ public abstract class StackObjImpl implements StackObject { // change the target? Outcome outcome = mode.getEffects().isEmpty() ? Outcome.Detriment : mode.getEffects().get(0).getOutcome(); if (targetNames != null - && (forceChange || targetController.chooseUse(outcome, "Change this target: " + targetNames + "?", ability, game))) { + && (forceChange || targetController.chooseUse(outcome, "Change this target: " + targetNames + '?', ability, game))) { Set possibleTargets = target.possibleTargets(this.getSourceId(), getControllerId(), game); // choose exactly one other target - already targeted objects are not counted if (forceChange && possibleTargets != null && possibleTargets.size() > 1) { // controller of spell must be used (e.g. TargetOpponent) @@ -182,7 +182,7 @@ public abstract class StackObjImpl implements StackObject { if (newTarget.getFirstTarget() != null && filterNewTarget != null) { Permanent newTargetPermanent = game.getPermanent(newTarget.getFirstTarget()); if (newTargetPermanent == null || !filterNewTarget.match(newTargetPermanent, game)) { - game.informPlayer(targetController, "Target does not fullfil the target requirements (" + filterNewTarget.getMessage() + ")"); + game.informPlayer(targetController, "Target does not fullfil the target requirements (" + filterNewTarget.getMessage() + ')'); newTarget.clearChosen(); } } @@ -235,7 +235,7 @@ public abstract class StackObjImpl implements StackObject { } else if (newTarget.getFirstTarget() != null && filterNewTarget != null) { Permanent newTargetPermanent = game.getPermanent(newTarget.getFirstTarget()); if (newTargetPermanent == null || !filterNewTarget.match(newTargetPermanent, game)) { - game.informPlayer(targetController, "This target does not fullfil the target requirements (" + filterNewTarget.getMessage() + ")"); + game.informPlayer(targetController, "This target does not fullfil the target requirements (" + filterNewTarget.getMessage() + ')'); again = true; } } else { diff --git a/Mage/src/main/java/mage/game/tournament/TournamentImpl.java b/Mage/src/main/java/mage/game/tournament/TournamentImpl.java index eecd485654..a227b82421 100644 --- a/Mage/src/main/java/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/main/java/mage/game/tournament/TournamentImpl.java @@ -329,7 +329,7 @@ public abstract class TournamentImpl implements Tournament { } } for (TournamentPlayer tp : round.getPlayerByes()) { - tp.setResults(new StringBuilder(tp.getResults()).append("R").append(round.getRoundNumber()).append(" ").append("Bye ").toString()); + tp.setResults(new StringBuilder(tp.getResults()).append('R').append(round.getRoundNumber()).append(' ').append("Bye ").toString()); tp.setPoints(tp.getPoints() + 3); } } @@ -337,7 +337,7 @@ public abstract class TournamentImpl implements Tournament { private static String addRoundResult(int round, TournamentPairing pair, TournamentPlayer tournamentPlayer, TournamentPlayer opponentPlayer) { StringBuilder playerResult = new StringBuilder(tournamentPlayer.getResults()); - playerResult.append("R").append(round).append(" "); + playerResult.append('R').append(round).append(' '); playerResult.append(getMatchResultString(tournamentPlayer, opponentPlayer, pair.getMatch())); return playerResult.toString(); } @@ -352,9 +352,9 @@ public abstract class TournamentImpl implements Tournament { matchResult.append(mp1.getPlayer().hasIdleTimeout() ? "I" : (mp1.getPlayer().hasTimerTimeout() ? "T" : "Q")); } if (match.getDraws() > 0) { - matchResult.append("-").append(match.getDraws()); + matchResult.append('-').append(match.getDraws()); } - matchResult.append("-").append(mp2.getWins()); + matchResult.append('-').append(mp2.getWins()); if (mp2.hasQuit()) { matchResult.append(mp2.getPlayer().hasIdleTimeout() ? "I" : (mp2.getPlayer().hasTimerTimeout() ? "T" : "Q")); } diff --git a/Mage/src/main/java/mage/game/turn/Turn.java b/Mage/src/main/java/mage/game/turn/Turn.java index bf2dc0a872..c4c635b278 100644 --- a/Mage/src/main/java/mage/game/turn/Turn.java +++ b/Mage/src/main/java/mage/game/turn/Turn.java @@ -328,17 +328,17 @@ public class Turn implements Serializable { public String getValue(int turnNum) { StringBuilder sb = threadLocalBuilder.get(); - sb.append("[").append(turnNum) - .append(":").append(currentPhase.getType()) - .append(":").append(currentPhase.getStep().getType()) - .append("]"); + sb.append('[').append(turnNum) + .append(':').append(currentPhase.getType()) + .append(':').append(currentPhase.getStep().getType()) + .append(']'); return sb.toString(); } private void logStartOfTurn(Game game, Player player) { StringBuilder sb = new StringBuilder(game.getState().isExtraTurn() ? "Extra turn" : "Turn "); - sb.append(game.getState().getTurnNum()).append(" "); + sb.append(game.getState().getTurnNum()).append(' '); sb.append(player.getLogName()); sb.append(" ("); int delimiter = game.getPlayers().size() - 1; @@ -346,14 +346,14 @@ public class Turn implements Serializable { sb.append(gamePlayer.getLife()); int poison = gamePlayer.getCounters().getCount(CounterType.POISON); if (poison > 0) { - sb.append("[P:").append(poison).append("]"); + sb.append("[P:").append(poison).append(']'); } if (delimiter > 0) { sb.append(" - "); delimiter--; } } - sb.append(")"); + sb.append(')'); game.fireStatusEvent(sb.toString(), true); } } diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 0b84f713b1..f9bc0cb6ae 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -944,7 +944,7 @@ public abstract class PlayerImpl implements Player, Serializable { result = cast(card.getSpellAbility(), game, noMana); } if (!result) { - game.informPlayer(this, "You can't play " + card.getIdName() + "."); + game.informPlayer(this, "You can't play " + card.getIdName() + '.'); } return result; } @@ -1504,7 +1504,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (effectSource != null) { sb.append(" from ").append(effectSource.getLogName()); } - sb.append(")"); + sb.append(')'); filter.setMessage(sb.toString()); Target target = new TargetPermanent(1, 1, filter, true); if (!this.chooseTarget(Outcome.Untap, target, ability, game)) { @@ -3217,7 +3217,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (!game.isSimulation()) { game.informPlayers(getLogName() + " puts " + (withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card")) - + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " + + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' + (card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand") ); } @@ -3306,8 +3306,8 @@ public abstract class PlayerImpl implements Player, Serializable { card = game.getCard(card.getId()); } StringBuilder sb = new StringBuilder(this.getLogName()) - .append(" puts ").append(card.getLogName()).append(" ").append(card.isCopy() ? "(Copy) " : "") - .append(fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " : ""); + .append(" puts ").append(card.getLogName()).append(' ').append(card.isCopy() ? "(Copy) " : "") + .append(fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' : ""); if (card.getOwnerId().equals(getId())) { sb.append("into his or her graveyard"); } else { @@ -3332,9 +3332,9 @@ public abstract class PlayerImpl implements Player, Serializable { card = game.getCard(card.getId()); } StringBuilder sb = new StringBuilder(this.getLogName()) - .append(" puts ").append(withName ? card.getLogName() : "a card").append(" "); + .append(" puts ").append(withName ? card.getLogName() : "a card").append(' '); if (fromZone != null) { - sb.append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" "); + sb.append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(' '); } sb.append("to the ").append(toTop ? "top" : "bottom"); if (card.getOwnerId().equals(getId())) { @@ -3367,8 +3367,8 @@ public abstract class PlayerImpl implements Player, Serializable { card = basicCard; } } - game.informPlayers(this.getLogName() + " moves " + (withName ? card.getLogName() + (card.isCopy() ? " (Copy)" : "") : "a card face down") + " " - + (fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " : "") + "to the exile zone"); + game.informPlayers(this.getLogName() + " moves " + (withName ? card.getLogName() + (card.isCopy() ? " (Copy)" : "") : "a card face down") + ' ' + + (fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' : "") + "to the exile zone"); } result = true; } diff --git a/Mage/src/main/java/mage/target/TargetImpl.java b/Mage/src/main/java/mage/target/TargetImpl.java index 0bd012dd1b..38996f4128 100644 --- a/Mage/src/main/java/mage/target/TargetImpl.java +++ b/Mage/src/main/java/mage/target/TargetImpl.java @@ -132,9 +132,9 @@ public abstract class TargetImpl implements Target { StringBuilder sb = new StringBuilder(); sb.append("Select ").append(targetName); if (getMaxNumberOfTargets() > 0 && getMaxNumberOfTargets() != Integer.MAX_VALUE) { - sb.append(" (").append(targets.size()).append("/").append(getMaxNumberOfTargets()).append(")"); + sb.append(" (").append(targets.size()).append('/').append(getMaxNumberOfTargets()).append(')'); } else { - sb.append(" (").append(targets.size()).append(")"); + sb.append(" (").append(targets.size()).append(')'); } sb.append(suffix); return sb.toString(); diff --git a/Mage/src/main/java/mage/target/TargetObject.java b/Mage/src/main/java/mage/target/TargetObject.java index bc34fea778..1066f80d14 100644 --- a/Mage/src/main/java/mage/target/TargetObject.java +++ b/Mage/src/main/java/mage/target/TargetObject.java @@ -69,7 +69,7 @@ public abstract class TargetObject extends TargetImpl { for (UUID targetId: getTargets()) { MageObject object = game.getObject(targetId); if (object != null) { - sb.append(object.getLogName()).append(" "); + sb.append(object.getLogName()).append(' '); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/TargetPlayer.java b/Mage/src/main/java/mage/target/TargetPlayer.java index 64430423e6..d70085d98a 100644 --- a/Mage/src/main/java/mage/target/TargetPlayer.java +++ b/Mage/src/main/java/mage/target/TargetPlayer.java @@ -197,7 +197,7 @@ public class TargetPlayer extends TargetImpl { for (UUID targetId : getTargets()) { Player player = game.getPlayer(targetId); if (player != null) { - sb.append(player.getLogName()).append(" "); + sb.append(player.getLogName()).append(' '); } else { sb.append("[target missing]"); } diff --git a/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java b/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java index 1ed9374721..5056610f74 100644 --- a/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java +++ b/Mage/src/main/java/mage/target/common/TargetActivatedAbility.java @@ -115,10 +115,10 @@ public class TargetActivatedAbility extends TargetObject { for (UUID targetId : getTargets()) { StackAbility object = (StackAbility) game.getObject(targetId); if (object != null) { - sb.append(object.getRule()).append(" "); + sb.append(object.getRule()).append(' '); } } - sb.append(")"); + sb.append(')'); return sb.toString(); } } diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java index 1cefb2098f..b373715695 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java +++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlaneswalkerAmount.java @@ -165,7 +165,7 @@ for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); + sb.append(permanent.getLogName()).append('(').append(getTargetAmount(targetId)).append(") "); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java index a7a3b87318..54151a5b88 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java +++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayer.java @@ -229,11 +229,11 @@ public class TargetCreatureOrPlayer extends TargetImpl { for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append(" "); + sb.append(permanent.getLogName()).append(' '); } else { Player player = game.getPlayer(targetId); if (player != null) { - sb.append(player.getLogName()).append(" "); + sb.append(player.getLogName()).append(' '); } } } diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java index 1c7d8b970e..60a8d04ee7 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java +++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java @@ -201,10 +201,10 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); + sb.append(permanent.getLogName()).append('(').append(getTargetAmount(targetId)).append(") "); } else { Player player = game.getPlayer(targetId); - sb.append(player.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); + sb.append(player.getLogName()).append('(').append(getTargetAmount(targetId)).append(") "); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java index 430126b7db..06491ad922 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java +++ b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java @@ -163,7 +163,7 @@ public class TargetCreaturePermanentAmount extends TargetAmount { for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); + sb.append(permanent.getLogName()).append('(').append(getTargetAmount(targetId)).append(") "); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/common/TargetDefender.java b/Mage/src/main/java/mage/target/common/TargetDefender.java index 55717c19ac..24f8ace2c2 100644 --- a/Mage/src/main/java/mage/target/common/TargetDefender.java +++ b/Mage/src/main/java/mage/target/common/TargetDefender.java @@ -170,11 +170,11 @@ public class TargetDefender extends TargetImpl { for (UUID targetId: getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getName()).append(" "); + sb.append(permanent.getName()).append(' '); } else { Player player = game.getPlayer(targetId); - sb.append(player.getLogName()).append(" "); + sb.append(player.getLogName()).append(' '); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java index c7317b02c4..0555610187 100644 --- a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java +++ b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java @@ -242,11 +242,11 @@ public class TargetPermanentOrPlayer extends TargetImpl { for (UUID targetId: getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append(" "); + sb.append(permanent.getLogName()).append(' '); } else { Player player = game.getPlayer(targetId); - sb.append(player.getLogName()).append(" "); + sb.append(player.getLogName()).append(' '); } } return sb.toString(); diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentOrSuspendedCard.java b/Mage/src/main/java/mage/target/common/TargetPermanentOrSuspendedCard.java index 40022b8909..470472c495 100644 --- a/Mage/src/main/java/mage/target/common/TargetPermanentOrSuspendedCard.java +++ b/Mage/src/main/java/mage/target/common/TargetPermanentOrSuspendedCard.java @@ -158,11 +158,11 @@ public class TargetPermanentOrSuspendedCard extends TargetImpl { for (UUID targetId : this.getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append(" "); + sb.append(permanent.getLogName()).append(' '); } else { Card card = game.getExile().getCard(targetId, game); if (card != null) { - sb.append(card.getLogName()).append(" "); + sb.append(card.getLogName()).append(' '); } } } diff --git a/Mage/src/main/java/mage/target/common/TargetSpellOrPermanent.java b/Mage/src/main/java/mage/target/common/TargetSpellOrPermanent.java index 95e612cd82..50ced1b860 100644 --- a/Mage/src/main/java/mage/target/common/TargetSpellOrPermanent.java +++ b/Mage/src/main/java/mage/target/common/TargetSpellOrPermanent.java @@ -245,13 +245,13 @@ public class TargetSpellOrPermanent extends TargetImpl { for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - sb.append(permanent.getLogName()).append(" "); + sb.append(permanent.getLogName()).append(' '); } else { Spell spell = game.getStack().getSpell(targetId); if (spell.isFaceDown(game)) { sb.append(GameLog.getNeutralColoredText("face down spell")); } else { - sb.append(spell.getLogName()).append(" "); + sb.append(spell.getLogName()).append(' '); } } } diff --git a/Mage/src/main/java/mage/util/ClassScanner.java b/Mage/src/main/java/mage/util/ClassScanner.java index ad672ca1a7..dd1987b542 100644 --- a/Mage/src/main/java/mage/util/ClassScanner.java +++ b/Mage/src/main/java/mage/util/ClassScanner.java @@ -69,7 +69,7 @@ public class ClassScanner { URL resource = resources.nextElement(); String filePath = resource.getFile(); if (filePath.startsWith("file:")) { - filePath = filePath.substring("file:".length(), filePath.lastIndexOf("!")); + filePath = filePath.substring("file:".length(), filePath.lastIndexOf('!')); jars.add(filePath); } else { dirs.put(filePath, packageName); diff --git a/Mage/src/main/java/mage/util/DateFormat.java b/Mage/src/main/java/mage/util/DateFormat.java index 83252544df..2bd324e85c 100644 --- a/Mage/src/main/java/mage/util/DateFormat.java +++ b/Mage/src/main/java/mage/util/DateFormat.java @@ -61,13 +61,13 @@ public class DateFormat { seconds = seconds % 3600; long m = seconds / 60; long s = seconds % 60; - sb.append(h).append(":"); + sb.append(h).append(':'); if (m<10) { - sb.append("0"); + sb.append('0'); } - sb.append(m).append(":"); + sb.append(m).append(':'); if (s<10) { - sb.append("0"); + sb.append('0'); } sb.append(s); return sb.toString(); diff --git a/Mage/src/main/java/mage/util/ManaUtil.java b/Mage/src/main/java/mage/util/ManaUtil.java index b617d82a04..2221ebf406 100644 --- a/Mage/src/main/java/mage/util/ManaUtil.java +++ b/Mage/src/main/java/mage/util/ManaUtil.java @@ -468,7 +468,7 @@ public class ManaUtil { // Combine the cost back as a mana string StringBuilder sb = new StringBuilder(); for (String s : finalCost) { - sb.append("{" + s + "}"); + sb.append('{' + s + '}'); } // Return the condensed string return sb.toString(); diff --git a/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java b/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java index e458b1d756..3f4b4f90fd 100644 --- a/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java @@ -110,15 +110,15 @@ public class CommanderInfoWatcher extends Watcher { sb.append("Commander"); Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount"); if (castCount != null) { - sb.append(" ").append(castCount).append(castCount == 1 ? " time" : " times").append(" casted from the command zone."); + sb.append(' ').append(castCount).append(castCount == 1 ? " time" : " times").append(" casted from the command zone."); } this.addInfo(object, "Commander", sb.toString(), game); if (checkCommanderDamage) { for (Map.Entry entry : damageToPlayer.entrySet()) { Player damagedPlayer = game.getPlayer(entry.getKey()); - sb.append("Commander did ").append(entry.getValue()).append(" combat damage to player ").append(damagedPlayer.getLogName()).append("."); + sb.append("Commander did ").append(entry.getValue()).append(" combat damage to player ").append(damagedPlayer.getLogName()).append('.'); this.addInfo(object, "Commander" + entry.getKey(), - "Commander did " + entry.getValue() + " combat damage to player " + damagedPlayer.getLogName() + ".", game); + "Commander did " + entry.getValue() + " combat damage to player " + damagedPlayer.getLogName() + '.', game); } } }