From 498c8cf60c49c6b0a9d086582360c25a59fb1d0a Mon Sep 17 00:00:00 2001 From: vraskulin Date: Mon, 27 Feb 2017 17:03:38 +0300 Subject: [PATCH] Made utility classes final to explicitly forbid it's inheritance --- Mage.Client/src/main/java/mage/client/SessionHandler.java | 2 +- .../src/main/java/mage/client/chat/LocalCommands.java | 2 +- .../java/mage/client/components/ext/TestMageFloatPane.java | 2 +- .../main/java/mage/client/deck/generator/DeckGenerator.java | 2 +- .../deckeditor/collection/viewer/CollectionViewerPanel.java | 2 +- .../mage/client/deckeditor/collection/viewer/MageBook.java | 2 +- .../main/java/mage/client/deckeditor/table/CardHelper.java | 2 +- .../main/java/mage/client/preference/MagePreferences.java | 2 +- .../src/main/java/mage/client/util/CardsViewUtil.java | 2 +- Mage.Client/src/main/java/mage/client/util/Config.java | 2 +- Mage.Client/src/main/java/mage/client/util/DeckUtil.java | 2 +- Mage.Client/src/main/java/mage/client/util/Format.java | 2 +- .../src/main/java/mage/client/util/GUISizeHelper.java | 2 +- Mage.Client/src/main/java/mage/client/util/IgnoreList.java | 2 +- Mage.Client/src/main/java/mage/client/util/ImageCaches.java | 2 +- Mage.Client/src/main/java/mage/client/util/ImageHelper.java | 2 +- Mage.Client/src/main/java/mage/client/util/SystemUtil.java | 2 +- .../main/java/mage/client/util/TransformedImageCache.java | 2 +- .../src/main/java/mage/client/util/gui/ArrowUtil.java | 2 +- .../src/main/java/mage/client/util/gui/GuiDisplayUtil.java | 2 +- .../src/main/java/mage/client/util/gui/TableUtil.java | 2 +- .../java/mage/client/util/gui/countryBox/CountryUtil.java | 2 +- .../main/java/mage/client/util/object/SaveObjectUtil.java | 2 +- .../main/java/mage/client/util/sets/ConstructedFormats.java | 2 +- .../java/mage/client/util/stats/MemoryUsageStatUtil.java | 2 +- .../main/java/org/mage/card/arcane/CardRendererUtils.java | 2 +- .../src/main/java/org/mage/card/arcane/ManaSymbols.java | 2 +- .../main/java/org/mage/card/arcane/TextboxRuleParser.java | 2 +- Mage.Client/src/main/java/org/mage/card/arcane/UI.java | 2 +- Mage.Client/src/main/java/org/mage/card/arcane/Util.java | 2 +- .../java/org/mage/plugins/card/constants/Constants.java | 2 +- .../java/org/mage/plugins/card/utils/CardImageUtils.java | 2 +- .../main/java/org/mage/plugins/card/utils/Transparency.java | 4 ++-- Mage.Common/src/mage/db/EntityManagerTest.java | 2 +- Mage.Common/src/mage/db/Statistics.java | 2 +- Mage.Common/src/mage/utils/CardUtil.java | 2 +- Mage.Common/src/mage/utils/CompressUtil.java | 2 +- Mage.Common/src/mage/utils/DeckBuilder.java | 2 +- Mage.Common/src/mage/utils/ThreadUtils.java | 2 +- Mage.Common/src/mage/utils/properties/PropertiesUtil.java | 2 +- Mage.Common/src/mage/utils/properties/PropertyKeys.java | 2 +- .../Mage.Player.AI.MA/src/mage/player/ai/Config2.java | 2 +- .../src/mage/player/ai/GameStateEvaluator2.java | 2 +- .../src/mage/player/ai/ma/ArtificialScoringSystem.java | 2 +- .../src/mage/player/ai/ma/MagicAbility.java | 2 +- .../src/mage/player/ai/util/CombatUtil.java | 2 +- .../src/main/java/mage/player/ai/utils/RateCard.java | 2 +- .../Mage.Player.AIMinimax/src/mage/player/ai/Config.java | 2 +- .../src/mage/player/ai/GameStateEvaluator.java | 2 +- .../src/main/java/mage/server/ExtensionPackageLoader.java | 2 +- Mage.Server/src/main/java/mage/server/GmailClient.java | 2 +- Mage.Server/src/main/java/mage/server/MailClient.java | 2 +- Mage.Server/src/main/java/mage/server/MailgunClient.java | 2 +- Mage.Server/src/main/java/mage/server/Main.java | 2 +- Mage.Server/src/main/java/mage/server/util/Config.java | 2 +- Mage.Server/src/main/java/mage/server/util/Splitter.java | 2 +- Mage.Server/src/main/java/mage/server/util/SystemUtil.java | 2 +- .../src/main/java/com/xmage/ws/json/ResponseBuilder.java | 2 +- .../main/java/com/xmage/ws/json/XMageStatsJSONBuilder.java | 2 +- .../src/main/java/com/xmage/ws/util/IPHolderUtil.java | 2 +- Mage.Stats/src/test/java/com/anygo/ws/util/FileUtil.java | 2 +- .../java/com/magefree/update/helpers/ChechsumHelper.java | 2 +- .../main/java/com/magefree/update/helpers/FileHelper.java | 2 +- Mage.Verify/src/main/java/mage/verify/MtgJson.java | 6 +++--- Mage/src/main/java/mage/actions/score/ScoringConstants.java | 2 +- .../java/mage/cards/decks/importer/DeckImporterUtil.java | 2 +- Mage/src/main/java/mage/cards/repository/CardScanner.java | 2 +- .../mage/cards/repository/PluginClassloaderRegistery.java | 2 +- .../src/main/java/mage/cards/repository/RepositoryUtil.java | 2 +- Mage/src/main/java/mage/filter/StaticFilters.java | 2 +- Mage/src/main/java/mage/game/ZonesHandler.java | 2 +- Mage/src/main/java/mage/util/CardUtil.java | 2 +- Mage/src/main/java/mage/util/ClassScanner.java | 2 +- Mage/src/main/java/mage/util/DateFormat.java | 2 +- Mage/src/main/java/mage/util/DeckUtil.java | 2 +- Mage/src/main/java/mage/util/GameLog.java | 2 +- Mage/src/main/java/mage/util/ManaUtil.java | 2 +- Mage/src/main/java/mage/util/RandomUtil.java | 2 +- Mage/src/main/java/mage/util/TournamentUtil.java | 2 +- Mage/src/main/java/mage/util/trace/TraceUtil.java | 2 +- 80 files changed, 83 insertions(+), 83 deletions(-) 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/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/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/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/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 56916cfbb3..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 { 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/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/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.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.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/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/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);