diff --git a/Mage.Client/src/main/java/mage/client/SessionHandler.java b/Mage.Client/src/main/java/mage/client/SessionHandler.java index 74930a76df..f82c485e88 100644 --- a/Mage.Client/src/main/java/mage/client/SessionHandler.java +++ b/Mage.Client/src/main/java/mage/client/SessionHandler.java @@ -20,7 +20,7 @@ import mage.view.*; /** * Created by IGOUDT on 15-9-2016. */ -public class SessionHandler { +public final class SessionHandler { private static Session session; diff --git a/Mage.Client/src/main/java/mage/client/chat/LocalCommands.java b/Mage.Client/src/main/java/mage/client/chat/LocalCommands.java index ec854cad40..f7e03f4e9c 100644 --- a/Mage.Client/src/main/java/mage/client/chat/LocalCommands.java +++ b/Mage.Client/src/main/java/mage/client/chat/LocalCommands.java @@ -12,7 +12,7 @@ import java.util.Optional; import java.util.StringTokenizer; import java.util.UUID; -public class LocalCommands { +public final class LocalCommands { private static final DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT); diff --git a/Mage.Client/src/main/java/mage/client/components/MageRoundPane.java b/Mage.Client/src/main/java/mage/client/components/MageRoundPane.java index 4d318a7bed..914f1bce76 100644 --- a/Mage.Client/src/main/java/mage/client/components/MageRoundPane.java +++ b/Mage.Client/src/main/java/mage/client/components/MageRoundPane.java @@ -26,7 +26,7 @@ public class MageRoundPane extends JPanel { private int Y_OFFSET = 30; private final Color defaultBackgroundColor = new Color(141, 130, 112, 200); private Color backgroundColor = defaultBackgroundColor; - private final int alpha = 0; + private static final int alpha = 0; private static final Map SHADOW_IMAGE_CACHE; private static final Map IMAGE_CACHE; diff --git a/Mage.Client/src/main/java/mage/client/components/ability/BackgroundPainter.java b/Mage.Client/src/main/java/mage/client/components/ability/BackgroundPainter.java index f374b2efcf..d87f2c7057 100644 --- a/Mage.Client/src/main/java/mage/client/components/ability/BackgroundPainter.java +++ b/Mage.Client/src/main/java/mage/client/components/ability/BackgroundPainter.java @@ -16,7 +16,7 @@ public class BackgroundPainter extends AbstractPainter { private final Color bgColor = Color.black; - final float bgalpha = 0.6f; + static final float bgalpha = 0.6f; public BackgroundPainter() { super(); diff --git a/Mage.Client/src/main/java/mage/client/components/ext/TestMageFloatPane.java b/Mage.Client/src/main/java/mage/client/components/ext/TestMageFloatPane.java index a8a684bc59..461ce022da 100644 --- a/Mage.Client/src/main/java/mage/client/components/ext/TestMageFloatPane.java +++ b/Mage.Client/src/main/java/mage/client/components/ext/TestMageFloatPane.java @@ -7,7 +7,7 @@ import javax.swing.*; /** * @author ayratn */ -public class TestMageFloatPane { +public final class TestMageFloatPane { public static void main(String... args) { JFrame f = new JFrame(); diff --git a/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogContainer.java b/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogContainer.java index bacdbd0956..e0f6d37dac 100644 --- a/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogContainer.java +++ b/Mage.Client/src/main/java/mage/client/components/ext/dlg/DialogContainer.java @@ -22,7 +22,7 @@ public class DialogContainer extends JPanel { private Color backgroundColor = new Color(0, 255, 255, 60); private int alpha = 50; - private final boolean isGradient = false; + private static final boolean isGradient = false; private final TexturePaint tp = null; private final Image gradient = null; private BufferedImage b; diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java index 1da57aa847..ed73fbf9b6 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java @@ -52,7 +52,7 @@ import mage.util.TournamentUtil; * @author nantuko * @author Simown */ -public class DeckGenerator { +public final class DeckGenerator { public static class DeckGeneratorException extends RuntimeException { 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 241dcc25e4..64fdad5015 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/DeckArea.java @@ -62,7 +62,7 @@ public class DeckArea extends javax.swing.JPanel { private BigCard lastBigCard = null; private int dividerLocationNormal = 0; private int dividerLocationLimited = 0; - private final boolean isLimitedBuildingOrientation = false; + private static final boolean isLimitedBuildingOrientation = false; public DeckCardLayout getCardLayout() { return deckList.getCardLayout(); diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPanel.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPanel.java index 3e09760bb3..e3137ee353 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPanel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPanel.java @@ -57,7 +57,7 @@ public final class CollectionViewerPanel extends JPanel { private static final Logger logger = Logger.getLogger(CollectionViewerPanel.class); protected static final String LAYOYT_CONFIG_KEY = "collectionViewerLayoutConfig"; - protected static final String FORMAT_CONFIG_KEY = "collectionViewerFormat"; + private static final String FORMAT_CONFIG_KEY = "collectionViewerFormat"; public CollectionViewerPanel() { initComponents(); diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java index 89554efe22..1bad0df4a1 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/MageBook.java @@ -346,7 +346,7 @@ public class MageBook extends JComponent { /** * Defines the position of the next card on the mage book */ - private static class CardPosition { + private static final class CardPosition { private CardPosition() { } 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 67126f9170..3fc60f7426 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 @@ -37,7 +37,7 @@ import mage.view.CardView; * * @author nantuko */ -public class CardHelper { +public final class CardHelper { private CardHelper() { } 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 7807ba1e51..dd6caba68c 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -86,8 +86,8 @@ public class NewTournamentDialog extends MageDialog { private JTextArea txtRandomPacks; private final List players = new ArrayList<>(); private final List packs = new ArrayList<>(); - private final int CONSTRUCTION_TIME_MIN = 6; - private final int CONSTRUCTION_TIME_MAX = 30; + private static final int CONSTRUCTION_TIME_MIN = 6; + private static final int CONSTRUCTION_TIME_MAX = 30; private boolean isRandom = false; private boolean isRichMan = false; private String cubeFromDeckFilename = ""; 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 64f200a28f..1566c8c5bf 100644 --- a/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java +++ b/Mage.Client/src/main/java/mage/client/preference/MagePreferences.java @@ -8,7 +8,7 @@ import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; // TODO: Move all preference related logic from MageFrame and PreferencesDialog to this class. -public class MagePreferences { +public final class MagePreferences { private static final String KEY_SERVER_ADDRESS = "serverAddress"; private static final String KEY_SERVER_PORT = "serverPort"; 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 7ab38acb40..70b69c2615 100644 --- a/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/CardsViewUtil.java @@ -39,7 +39,7 @@ import mage.view.*; * * @author BetaSteward_at_googlemail.com */ -public class CardsViewUtil { +public final class CardsViewUtil { public static CardsView convertSimple(SimpleCardsView view) { CardsView cards = new CardsView(); diff --git a/Mage.Client/src/main/java/mage/client/util/Config.java b/Mage.Client/src/main/java/mage/client/util/Config.java index 910b7af07b..29a6b9b3f8 100644 --- a/Mage.Client/src/main/java/mage/client/util/Config.java +++ b/Mage.Client/src/main/java/mage/client/util/Config.java @@ -38,7 +38,7 @@ import org.apache.log4j.Logger; * * @author BetaSteward_at_googlemail.com */ -public class Config { +public final class Config { // TODO: Remove this class completely private static final Logger logger = Logger.getLogger(Config.class); diff --git a/Mage.Client/src/main/java/mage/client/util/DeckUtil.java b/Mage.Client/src/main/java/mage/client/util/DeckUtil.java index a085522290..ba0ef5879f 100644 --- a/Mage.Client/src/main/java/mage/client/util/DeckUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/DeckUtil.java @@ -41,7 +41,7 @@ import org.apache.log4j.Logger; * * @author nantuko */ -public class DeckUtil { +public final class DeckUtil { private static final Logger log = Logger.getLogger(DeckUtil.class); 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 492c10f6ee..03fe6f057c 100644 --- a/Mage.Client/src/main/java/mage/client/util/Format.java +++ b/Mage.Client/src/main/java/mage/client/util/Format.java @@ -34,7 +34,7 @@ import java.util.Date; * * @author LevelX2 */ -public class Format { +public final class Format { /** * calculates the duration between two dates and returns a string in the format hhh:mm:ss diff --git a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java index ea774ec703..790fe34e03 100644 --- a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java +++ b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java @@ -19,7 +19,7 @@ import org.mage.card.arcane.CardRenderer; * * @author LevelX2 */ -public class GUISizeHelper { +public final class GUISizeHelper { // relate the native image card size to a value of the size scale final static int CARD_IMAGE_WIDTH = 312; diff --git a/Mage.Client/src/main/java/mage/client/util/IgnoreList.java b/Mage.Client/src/main/java/mage/client/util/IgnoreList.java index 6c020518d0..8b0125dfd5 100644 --- a/Mage.Client/src/main/java/mage/client/util/IgnoreList.java +++ b/Mage.Client/src/main/java/mage/client/util/IgnoreList.java @@ -8,7 +8,7 @@ import mage.view.ChatMessage; import java.util.Arrays; import java.util.Set; -public class IgnoreList { +public final class IgnoreList { private static final String USAGE = "
\\ignore - shows current ignore list on this server." + "
\\ignore [username] - add a username to your ignore list on this server." diff --git a/Mage.Client/src/main/java/mage/client/util/ImageCaches.java b/Mage.Client/src/main/java/mage/client/util/ImageCaches.java index 84a93a5f9f..c8676168f9 100644 --- a/Mage.Client/src/main/java/mage/client/util/ImageCaches.java +++ b/Mage.Client/src/main/java/mage/client/util/ImageCaches.java @@ -34,7 +34,7 @@ import java.util.Map; * * @author draxdyn */ -public class ImageCaches { +public final class ImageCaches { private final static ArrayList IMAGE_CACHES; diff --git a/Mage.Client/src/main/java/mage/client/util/ImageHelper.java b/Mage.Client/src/main/java/mage/client/util/ImageHelper.java index dfb6340b33..05eecea9a1 100644 --- a/Mage.Client/src/main/java/mage/client/util/ImageHelper.java +++ b/Mage.Client/src/main/java/mage/client/util/ImageHelper.java @@ -47,7 +47,7 @@ import org.mage.card.arcane.UI; * * @author BetaSteward_at_googlemail.com */ -public class ImageHelper { +public final class ImageHelper { protected static final HashMap images = new HashMap<>(); protected static final HashMap backgrounds = new HashMap<>(); diff --git a/Mage.Client/src/main/java/mage/client/util/SystemUtil.java b/Mage.Client/src/main/java/mage/client/util/SystemUtil.java index 6dd4e476b6..20b9b6a9bf 100644 --- a/Mage.Client/src/main/java/mage/client/util/SystemUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/SystemUtil.java @@ -6,7 +6,7 @@ import java.lang.reflect.Method; /** * @author noxx */ -public class SystemUtil { +public final class SystemUtil { public static final String OS_NAME = "os.name"; public static final String MAC_OS_X = "Mac OS X"; diff --git a/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java b/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java index 285512c072..b8abf2e553 100644 --- a/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java +++ b/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java @@ -20,7 +20,7 @@ import java.util.Map; * * @author user */ -public class TransformedImageCache { +public final class TransformedImageCache { private final static class Key { @@ -68,7 +68,7 @@ public class TransformedImageCache { } } - static final Map> IMAGE_CACHE; + private static final Map> IMAGE_CACHE; static { // TODO: can we use a single map? @@ -85,17 +85,17 @@ public class TransformedImageCache { private static BufferedImage rotateImage(BufferedImage image, double angle) { double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle)); - int w = image.getWidth(), h = image.getHeight(); - int neww = (int) Math.floor(w * cos + h * sin), newh = (int) Math.floor(h * cos + w * sin); + int width = image.getWidth(), height = image.getHeight(); + int newWidth = (int) Math.floor(width * cos + height * sin), newHeight = (int) Math.floor(height * cos + width * sin); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gs.getDefaultConfiguration(); - BufferedImage result = gc.createCompatibleImage(neww, newh, Transparency.TRANSLUCENT); + BufferedImage result = gc.createCompatibleImage(newWidth, newHeight, Transparency.TRANSLUCENT); Graphics2D g = result.createGraphics(); - g.translate((neww - w) / 2, (newh - h) / 2); - g.rotate(angle, w / 2, h / 2); + g.translate((newWidth - width) / 2, (newHeight - height) / 2); + g.rotate(angle, width / 2, height / 2); g.drawRenderedImage(image, null); g.dispose(); return result; diff --git a/Mage.Client/src/main/java/mage/client/util/gui/ArrowUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/ArrowUtil.java index 917107e219..4ae006b7d4 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/ArrowUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/ArrowUtil.java @@ -14,7 +14,7 @@ import java.util.UUID; /** * @author noxx */ -public class ArrowUtil { +public final class ArrowUtil { private ArrowUtil() {} 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 f70bd5ec0e..be9962056f 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 @@ -26,7 +26,7 @@ import org.jdesktop.swingx.JXPanel; import org.mage.card.arcane.ManaSymbols; import org.mage.card.arcane.UI; -public class GuiDisplayUtil { +public final class GuiDisplayUtil { private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15); private static final Insets DEFAULT_INSETS = new Insets(0, 0, 70, 25); 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 01c77482b0..7bf6d5b1ae 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 @@ -13,7 +13,7 @@ import mage.client.dialog.PreferencesDialog; * * @author LevelX2 */ -public class TableUtil { +public final class TableUtil { /** * diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryUtil.java index 980f369244..e167eff5b5 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryUtil.java @@ -18,7 +18,7 @@ import org.apache.log4j.Logger; * * @author LevelX2 */ -public class CountryUtil { +public final class CountryUtil { private static final Logger LOGGER = Logger.getLogger(CountryUtil.class); private static final Map FLAG_ICON_CACHE = new HashMap<>(); 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 f8bb49615a..397da1cff0 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 @@ -13,7 +13,7 @@ import java.util.Calendar; * * @author ayrat */ -public class SaveObjectUtil { +public final class SaveObjectUtil { /** * Defines should data be saved or not. diff --git a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java index a208a8b7ab..b640998301 100644 --- a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java +++ b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java @@ -16,7 +16,7 @@ import mage.deck.Standard; * * @author nantuko */ -public class ConstructedFormats { +public final class ConstructedFormats { public static final String ALL = "- All Sets"; public static final String STANDARD = "- Standard"; diff --git a/Mage.Client/src/main/java/mage/client/util/stats/MemoryUsageStatUtil.java b/Mage.Client/src/main/java/mage/client/util/stats/MemoryUsageStatUtil.java index 4c7834bcb8..900b284fa9 100644 --- a/Mage.Client/src/main/java/mage/client/util/stats/MemoryUsageStatUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/stats/MemoryUsageStatUtil.java @@ -3,7 +3,7 @@ package mage.client.util.stats; /** * @author noxx */ -public class MemoryUsageStatUtil { +public final class MemoryUsageStatUtil { private MemoryUsageStatUtil() {} diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java index 94ca7ef830..e5b6242dd5 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardRendererUtils.java @@ -22,7 +22,7 @@ import java.util.regex.Pattern; * * Various static utilities for use in the card renderer */ -public class CardRendererUtils { +public final class CardRendererUtils { /** * Convert an abstract image, whose underlying implementation may or may not 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 fdc1b195c3..93d5494b38 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 @@ -31,7 +31,7 @@ import mage.client.util.gui.BufferedImageBuilder; import org.apache.log4j.Logger; import org.mage.plugins.card.constants.Constants; -public class ManaSymbols { +public final class ManaSymbols { private static final Logger LOGGER = Logger.getLogger(ManaSymbols.class); private static final Map> manaImages = new HashMap<>(); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/TextboxRuleParser.java b/Mage.Client/src/main/java/org/mage/card/arcane/TextboxRuleParser.java index ad040a594e..63c91b1490 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/TextboxRuleParser.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/TextboxRuleParser.java @@ -18,7 +18,7 @@ import org.apache.log4j.Logger; * * @author StravantUser */ -public class TextboxRuleParser { +public final class TextboxRuleParser { private static final Logger LOGGER = Logger.getLogger(CardPanel.class); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/UI.java b/Mage.Client/src/main/java/org/mage/card/arcane/UI.java index 4c9d2324ef..e701cce8a0 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/UI.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/UI.java @@ -46,7 +46,7 @@ import javax.swing.text.html.ImageView; /** * UI utility functions. */ -public class UI { +public final class UI { private static final ConcurrentMap imageCache = new ConcurrentHashMap<>(); public static JToggleButton getToggleButton () { diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/Util.java b/Mage.Client/src/main/java/org/mage/card/arcane/Util.java index e04fb38bb5..87d9192044 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/Util.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/Util.java @@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit; import javax.swing.SwingUtilities; @SuppressWarnings({ "rawtypes", "unchecked" }) -public class Util { +public final class Util { public static final boolean isMac = System.getProperty("os.name").toLowerCase().contains("mac"); public static final boolean isWindows = !System.getProperty("os.name").toLowerCase().contains("windows"); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java index f41304525f..3601348589 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java @@ -68,12 +68,12 @@ public class CardPluginImpl implements CardPlugin { private static final float STACK_SPACING_Y = 0.10f; private static final float ATTACHMENT_SPACING_Y = 0.13f; - private final int landStackMax = 5; + private static final int landStackMax = 5; // private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width; private int cardWidthMin = (int) GUISizeHelper.battlefieldCardMinDimension.getWidth(); private int cardWidthMax = (int) GUISizeHelper.battlefieldCardMaxDimension.getWidth(); - private final boolean stackVertical = false; + private static final boolean stackVertical = false; private int playAreaWidth, playAreaHeight; private int cardWidth, cardHeight; 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 c5ed731747..cbf5eb1880 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 @@ -3,7 +3,7 @@ package org.mage.plugins.card.constants; import java.awt.Rectangle; import java.io.File; -public class Constants { +public final class Constants { public static final String RESOURCE_PATH_SET = File.separator + "sets" + File.separator; 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 ed67783972..37c9f07e31 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 @@ -15,7 +15,7 @@ import org.apache.log4j.Logger; import org.mage.plugins.card.images.CardDownloadData; import org.mage.plugins.card.properties.SettingsManager; -public class CardImageUtils { +public final class CardImageUtils { private static final HashMap pathCache = new HashMap<>(); private static final Logger log = Logger.getLogger(CardImageUtils.class); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/Transparency.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/Transparency.java index 4a62f27025..a1feeff319 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/Transparency.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/Transparency.java @@ -11,14 +11,14 @@ import java.awt.image.ImageFilter; import java.awt.image.ImageProducer; import java.awt.image.RGBImageFilter; -public class Transparency { +public final class Transparency { public static Image makeColorTransparent(Image im, final Color color) { ImageFilter filter = new RGBImageFilter() { // the color we are looking for... Alpha bits are set to opaque public final int markerRGB = color.getRGB() | 0xFF000000; @Override - public final int filterRGB(int x, int y, int rgb) { + public int filterRGB(int x, int y, int rgb) { if ((rgb | 0xFF000000) == markerRGB) { // Mark the alpha bits as zero - transparent return 0x00FFFFFF & rgb; diff --git a/Mage.Common/src/mage/db/EntityManagerTest.java b/Mage.Common/src/mage/db/EntityManagerTest.java index 339c20ad56..38bba68a29 100644 --- a/Mage.Common/src/mage/db/EntityManagerTest.java +++ b/Mage.Common/src/mage/db/EntityManagerTest.java @@ -10,7 +10,7 @@ import java.util.List; /** * @author noxx */ -public class EntityManagerTest { +public final class EntityManagerTest { private static DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.FULL); diff --git a/Mage.Common/src/mage/db/Statistics.java b/Mage.Common/src/mage/db/Statistics.java index 489ef89110..aaa36896db 100644 --- a/Mage.Common/src/mage/db/Statistics.java +++ b/Mage.Common/src/mage/db/Statistics.java @@ -7,7 +7,7 @@ import java.util.*; /** * @author noxx */ -public class Statistics { +public final class Statistics { public static void main(String[] args) throws Exception { List logs = EntityManager.instance.getAllLogs(); diff --git a/Mage.Common/src/mage/utils/CardUtil.java b/Mage.Common/src/mage/utils/CardUtil.java index 8b4f6e7d03..258393b04e 100644 --- a/Mage.Common/src/mage/utils/CardUtil.java +++ b/Mage.Common/src/mage/utils/CardUtil.java @@ -13,7 +13,7 @@ import mage.view.CardView; * @version 0.1 02.11.2010 * @author nantuko */ -public class CardUtil { +public final class CardUtil { private static final String regexBlack = ".*\\x7b.{0,2}B.{0,2}\\x7d.*"; private static final String regexBlue = ".*\\x7b.{0,2}U.{0,2}\\x7d.*"; diff --git a/Mage.Common/src/mage/utils/CompressUtil.java b/Mage.Common/src/mage/utils/CompressUtil.java index 0ec83936cb..39fa5fdf6d 100644 --- a/Mage.Common/src/mage/utils/CompressUtil.java +++ b/Mage.Common/src/mage/utils/CompressUtil.java @@ -8,7 +8,7 @@ import mage.remote.traffic.ZippedObjectImpl; * * @author ayrat */ -public class CompressUtil { +public final class CompressUtil { /** * Defines should data be compressed or not. True by default. Read from diff --git a/Mage.Common/src/mage/utils/DeckBuilder.java b/Mage.Common/src/mage/utils/DeckBuilder.java index 0d4b4482ad..55760f7d28 100644 --- a/Mage.Common/src/mage/utils/DeckBuilder.java +++ b/Mage.Common/src/mage/utils/DeckBuilder.java @@ -21,7 +21,7 @@ import mage.util.RandomUtil; * * @author nantuko */ -public class DeckBuilder { +public final class DeckBuilder { private static final int DECK_COUNT40[] = {3, 6, 6, 4, 3, 2}; private static final int DECK_COUNT60[] = {4, 9, 9, 5, 5, 3}; diff --git a/Mage.Common/src/mage/utils/ThreadUtils.java b/Mage.Common/src/mage/utils/ThreadUtils.java index 2bfb2a0b56..73b3de89e4 100644 --- a/Mage.Common/src/mage/utils/ThreadUtils.java +++ b/Mage.Common/src/mage/utils/ThreadUtils.java @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit; * @author ayrat */ @SuppressWarnings("unchecked") -public class ThreadUtils { +public final class ThreadUtils { public static final ThreadPoolExecutor threadPool; public static final ThreadPoolExecutor threadPool2; diff --git a/Mage.Common/src/mage/utils/properties/PropertiesUtil.java b/Mage.Common/src/mage/utils/properties/PropertiesUtil.java index 1ffa89c8b5..a3c40b52a3 100644 --- a/Mage.Common/src/mage/utils/properties/PropertiesUtil.java +++ b/Mage.Common/src/mage/utils/properties/PropertiesUtil.java @@ -9,7 +9,7 @@ import java.util.Properties; /** * @author noxx */ -public class PropertiesUtil { +public final class PropertiesUtil { private static final Logger logger = Logger.getLogger(PropertiesUtil.class); diff --git a/Mage.Common/src/mage/utils/properties/PropertyKeys.java b/Mage.Common/src/mage/utils/properties/PropertyKeys.java index 01802e5489..15b3f72dc9 100644 --- a/Mage.Common/src/mage/utils/properties/PropertyKeys.java +++ b/Mage.Common/src/mage/utils/properties/PropertyKeys.java @@ -3,7 +3,7 @@ package mage.utils.properties; /** * @author noxx */ -public class PropertyKeys { +public final class PropertyKeys { public static final String KEY_DB_LOG_URL = "db.log.url"; public static final String KEY_DB_FEEDBACK_URL = "db.feedback.url"; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java index 55d87f6914..b3757a49a3 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java @@ -40,7 +40,7 @@ import java.util.Properties; * * @author BetaSteward_at_googlemail.com */ -public class Config2 { +public final class Config2 { private static final Logger logger = Logger.getLogger(Config2.class); 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 7c762ebe3d..09f8b29123 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 @@ -18,7 +18,7 @@ import org.apache.log4j.Logger; * this evaluator is only good for two player games * */ -public class GameStateEvaluator2 { +public final class GameStateEvaluator2 { private static final Logger logger = Logger.getLogger(GameStateEvaluator2.class); diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java index 2e3d0d8ccc..3c80b69c65 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java @@ -14,7 +14,7 @@ import mage.game.permanent.Permanent; /** * @author ubeefx, nantuko */ -public class ArtificialScoringSystem { +public final class ArtificialScoringSystem { public static final int WIN_GAME_SCORE = 100000000; public static final int LOSE_GAME_SCORE = -WIN_GAME_SCORE; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java index 8e8cee738c..bb854bf370 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java @@ -9,7 +9,7 @@ import java.util.Map; /** * @author nantuko */ -public class MagicAbility { +public final class MagicAbility { private static Map scores = new HashMap() {{ put(DeathtouchAbility.getInstance().getRule(), 60); 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 3ea315a049..889f4eefe9 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 @@ -21,7 +21,7 @@ import java.util.*; * * @author noxx */ -public class CombatUtil { +public final class CombatUtil { private static final List emptyList = new ArrayList(); diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java index 2bb13cb4a4..faec662ba7 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/utils/RateCard.java @@ -21,7 +21,7 @@ import java.util.*; * * @author nantuko */ -public class RateCard { +public final class RateCard { private static Map ratings; private static final Map rated = new HashMap<>(); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/Config.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/Config.java index b0c056537f..fc2ddfda30 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/Config.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/Config.java @@ -39,7 +39,7 @@ import org.apache.log4j.Logger; * * @author BetaSteward_at_googlemail.com */ -public class Config { +public final class Config { private static final Logger logger = Logger.getLogger(Config.class); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java index 4964e93de2..e45943dad8 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java @@ -51,7 +51,7 @@ import org.apache.log4j.Logger; * this evaluator is only good for two player games * */ -public class GameStateEvaluator { +public final class GameStateEvaluator { private static final Logger logger = Logger.getLogger(GameStateEvaluator.class); diff --git a/Mage.Server/src/main/java/mage/server/ExtensionPackageLoader.java b/Mage.Server/src/main/java/mage/server/ExtensionPackageLoader.java index f3f6f3c77e..6c5b3f80ad 100644 --- a/Mage.Server/src/main/java/mage/server/ExtensionPackageLoader.java +++ b/Mage.Server/src/main/java/mage/server/ExtensionPackageLoader.java @@ -37,7 +37,7 @@ import java.util.Scanner; /** * @author Lymia */ -public class ExtensionPackageLoader { +public final class ExtensionPackageLoader { public static ExtensionPackage loadExtension(File directory) throws IOException { if(!directory.exists ()) throw new RuntimeException("File not found "+directory); if(!directory.isDirectory()) throw new RuntimeException(directory+" is not a directory"); diff --git a/Mage.Server/src/main/java/mage/server/GmailClient.java b/Mage.Server/src/main/java/mage/server/GmailClient.java index daf6b9d694..1b6e6a39f0 100644 --- a/Mage.Server/src/main/java/mage/server/GmailClient.java +++ b/Mage.Server/src/main/java/mage/server/GmailClient.java @@ -28,7 +28,7 @@ import javax.mail.internet.MimeMessage; import mage.server.util.ConfigSettings; import org.apache.log4j.Logger; -public class GmailClient { +public final class GmailClient { private static final Logger logger = Logger.getLogger(Main.class); private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); diff --git a/Mage.Server/src/main/java/mage/server/MailClient.java b/Mage.Server/src/main/java/mage/server/MailClient.java index 29ffdcc76a..38e9eeb6f3 100644 --- a/Mage.Server/src/main/java/mage/server/MailClient.java +++ b/Mage.Server/src/main/java/mage/server/MailClient.java @@ -10,7 +10,7 @@ import javax.mail.internet.MimeMessage; import mage.server.util.ConfigSettings; import org.apache.log4j.Logger; -public class MailClient { +public final class MailClient { private static final Logger logger = Logger.getLogger(Main.class); diff --git a/Mage.Server/src/main/java/mage/server/MailgunClient.java b/Mage.Server/src/main/java/mage/server/MailgunClient.java index cc012886db..183b9e409c 100644 --- a/Mage.Server/src/main/java/mage/server/MailgunClient.java +++ b/Mage.Server/src/main/java/mage/server/MailgunClient.java @@ -9,7 +9,7 @@ import javax.ws.rs.core.MediaType; import mage.server.util.ConfigSettings; import org.apache.log4j.Logger; -public class MailgunClient { +public final class MailgunClient { private static final Logger logger = Logger.getLogger(Main.class); diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 0b1896361c..49d069aeaf 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -70,7 +70,7 @@ import java.util.*; /** * @author BetaSteward_at_googlemail.com */ -public class Main { +public final class Main { private static final Logger logger = Logger.getLogger(Main.class); private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index e4937ce4e5..58602a7832 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -27,14 +27,6 @@ */ package mage.server; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; import mage.MageException; import mage.cards.decks.Deck; import mage.cards.decks.DeckCardLists; @@ -68,6 +60,15 @@ import mage.server.util.ThreadExecutor; import mage.view.ChatMessage; import org.apache.log4j.Logger; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + /** * @author BetaSteward_at_googlemail.com */ @@ -195,8 +196,9 @@ public class TableController { return false; } - Player player = createPlayer(name, seat.getPlayerType(), skill); - if (player != null) { + Optional playerOptional = createPlayer(name, seat.getPlayerType(), skill); + if (playerOptional.isPresent()) { + Player player = playerOptional.get(); if (!player.canJoinTable(table)) { user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString()); return false; @@ -227,10 +229,11 @@ public class TableController { } public synchronized boolean replaceDraftPlayer(Player oldPlayer, String name, String playerType, int skill) { - Player newPlayer = createPlayer(name, playerType, skill); - if (newPlayer == null || table.getState() != TableState.DRAFTING) { + Optional newPlayerOpt = createPlayer(name, playerType, skill); + if (!newPlayerOpt.isPresent() || table.getState() != TableState.DRAFTING) { return false; } + Player newPlayer = newPlayerOpt.get(); TournamentPlayer oldTournamentPlayer = tournament.getPlayer(oldPlayer.getId()); tournament.removePlayer(oldPlayer.getId()); tournament.addPlayer(newPlayer, playerType); @@ -331,13 +334,14 @@ public class TableController { } } - Player player = createPlayer(name, seat.getPlayerType(), skill); - if (player == null) { + Optional playerOpt = createPlayer(name, seat.getPlayerType(), skill); + if (!playerOpt.isPresent()) { String message = new StringBuilder("Could not create player ").append(name).append(" of type ").append(seat.getPlayerType()).toString(); logger.warn(new StringBuilder("User: ").append(user.getName()).append(" => ").append(message).toString()); user.showUserMessage("Join Table", message); return false; } + Player player = playerOpt.get(); 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()); @@ -468,17 +472,18 @@ public class TableController { // ReplayManager.getInstance().replayGame(table.getId(), userId); // return true; // } - private Player createPlayer(String name, String playerType, int skill) { - Player player; + private Optional createPlayer(String name, String playerType, int skill) { + Optional playerOpt; if (options == null) { - player = PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, skill); + playerOpt = PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, skill); } else { - player = PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill); + playerOpt = PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill); } - if (player != null) { + if (playerOpt.isPresent()) { + Player player = playerOpt.get(); logger.trace("Player " + player.getName() + " created id: " + player.getId()); } - return player; + return playerOpt; } public void leaveTableAll() { diff --git a/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java b/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java index f7e430e808..7b43c65ce5 100644 --- a/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java +++ b/Mage.Server/src/main/java/mage/server/game/PlayerFactory.java @@ -28,14 +28,16 @@ package mage.server.game; -import java.lang.reflect.Constructor; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; import mage.constants.RangeOfInfluence; import mage.players.Player; import org.apache.log4j.Logger; +import java.lang.reflect.Constructor; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + /** * * @author BetaSteward_at_googlemail.com @@ -53,14 +55,14 @@ public class PlayerFactory { private PlayerFactory() {} - public Player createPlayer(String playerType, String name, RangeOfInfluence range, int skill) { + public Optional createPlayer(String playerType, String name, RangeOfInfluence range, int skill) { try { Class playerTypeClass = playerTypes.get(playerType); if (playerTypeClass != null) { Constructor con = playerTypeClass.getConstructor(String.class, RangeOfInfluence.class, int.class); Player player = (Player) con.newInstance(name, range, skill); logger.trace("Player created: " + name + " - " + player.getId()); - return player; + return Optional.of(player); } else { logger.fatal("Unknown player type: " + playerType); @@ -68,7 +70,7 @@ public class PlayerFactory { } catch (Exception ex) { logger.fatal("PlayerFactory error ", ex); } - return null; + return Optional.empty(); } public Set getPlayerTypes() { diff --git a/Mage.Server/src/main/java/mage/server/util/Config.java b/Mage.Server/src/main/java/mage/server/util/Config.java index 65cd7b7dd8..b722dea750 100644 --- a/Mage.Server/src/main/java/mage/server/util/Config.java +++ b/Mage.Server/src/main/java/mage/server/util/Config.java @@ -36,7 +36,7 @@ import org.apache.log4j.Logger; * * @author BetaSteward_at_googlemail.com */ -public class Config { +public final class Config { private static final Logger logger = Logger.getLogger(Config.class); diff --git a/Mage.Server/src/main/java/mage/server/util/Splitter.java b/Mage.Server/src/main/java/mage/server/util/Splitter.java index a20291315d..2a1b1f980d 100644 --- a/Mage.Server/src/main/java/mage/server/util/Splitter.java +++ b/Mage.Server/src/main/java/mage/server/util/Splitter.java @@ -9,7 +9,7 @@ import mage.players.Player; /** * @author nantuko */ -public class Splitter { +public final class Splitter { public static List split(Game game, UUID playerId) { List players = new ArrayList<>(); diff --git a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java index 64fa68e0aa..a43a73f348 100644 --- a/Mage.Server/src/main/java/mage/server/util/SystemUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/SystemUtil.java @@ -19,7 +19,7 @@ import java.util.regex.Pattern; /** * @author nantuko */ -public class SystemUtil { +public final class SystemUtil { public static final DateFormat dateFormat = new SimpleDateFormat("yy-M-dd HH:mm:ss"); diff --git a/Mage.Sets/src/mage/cards/a/AbzanBattlePriest.java b/Mage.Sets/src/mage/cards/a/AbzanBattlePriest.java index a04bd2192d..352591272a 100644 --- a/Mage.Sets/src/mage/cards/a/AbzanBattlePriest.java +++ b/Mage.Sets/src/mage/cards/a/AbzanBattlePriest.java @@ -59,7 +59,7 @@ public class AbzanBattlePriest extends CardImpl { filter.add(new CounterPredicate(CounterType.P1P1)); } - final String rule = "Each creature you control with a +1/+1 counter on it has lifelink"; + static final String rule = "Each creature you control with a +1/+1 counter on it has lifelink"; public AbzanBattlePriest(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); diff --git a/Mage.Sets/src/mage/cards/a/AetherChaser.java b/Mage.Sets/src/mage/cards/a/AetherChaser.java index 01fc50c283..668608907f 100644 --- a/Mage.Sets/src/mage/cards/a/AetherChaser.java +++ b/Mage.Sets/src/mage/cards/a/AetherChaser.java @@ -27,7 +27,6 @@ */ package mage.cards.a; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -41,6 +40,8 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.game.permanent.token.ServoToken; +import java.util.UUID; + /** * * @author fireshoes @@ -62,7 +63,7 @@ public class AetherChaser extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // Whenever Aether Chaser attacks, you may pay {E}{E}. If you do, create a 1/1 colorless Servo artifact creature token. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new ServoToken()), new PayEnergyCost(2)), false, + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new ServoToken()), new PayEnergyCost(2)), true, "Whenever {this} attacks you may pay {E}{E}. If you do, create a 1/1 colorless Servo artifact creature token.")); } diff --git a/Mage.Sets/src/mage/cards/a/AinokBondKin.java b/Mage.Sets/src/mage/cards/a/AinokBondKin.java index 7b852d1dd1..2de64123d5 100644 --- a/Mage.Sets/src/mage/cards/a/AinokBondKin.java +++ b/Mage.Sets/src/mage/cards/a/AinokBondKin.java @@ -60,7 +60,7 @@ public class AinokBondKin extends CardImpl { filter.add(new CounterPredicate(CounterType.P1P1)); } - final String rule = "Each creature you control with a +1/+1 counter on it has first strike"; + static final String rule = "Each creature you control with a +1/+1 counter on it has first strike"; public AinokBondKin(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}"); diff --git a/Mage.Sets/src/mage/cards/a/AquamorphEntity.java b/Mage.Sets/src/mage/cards/a/AquamorphEntity.java index 51d592f3f4..fcb6eb219b 100644 --- a/Mage.Sets/src/mage/cards/a/AquamorphEntity.java +++ b/Mage.Sets/src/mage/cards/a/AquamorphEntity.java @@ -84,8 +84,8 @@ public class AquamorphEntity extends CardImpl { class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { - private final String choice51 = "a 5/1 creature"; - private final String choice15 = "a 1/5 creature"; + private static final String choice51 = "a 5/1 creature"; + private static final String choice15 = "a 1/5 creature"; public AquamorphEntityReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/a/Aurification.java b/Mage.Sets/src/mage/cards/a/Aurification.java index 866c3fc1eb..5bd02eb70b 100644 --- a/Mage.Sets/src/mage/cards/a/Aurification.java +++ b/Mage.Sets/src/mage/cards/a/Aurification.java @@ -64,7 +64,7 @@ public class Aurification extends CardImpl { filter.add(new CounterPredicate(CounterType.GOLD)); } - final String rule = "Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender."; + static final String rule = "Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender."; public Aurification(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}{W}"); diff --git a/Mage.Sets/src/mage/cards/b/BalothPup.java b/Mage.Sets/src/mage/cards/b/BalothPup.java index 69f482aca0..14f4b9f5b9 100644 --- a/Mage.Sets/src/mage/cards/b/BalothPup.java +++ b/Mage.Sets/src/mage/cards/b/BalothPup.java @@ -47,7 +47,7 @@ import mage.counters.CounterType; */ public class BalothPup extends CardImpl { - private final String rule = "{this} has trample as long as it has a +1/+1 counter on it"; + private static final String rule = "{this} has trample as long as it has a +1/+1 counter on it"; public BalothPup(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); diff --git a/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java b/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java index e182c6f832..aa30f51f6d 100644 --- a/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java +++ b/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java @@ -47,7 +47,7 @@ import mage.cards.CardSetInfo; */ public class BladeTribeBerserkers extends CardImpl { - private final String effectText = "Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn."; + private static final String effectText = "Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn."; public BladeTribeBerserkers(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); diff --git a/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java b/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java index e477af586a..8ab4ec9bd9 100644 --- a/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java +++ b/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java @@ -47,7 +47,7 @@ import mage.target.TargetPlayer; */ public class BleakCovenVampires extends CardImpl { - private final String effectText = "Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life."; + private static final String effectText = "Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life."; public BleakCovenVampires(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); diff --git a/Mage.Sets/src/mage/cards/c/CrabappleCohort.java b/Mage.Sets/src/mage/cards/c/CrabappleCohort.java index 36a80ceaeb..7297d3dd09 100644 --- a/Mage.Sets/src/mage/cards/c/CrabappleCohort.java +++ b/Mage.Sets/src/mage/cards/c/CrabappleCohort.java @@ -51,7 +51,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class CrabappleCohort extends CardImpl { - private final String rule = "{this} gets +1/+1 as long as you control another green creature"; + private static final String rule = "{this} gets +1/+1 as long as you control another green creature"; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/e/EldraziAggressor.java b/Mage.Sets/src/mage/cards/e/EldraziAggressor.java index 2cd24343ac..7c4edd78a9 100644 --- a/Mage.Sets/src/mage/cards/e/EldraziAggressor.java +++ b/Mage.Sets/src/mage/cards/e/EldraziAggressor.java @@ -50,7 +50,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class EldraziAggressor extends CardImpl { - private final String rule = "{this} has haste as long as you control another colorless creature"; + private static final String rule = "{this} has haste as long as you control another colorless creature"; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); static { diff --git a/Mage.Sets/src/mage/cards/e/ExavaRakdosBloodWitch.java b/Mage.Sets/src/mage/cards/e/ExavaRakdosBloodWitch.java index 889310efb2..7fd1e7cb37 100644 --- a/Mage.Sets/src/mage/cards/e/ExavaRakdosBloodWitch.java +++ b/Mage.Sets/src/mage/cards/e/ExavaRakdosBloodWitch.java @@ -62,7 +62,7 @@ public class ExavaRakdosBloodWitch extends CardImpl { filter.add(new AnotherPredicate()); } - final String rule = "Each other creature you control with a +1/+1 counter on it has haste"; + static final String rule = "Each other creature you control with a +1/+1 counter on it has haste"; public ExavaRakdosBloodWitch(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{R}"); this.supertype.add("Legendary"); diff --git a/Mage.Sets/src/mage/cards/e/EzurisBrigade.java b/Mage.Sets/src/mage/cards/e/EzurisBrigade.java index 7f00a9b910..4d64ff2b74 100644 --- a/Mage.Sets/src/mage/cards/e/EzurisBrigade.java +++ b/Mage.Sets/src/mage/cards/e/EzurisBrigade.java @@ -49,7 +49,7 @@ import mage.cards.CardSetInfo; * @author Loki */ public class EzurisBrigade extends CardImpl { - private final String text = "Metalcraft - As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample"; + private static final String text = "Metalcraft - As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample"; public EzurisBrigade (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); diff --git a/Mage.Sets/src/mage/cards/g/GalvanicBlast.java b/Mage.Sets/src/mage/cards/g/GalvanicBlast.java index 8828629e78..ac1d677110 100644 --- a/Mage.Sets/src/mage/cards/g/GalvanicBlast.java +++ b/Mage.Sets/src/mage/cards/g/GalvanicBlast.java @@ -42,7 +42,7 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class GalvanicBlast extends CardImpl { - private final String effectText = "{this} deals 2 damage to target creature or player.
Metalcraft - {this} deals 4 damage to that creature or player instead if you control three or more artifacts"; + private static final String effectText = "{this} deals 2 damage to target creature or player.
Metalcraft - {this} deals 4 damage to that creature or player instead if you control three or more artifacts"; public GalvanicBlast(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}"); diff --git a/Mage.Sets/src/mage/cards/g/GhalmasWarden.java b/Mage.Sets/src/mage/cards/g/GhalmasWarden.java index 163609db42..36f58f3af1 100644 --- a/Mage.Sets/src/mage/cards/g/GhalmasWarden.java +++ b/Mage.Sets/src/mage/cards/g/GhalmasWarden.java @@ -47,7 +47,7 @@ import mage.cards.CardSetInfo; */ public class GhalmasWarden extends CardImpl { - private final String text = "Metalcraft - Ghalma's Warden gets +2/+2 as long as you control three or more artifacts"; + private static final String text = "Metalcraft - Ghalma's Warden gets +2/+2 as long as you control three or more artifacts"; public GhalmasWarden (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); diff --git a/Mage.Sets/src/mage/cards/g/GwyllionHedgeMage.java b/Mage.Sets/src/mage/cards/g/GwyllionHedgeMage.java index 92d9c56e29..f62d5d8d3c 100644 --- a/Mage.Sets/src/mage/cards/g/GwyllionHedgeMage.java +++ b/Mage.Sets/src/mage/cards/g/GwyllionHedgeMage.java @@ -60,8 +60,8 @@ public class GwyllionHedgeMage extends CardImpl { filter2.add(new SubtypePredicate("Swamp")); } - private final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may create a 1/1 white Kithkin Soldier creature token."; - private final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature."; + private static final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may create a 1/1 white Kithkin Soldier creature token."; + private static final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature."; public GwyllionHedgeMage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W/B}"); diff --git a/Mage.Sets/src/mage/cards/h/HelixPinnacle.java b/Mage.Sets/src/mage/cards/h/HelixPinnacle.java index 503d888d6e..666c0de23b 100644 --- a/Mage.Sets/src/mage/cards/h/HelixPinnacle.java +++ b/Mage.Sets/src/mage/cards/h/HelixPinnacle.java @@ -50,7 +50,7 @@ import mage.counters.CounterType; */ public class HelixPinnacle extends CardImpl { - final String rule = "if there are 100 or more tower counters on Helix Pinnacle, you win the game"; + static final String rule = "if there are 100 or more tower counters on Helix Pinnacle, you win the game"; public HelixPinnacle(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); diff --git a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java index 648e6b815e..97115d182e 100644 --- a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java +++ b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java @@ -47,7 +47,7 @@ import mage.filter.common.FilterCreaturePermanent; */ public class JorKadeenThePrevailer extends CardImpl { - private final String effectText = "Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts."; + private static final String effectText = "Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts."; public JorKadeenThePrevailer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{W}"); diff --git a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java index df4cbd15f8..b6c25fb0c7 100644 --- a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java +++ b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java @@ -89,7 +89,7 @@ public class MaliciousAffliction extends CardImpl { class CopySourceSpellEffect extends OneShotEffect { - final String rule = "copy {this} and may choose a new target for the copy"; + static final String rule = "copy {this} and may choose a new target for the copy"; public CopySourceSpellEffect() { super(Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/m/MarkovCrusader.java b/Mage.Sets/src/mage/cards/m/MarkovCrusader.java index 6c4e0959de..397343d86c 100644 --- a/Mage.Sets/src/mage/cards/m/MarkovCrusader.java +++ b/Mage.Sets/src/mage/cards/m/MarkovCrusader.java @@ -50,7 +50,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class MarkovCrusader extends CardImpl { - private final String rule = "{this} has haste as long as you control another Vampire"; + private static final String rule = "{this} has haste as long as you control another Vampire"; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another Vampire"); static { diff --git a/Mage.Sets/src/mage/cards/m/MinotaurTactician.java b/Mage.Sets/src/mage/cards/m/MinotaurTactician.java index 88cbf5db8f..fdc67d745f 100644 --- a/Mage.Sets/src/mage/cards/m/MinotaurTactician.java +++ b/Mage.Sets/src/mage/cards/m/MinotaurTactician.java @@ -60,9 +60,9 @@ public class MinotaurTactician extends CardImpl { filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); } - final private String ruleWhite = "{this} gets +1/+1 as long as you control another white creature"; + static final private String ruleWhite = "{this} gets +1/+1 as long as you control another white creature"; - final private String ruleBlue = "{this} gets +1/+1 as long as you control another white creature"; + static final private String ruleBlue = "{this} gets +1/+1 as long as you control another white creature"; public MinotaurTactician(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); diff --git a/Mage.Sets/src/mage/cards/m/MirranMettle.java b/Mage.Sets/src/mage/cards/m/MirranMettle.java index 7b51994a9e..325474d72e 100644 --- a/Mage.Sets/src/mage/cards/m/MirranMettle.java +++ b/Mage.Sets/src/mage/cards/m/MirranMettle.java @@ -44,7 +44,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class MirranMettle extends CardImpl { - private final String effectText = "Metalcraft - That creature gets +4/+4 until end of turn instead if you control three or more artifacts."; + private static final String effectText = "Metalcraft - That creature gets +4/+4 until end of turn instead if you control three or more artifacts."; public MirranMettle(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); diff --git a/Mage.Sets/src/mage/cards/m/MudbrawlerCohort.java b/Mage.Sets/src/mage/cards/m/MudbrawlerCohort.java index 51acecabca..861f885779 100644 --- a/Mage.Sets/src/mage/cards/m/MudbrawlerCohort.java +++ b/Mage.Sets/src/mage/cards/m/MudbrawlerCohort.java @@ -52,7 +52,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class MudbrawlerCohort extends CardImpl { - private final String rule = "{this} gets +1/+1 as long as you control another red creature"; + private static final String rule = "{this} gets +1/+1 as long as you control another red creature"; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/n/Nefashu.java b/Mage.Sets/src/mage/cards/n/Nefashu.java index 0ae167a103..337cbaea4b 100644 --- a/Mage.Sets/src/mage/cards/n/Nefashu.java +++ b/Mage.Sets/src/mage/cards/n/Nefashu.java @@ -45,7 +45,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class Nefashu extends CardImpl { - final String rule = "Whenever Nefashu attacks, up to five target creatures each get -1/-1 until end of turn."; + static final String rule = "Whenever Nefashu attacks, up to five target creatures each get -1/-1 until end of turn."; public Nefashu(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}"); diff --git a/Mage.Sets/src/mage/cards/o/OgreBattledriver.java b/Mage.Sets/src/mage/cards/o/OgreBattledriver.java index 68f7953306..87c1619b21 100644 --- a/Mage.Sets/src/mage/cards/o/OgreBattledriver.java +++ b/Mage.Sets/src/mage/cards/o/OgreBattledriver.java @@ -58,7 +58,7 @@ public class OgreBattledriver extends CardImpl { filter.add(new AnotherPredicate()); } - private final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn."; + private static final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn."; public OgreBattledriver(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); diff --git a/Mage.Sets/src/mage/cards/p/PathOfBravery.java b/Mage.Sets/src/mage/cards/p/PathOfBravery.java index 2ce7c94caa..e4505cb914 100644 --- a/Mage.Sets/src/mage/cards/p/PathOfBravery.java +++ b/Mage.Sets/src/mage/cards/p/PathOfBravery.java @@ -58,7 +58,7 @@ public class PathOfBravery extends CardImpl { static { filter.add(new ControllerPredicate(TargetController.YOU)); } - final String rule = "As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1"; + static final String rule = "As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1"; public PathOfBravery(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); diff --git a/Mage.Sets/src/mage/cards/p/PrimalClay.java b/Mage.Sets/src/mage/cards/p/PrimalClay.java index 63ae40ab35..41ab6ea294 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalClay.java +++ b/Mage.Sets/src/mage/cards/p/PrimalClay.java @@ -78,9 +78,9 @@ public class PrimalClay extends CardImpl { class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { - private final String choice33 = "a 3/3 artifact creature"; - private final String choice22 = "a 2/2 artifact creature with flying"; - private final String choice16 = "a 1/6 artifact creature with defender"; + private static final String choice33 = "a 3/3 artifact creature"; + private static final String choice22 = "a 2/2 artifact creature with flying"; + private static final String choice16 = "a 1/6 artifact creature with defender"; public PrimalPlasmaReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/p/PrimalForcemage.java b/Mage.Sets/src/mage/cards/p/PrimalForcemage.java index 357cb28154..3135f61f85 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalForcemage.java +++ b/Mage.Sets/src/mage/cards/p/PrimalForcemage.java @@ -55,7 +55,7 @@ public class PrimalForcemage extends CardImpl { filter.add(new AnotherPredicate()); } - private final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +3/+3 until end of turn."; + private static final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +3/+3 until end of turn."; public PrimalForcemage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); diff --git a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java index 7430610a19..a2b3642baa 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalPlasma.java +++ b/Mage.Sets/src/mage/cards/p/PrimalPlasma.java @@ -79,9 +79,9 @@ public class PrimalPlasma extends CardImpl { class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { - private final String choice33 = "a 3/3 creature"; - private final String choice22 = "a 2/2 creature with flying"; - private final String choice16 = "a 1/6 creature with defender"; + private static final String choice33 = "a 3/3 creature"; + private static final String choice22 = "a 2/2 creature with flying"; + private static final String choice16 = "a 1/6 creature with defender"; public PrimalPlasmaReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/r/RekindledFlame.java b/Mage.Sets/src/mage/cards/r/RekindledFlame.java index 2b7af880e9..a9896973ca 100644 --- a/Mage.Sets/src/mage/cards/r/RekindledFlame.java +++ b/Mage.Sets/src/mage/cards/r/RekindledFlame.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class RekindledFlame extends CardImpl { - final String rule = "if an opponent has no cards in hand, you may return Rekindled Flame from your graveyard to your hand"; + static final String rule = "if an opponent has no cards in hand, you may return Rekindled Flame from your graveyard to your hand"; public RekindledFlame(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}{R}"); diff --git a/Mage.Sets/src/mage/cards/s/SapphireDrake.java b/Mage.Sets/src/mage/cards/s/SapphireDrake.java index b36964cbe8..aa7745234b 100644 --- a/Mage.Sets/src/mage/cards/s/SapphireDrake.java +++ b/Mage.Sets/src/mage/cards/s/SapphireDrake.java @@ -56,7 +56,7 @@ public class SapphireDrake extends CardImpl { filter.add(new CounterPredicate(CounterType.P1P1)); } - final String rule = "Each creature you control with a +1/+1 counter on it has flying"; + static final String rule = "Each creature you control with a +1/+1 counter on it has flying"; public SapphireDrake(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}"); diff --git a/Mage.Sets/src/mage/cards/s/ScourgeOfValkas.java b/Mage.Sets/src/mage/cards/s/ScourgeOfValkas.java index b9fe354afb..bf3811a2ca 100644 --- a/Mage.Sets/src/mage/cards/s/ScourgeOfValkas.java +++ b/Mage.Sets/src/mage/cards/s/ScourgeOfValkas.java @@ -62,7 +62,7 @@ public class ScourgeOfValkas extends CardImpl { filter2.add(new SubtypePredicate("Dragon")); } - private final String rule = "Whenever {this} or another Dragon enters the battlefield under your control, it deals X damage to target creature or player, where X is the number of Dragons you control."; + private static final String rule = "Whenever {this} or another Dragon enters the battlefield under your control, it deals X damage to target creature or player, where X is the number of Dragons you control."; public ScourgeOfValkas(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}{R}"); diff --git a/Mage.Sets/src/mage/cards/s/SelkieHedgeMage.java b/Mage.Sets/src/mage/cards/s/SelkieHedgeMage.java index d4e9e0a1bc..44b3aad991 100644 --- a/Mage.Sets/src/mage/cards/s/SelkieHedgeMage.java +++ b/Mage.Sets/src/mage/cards/s/SelkieHedgeMage.java @@ -62,8 +62,8 @@ public class SelkieHedgeMage extends CardImpl { filter3.add(new TappedPredicate()); } - private final String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life."; - private final String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand."; + private static final String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life."; + private static final String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand."; public SelkieHedgeMage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G/U}"); diff --git a/Mage.Sets/src/mage/cards/s/ShepherdOfRot.java b/Mage.Sets/src/mage/cards/s/ShepherdOfRot.java index 505e966230..862cdcb19b 100644 --- a/Mage.Sets/src/mage/cards/s/ShepherdOfRot.java +++ b/Mage.Sets/src/mage/cards/s/ShepherdOfRot.java @@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ShepherdOfRot extends CardImpl { - final String rule = "Each player loses 1 life for each Zombie on the battlefield"; + static final String rule = "Each player loses 1 life for each Zombie on the battlefield"; static final private FilterPermanent filter = new FilterPermanent("Zombie"); diff --git a/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java b/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java index 5a0bda6949..da586f33f0 100644 --- a/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java +++ b/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java @@ -47,7 +47,7 @@ import mage.cards.CardSetInfo; */ public class SpiralingDuelist extends CardImpl { - private final String effectText = "Metalcraft - Spiraling Duelist has double strike as long as you control three or more artifacts."; + private static final String effectText = "Metalcraft - Spiraling Duelist has double strike as long as you control three or more artifacts."; public SpiralingDuelist(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); diff --git a/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java b/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java index 9f4c965631..fda4f611e9 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java @@ -76,7 +76,7 @@ public class ThoughtHemorrhage extends CardImpl { class ThoughtHemorrhageEffect extends OneShotEffect { - final String rule = "Target player reveals his or her hand. {this} deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library"; + static final String rule = "Target player reveals his or her hand. {this} deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library"; public ThoughtHemorrhageEffect() { super(Outcome.Exile); diff --git a/Mage.Sets/src/mage/cards/t/Thunderblust.java b/Mage.Sets/src/mage/cards/t/Thunderblust.java index af59ae85b5..9b30b9aa95 100644 --- a/Mage.Sets/src/mage/cards/t/Thunderblust.java +++ b/Mage.Sets/src/mage/cards/t/Thunderblust.java @@ -49,7 +49,7 @@ import mage.counters.CounterType; */ public class Thunderblust extends CardImpl { - private final String rule = "{this} has trample as long as it has a -1/-1 counter on it"; + private static final String rule = "{this} has trample as long as it has a -1/-1 counter on it"; public Thunderblust(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}{R}"); diff --git a/Mage.Sets/src/mage/cards/t/TuskguardCaptain.java b/Mage.Sets/src/mage/cards/t/TuskguardCaptain.java index f830132025..021cce5dc8 100644 --- a/Mage.Sets/src/mage/cards/t/TuskguardCaptain.java +++ b/Mage.Sets/src/mage/cards/t/TuskguardCaptain.java @@ -60,7 +60,7 @@ public class TuskguardCaptain extends CardImpl { filter.add(new CounterPredicate(CounterType.P1P1)); } - final String rule = "Each creature you control with a +1/+1 counter on it has trample"; + static final String rule = "Each creature you control with a +1/+1 counter on it has trample"; public TuskguardCaptain(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); diff --git a/Mage.Sets/src/mage/cards/w/WayOfTheThief.java b/Mage.Sets/src/mage/cards/w/WayOfTheThief.java index 6b759ea81d..16eed54fdb 100644 --- a/Mage.Sets/src/mage/cards/w/WayOfTheThief.java +++ b/Mage.Sets/src/mage/cards/w/WayOfTheThief.java @@ -61,7 +61,7 @@ public class WayOfTheThief extends CardImpl { static { filter.add(new SubtypePredicate("Gate")); } - private final String rule = "Enchanted creature can't be blocked as long as you control a Gate"; + private static final String rule = "Enchanted creature can't be blocked as long as you control a Gate"; public WayOfTheThief(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}"); diff --git a/Mage.Sets/src/mage/cards/w/WoodvineElemental.java b/Mage.Sets/src/mage/cards/w/WoodvineElemental.java index e8a9f76a0b..cb99f88a99 100644 --- a/Mage.Sets/src/mage/cards/w/WoodvineElemental.java +++ b/Mage.Sets/src/mage/cards/w/WoodvineElemental.java @@ -52,7 +52,7 @@ import mage.players.Player; */ public class WoodvineElemental extends CardImpl { - final private String rule = "Parley — Whenever {this} attacks, each player reveals the top card of his or her library. " + static final private String rule = "Parley — Whenever {this} attacks, each player reveals the top card of his or her library. " + "For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card."; public WoodvineElemental(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Stats/src/main/java/com/xmage/ws/json/ResponseBuilder.java b/Mage.Stats/src/main/java/com/xmage/ws/json/ResponseBuilder.java index c1c58e4e30..cee6c8bffb 100644 --- a/Mage.Stats/src/main/java/com/xmage/ws/json/ResponseBuilder.java +++ b/Mage.Stats/src/main/java/com/xmage/ws/json/ResponseBuilder.java @@ -4,7 +4,7 @@ import com.xmage.ws.model.DomainErrors; import com.xmage.ws.resource.Resource; import net.minidev.json.JSONObject; -public class ResponseBuilder { +public final class ResponseBuilder { public static JSONObject build(int code) { JSONObject response = new JSONObject(); diff --git a/Mage.Stats/src/main/java/com/xmage/ws/json/XMageStatsJSONBuilder.java b/Mage.Stats/src/main/java/com/xmage/ws/json/XMageStatsJSONBuilder.java index df7072e065..82c2177cf0 100644 --- a/Mage.Stats/src/main/java/com/xmage/ws/json/XMageStatsJSONBuilder.java +++ b/Mage.Stats/src/main/java/com/xmage/ws/json/XMageStatsJSONBuilder.java @@ -19,7 +19,7 @@ public class XMageStatsJSONBuilder implements JSONBuilder { private static final SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); - static class StaticHolder { + static final class StaticHolder { static XMageStatsJSONBuilder instance = new XMageStatsJSONBuilder(); } diff --git a/Mage.Stats/src/main/java/com/xmage/ws/util/IPHolderUtil.java b/Mage.Stats/src/main/java/com/xmage/ws/util/IPHolderUtil.java index 634f0084e1..406a8b9bd1 100644 --- a/Mage.Stats/src/main/java/com/xmage/ws/util/IPHolderUtil.java +++ b/Mage.Stats/src/main/java/com/xmage/ws/util/IPHolderUtil.java @@ -6,7 +6,7 @@ package com.xmage.ws.util; * * @author noxx */ -public class IPHolderUtil { +public final class IPHolderUtil { private static final ThreadLocal ipThreadLocal = new ThreadLocal(); private static final ThreadLocal userAgentThreadLocal = new ThreadLocal(); diff --git a/Mage.Stats/src/test/java/com/anygo/ws/util/FileUtil.java b/Mage.Stats/src/test/java/com/anygo/ws/util/FileUtil.java index 166dcfb110..163b418404 100644 --- a/Mage.Stats/src/test/java/com/anygo/ws/util/FileUtil.java +++ b/Mage.Stats/src/test/java/com/anygo/ws/util/FileUtil.java @@ -6,7 +6,7 @@ import java.io.*; * * @author noxx */ -public class FileUtil { +public final class FileUtil { private FileUtil() {} 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 27d980f32f..00ee97cd16 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 @@ -28,7 +28,6 @@ import org.mage.test.player.TestPlayer; import java.io.File; import java.io.FileNotFoundException; import java.io.FilenameFilter; -import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -297,7 +296,8 @@ public abstract class MageTestBase { } protected Player createPlayer(String name, String playerType) { - return PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, 5); + Optional playerOptional = PlayerFactory.getInstance().createPlayer(playerType, name, RangeOfInfluence.ALL, 5); + return playerOptional.orElseThrow(() -> new NullPointerException("PlayerFactory error - player is not created")); } protected Player createRandomPlayer(String name) { diff --git a/Mage.Updater/src/main/java/com/magefree/update/helpers/ChechsumHelper.java b/Mage.Updater/src/main/java/com/magefree/update/helpers/ChechsumHelper.java index 73aa1c1763..c4d035eeed 100644 --- a/Mage.Updater/src/main/java/com/magefree/update/helpers/ChechsumHelper.java +++ b/Mage.Updater/src/main/java/com/magefree/update/helpers/ChechsumHelper.java @@ -7,7 +7,7 @@ import java.security.MessageDigest; /** * @author Loki */ -public class ChechsumHelper { +public final class ChechsumHelper { public static byte[] createChecksum(String filename) throws Exception { InputStream fis = null; diff --git a/Mage.Updater/src/main/java/com/magefree/update/helpers/FileHelper.java b/Mage.Updater/src/main/java/com/magefree/update/helpers/FileHelper.java index 91c2049495..9de551c2d9 100644 --- a/Mage.Updater/src/main/java/com/magefree/update/helpers/FileHelper.java +++ b/Mage.Updater/src/main/java/com/magefree/update/helpers/FileHelper.java @@ -10,7 +10,7 @@ import java.util.List; * * @author noxx */ -public class FileHelper { +public final class FileHelper { private FileHelper() { } diff --git a/Mage.Verify/src/main/java/mage/verify/MtgJson.java b/Mage.Verify/src/main/java/mage/verify/MtgJson.java index 04488fdfe6..ea16d99538 100644 --- a/Mage.Verify/src/main/java/mage/verify/MtgJson.java +++ b/Mage.Verify/src/main/java/mage/verify/MtgJson.java @@ -15,10 +15,10 @@ import java.util.HashMap; import java.util.Map; import java.util.zip.ZipInputStream; -public class MtgJson { +public final class MtgJson { private MtgJson() {} - private static class CardHolder { + private static final class CardHolder { private static final Map cards; static { try { @@ -30,7 +30,7 @@ public class MtgJson { } } - private static class SetHolder { + private static final class SetHolder { private static final Map sets; static { try { diff --git a/Mage/src/main/java/mage/abilities/costs/mana/ManaCostsImpl.java b/Mage/src/main/java/mage/abilities/costs/mana/ManaCostsImpl.java index 1e541429cc..6f69afd8e6 100644 --- a/Mage/src/main/java/mage/abilities/costs/mana/ManaCostsImpl.java +++ b/Mage/src/main/java/mage/abilities/costs/mana/ManaCostsImpl.java @@ -27,11 +27,6 @@ */ package mage.abilities.costs.mana; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.costs.Cost; @@ -45,13 +40,15 @@ import mage.players.Player; import mage.target.Targets; import mage.util.ManaUtil; +import java.util.*; + /** * @author BetaSteward_at_googlemail.com * @param */ public class ManaCostsImpl extends ArrayList implements ManaCosts { - protected UUID id; + protected final UUID id; protected String text = null; private static Map costs = new HashMap<>(); @@ -323,7 +320,7 @@ public class ManaCostsImpl extends ArrayList implements M if (mana == null || mana.isEmpty()) { return; } - String[] symbols = mana.split("^\\{|\\}\\{|\\}$"); + String[] symbols = mana.split("^\\{|}\\{|}$"); int modifierForX = 0; for (String symbol : symbols) { if (!symbol.isEmpty()) { 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 48dd521d77..cd8e51617b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/EpicEffect.java @@ -36,7 +36,7 @@ import java.util.Objects; */ public class EpicEffect extends OneShotEffect { - final String rule = "
Epic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)"; + static final String rule = "
Epic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)"; public EpicEffect() { super(Outcome.Benefit); diff --git a/Mage/src/main/java/mage/actions/score/ScoringConstants.java b/Mage/src/main/java/mage/actions/score/ScoringConstants.java index f813c34795..4de34a404a 100644 --- a/Mage/src/main/java/mage/actions/score/ScoringConstants.java +++ b/Mage/src/main/java/mage/actions/score/ScoringConstants.java @@ -5,7 +5,7 @@ package mage.actions.score; * * @author ayratn */ -public class ScoringConstants { +public final class ScoringConstants { public static final int WIN_GAME_SCORE = 100000000; public static final int LOSE_GAME_SCORE = -WIN_GAME_SCORE; diff --git a/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java b/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java index 3c11be92ad..da6d4c207e 100644 --- a/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java +++ b/Mage/src/main/java/mage/cards/decks/importer/DeckImporterUtil.java @@ -33,7 +33,7 @@ import mage.cards.decks.DeckCardLists; * * @author North */ -public class DeckImporterUtil { +public final class DeckImporterUtil { public static DeckImporter getDeckImporter(String file) { if (file.toLowerCase().endsWith("dec")) { diff --git a/Mage/src/main/java/mage/cards/repository/CardScanner.java b/Mage/src/main/java/mage/cards/repository/CardScanner.java index 917f1fb037..708ee30805 100644 --- a/Mage/src/main/java/mage/cards/repository/CardScanner.java +++ b/Mage/src/main/java/mage/cards/repository/CardScanner.java @@ -36,7 +36,7 @@ import org.apache.log4j.Logger; * * @author North */ -public class CardScanner { +public final class CardScanner { public static boolean scanned = false; diff --git a/Mage/src/main/java/mage/cards/repository/PluginClassloaderRegistery.java b/Mage/src/main/java/mage/cards/repository/PluginClassloaderRegistery.java index f9edd1468a..17c212494a 100644 --- a/Mage/src/main/java/mage/cards/repository/PluginClassloaderRegistery.java +++ b/Mage/src/main/java/mage/cards/repository/PluginClassloaderRegistery.java @@ -36,7 +36,7 @@ import java.util.List; * * @author Lymia */ -public class PluginClassloaderRegistery { +public final class PluginClassloaderRegistery { static List pluginClassloaders = new ArrayList<>(); public static void registerPluginClassloader(ClassLoader cl) { diff --git a/Mage/src/main/java/mage/cards/repository/RepositoryUtil.java b/Mage/src/main/java/mage/cards/repository/RepositoryUtil.java index b535e380ff..15f4921f59 100644 --- a/Mage/src/main/java/mage/cards/repository/RepositoryUtil.java +++ b/Mage/src/main/java/mage/cards/repository/RepositoryUtil.java @@ -14,7 +14,7 @@ import java.util.List; * * @author North */ -public class RepositoryUtil { +public final class RepositoryUtil { public static boolean isDatabaseObsolete(ConnectionSource connectionSource, String entityName, long version) throws SQLException { TableUtils.createTableIfNotExists(connectionSource, DatabaseVersion.class); diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index 5ec5687a92..aaf639ea76 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; * * @author LevelX2 */ -public class StaticFilters { +public final class StaticFilters { public static final FilterCreaturePermanent FILTER_ARTIFACT_CREATURE_PERMANENT = new FilterArtifactCreaturePermanent(); public static final FilterPermanent FILTER_PERMANENT_ARTIFACT_OR_CREATURE = new FilterPermanent("artifact or creature"); diff --git a/Mage/src/main/java/mage/game/ZonesHandler.java b/Mage/src/main/java/mage/game/ZonesHandler.java index 8187267237..ba835095d0 100644 --- a/Mage/src/main/java/mage/game/ZonesHandler.java +++ b/Mage/src/main/java/mage/game/ZonesHandler.java @@ -20,7 +20,7 @@ import mage.target.TargetCard; /** * Created by samuelsandeen on 9/6/16. */ -public class ZonesHandler { +public final class ZonesHandler { public static boolean cast(ZoneChangeInfo info, Game game) { if (maybeRemoveFromSourceZone(info, game)) { diff --git a/Mage/src/main/java/mage/game/draft/DraftCube.java b/Mage/src/main/java/mage/game/draft/DraftCube.java index bd64bfdd34..2aa75d0dfc 100644 --- a/Mage/src/main/java/mage/game/draft/DraftCube.java +++ b/Mage/src/main/java/mage/game/draft/DraftCube.java @@ -74,7 +74,7 @@ public abstract class DraftCube { private static final Logger logger = Logger.getLogger(DraftCube.class); private final String name; - private final int boosterSize = 15; + private static final int boosterSize = 15; protected List cubeCards = new ArrayList<>(); protected List leftCubeCards = new ArrayList<>(); diff --git a/Mage/src/main/java/mage/util/CardUtil.java b/Mage/src/main/java/mage/util/CardUtil.java index de51b575fa..5bc6fbb50c 100644 --- a/Mage/src/main/java/mage/util/CardUtil.java +++ b/Mage/src/main/java/mage/util/CardUtil.java @@ -59,7 +59,7 @@ import mage.util.functions.CopyTokenFunction; /** * @author nantuko */ -public class CardUtil { +public final class CardUtil { private static final String regexBlack = ".*\\x7b.{0,2}B.{0,2}\\x7d.*"; private static final String regexBlue = ".*\\x7b.{0,2}U.{0,2}\\x7d.*"; diff --git a/Mage/src/main/java/mage/util/ClassScanner.java b/Mage/src/main/java/mage/util/ClassScanner.java index dd1987b542..2be60c2fcf 100644 --- a/Mage/src/main/java/mage/util/ClassScanner.java +++ b/Mage/src/main/java/mage/util/ClassScanner.java @@ -40,7 +40,7 @@ import java.util.jar.JarInputStream; * * @author North */ -public class ClassScanner { +public final class ClassScanner { private static void checkClassForInclusion(List cards, Class type, String name, ClassLoader cl) { try { diff --git a/Mage/src/main/java/mage/util/DateFormat.java b/Mage/src/main/java/mage/util/DateFormat.java index 2bd324e85c..686ce04e53 100644 --- a/Mage/src/main/java/mage/util/DateFormat.java +++ b/Mage/src/main/java/mage/util/DateFormat.java @@ -33,7 +33,7 @@ import java.util.Date; * * @author LevelX2 */ -public class DateFormat { +public final class DateFormat { /** * calculates the duration between two dates and returns a string in the format hhh:mm:ss diff --git a/Mage/src/main/java/mage/util/DeckUtil.java b/Mage/src/main/java/mage/util/DeckUtil.java index bc6c31dabb..35d3c5cef7 100644 --- a/Mage/src/main/java/mage/util/DeckUtil.java +++ b/Mage/src/main/java/mage/util/DeckUtil.java @@ -31,7 +31,7 @@ package mage.util; * * @author LevelX2 */ -public class DeckUtil { +public final class DeckUtil { public static long fixedHash(String string) { long h = 1125899906842597L; // prime diff --git a/Mage/src/main/java/mage/util/GameLog.java b/Mage/src/main/java/mage/util/GameLog.java index 86345f481e..30e902e59c 100644 --- a/Mage/src/main/java/mage/util/GameLog.java +++ b/Mage/src/main/java/mage/util/GameLog.java @@ -34,7 +34,7 @@ import mage.ObjectColor; * * @author LevelX2 */ -public class GameLog { +public final class GameLog { static final String LOG_COLOR_PLAYER = "#20B2AA"; // LightSeaGreen static final String LOG_COLOR_PLAYER_REQUEST = "#D2691E"; // Chocolate diff --git a/Mage/src/main/java/mage/util/ManaUtil.java b/Mage/src/main/java/mage/util/ManaUtil.java index 6f17466967..3a1434eb2e 100644 --- a/Mage/src/main/java/mage/util/ManaUtil.java +++ b/Mage/src/main/java/mage/util/ManaUtil.java @@ -28,7 +28,7 @@ import mage.game.Game; /** * @author noxx */ -public class ManaUtil { +public final class ManaUtil { private ManaUtil() { } diff --git a/Mage/src/main/java/mage/util/RandomUtil.java b/Mage/src/main/java/mage/util/RandomUtil.java index e6ad582021..4447e1f64e 100644 --- a/Mage/src/main/java/mage/util/RandomUtil.java +++ b/Mage/src/main/java/mage/util/RandomUtil.java @@ -6,7 +6,7 @@ import java.util.concurrent.ThreadLocalRandom; /** * Created by IGOUDT on 5-9-2016. */ -public class RandomUtil { +public final class RandomUtil { public static Random getRandom() {return ThreadLocalRandom.current();} diff --git a/Mage/src/main/java/mage/util/TournamentUtil.java b/Mage/src/main/java/mage/util/TournamentUtil.java index ccf6c18673..7049100391 100644 --- a/Mage/src/main/java/mage/util/TournamentUtil.java +++ b/Mage/src/main/java/mage/util/TournamentUtil.java @@ -24,7 +24,7 @@ import mage.constants.Rarity; * * @author LevelX2 */ -public class TournamentUtil { +public final class TournamentUtil { /** * Tries to calculate the most appropiate sets to add basic lands for cards of a deck diff --git a/Mage/src/main/java/mage/util/trace/TraceUtil.java b/Mage/src/main/java/mage/util/trace/TraceUtil.java index ca1df9ea87..671703049e 100644 --- a/Mage/src/main/java/mage/util/trace/TraceUtil.java +++ b/Mage/src/main/java/mage/util/trace/TraceUtil.java @@ -25,7 +25,7 @@ import mage.constants.CardType; /** * @author magenoxx_at_gmail.com */ -public class TraceUtil { +public final class TraceUtil { private static final Logger log = Logger.getLogger(TraceUtil.class);