Made utility classes final to explicitly forbid it's inheritance

This commit is contained in:
vraskulin 2017-02-27 17:03:38 +03:00
parent f309717616
commit 498c8cf60c
80 changed files with 83 additions and 83 deletions

View file

@ -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;

View file

@ -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")) {

View file

@ -36,7 +36,7 @@ import org.apache.log4j.Logger;
*
* @author North
*/
public class CardScanner {
public final class CardScanner {
public static boolean scanned = false;

View file

@ -36,7 +36,7 @@ import java.util.List;
*
* @author Lymia
*/
public class PluginClassloaderRegistery {
public final class PluginClassloaderRegistery {
static List<ClassLoader> pluginClassloaders = new ArrayList<>();
public static void registerPluginClassloader(ClassLoader cl) {

View file

@ -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);

View file

@ -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");

View file

@ -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)) {

View file

@ -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.*";

View file

@ -40,7 +40,7 @@ import java.util.jar.JarInputStream;
*
* @author North
*/
public class ClassScanner {
public final class ClassScanner {
private static void checkClassForInclusion(List<Class> cards, Class type, String name, ClassLoader cl) {
try {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -28,7 +28,7 @@ import mage.game.Game;
/**
* @author noxx
*/
public class ManaUtil {
public final class ManaUtil {
private ManaUtil() {
}

View file

@ -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();}

View file

@ -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

View file

@ -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);