Merge pull request #2891 from kubikrubikvkube/master

Nulls to optional. Also there was bug with AetherChaser
This commit is contained in:
ingmargoudt 2017-02-27 17:51:35 +01:00 committed by GitHub
commit afbf5ce2b6
131 changed files with 188 additions and 183 deletions

View file

@ -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 <T>
*/
public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements ManaCosts<T> {
protected UUID id;
protected final UUID id;
protected String text = null;
private static Map<String, ManaCosts> costs = new HashMap<>();
@ -323,7 +320,7 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> 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()) {

View file

@ -36,7 +36,7 @@ import java.util.Objects;
*/
public class EpicEffect extends OneShotEffect {
final String rule = "<br>Epic <i>(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 = "<br>Epic <i>(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);

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

@ -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<CardIdentity> cubeCards = new ArrayList<>();
protected List<CardIdentity> leftCubeCards = new ArrayList<>();

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