code style: private static final

This commit is contained in:
xenohedron 2023-07-07 23:34:16 -04:00
parent ef3be3987b
commit 45b54e8cc4
13 changed files with 20 additions and 22 deletions

View file

@ -11,7 +11,7 @@ import com.google.common.cache.Cache;
*/ */
public final class ImageCaches { public final class ImageCaches {
private final static ArrayList<Cache<?, ?>> IMAGE_CACHES; private static final ArrayList<Cache<?, ?>> IMAGE_CACHES;
static { static {
IMAGE_CACHES = new ArrayList<>(); IMAGE_CACHES = new ArrayList<>();

View file

@ -37,7 +37,7 @@ public class CardPanelRenderModeImage extends CardPanel {
private static final long serialVersionUID = -3272134219262184411L; private static final long serialVersionUID = -3272134219262184411L;
private final static SoftValuesLoadingCache<Key, BufferedImage> IMAGE_CACHE = ImageCaches.register(SoftValuesLoadingCache.from(CardPanelRenderModeImage::createImage)); private static final SoftValuesLoadingCache<Key, BufferedImage> IMAGE_CACHE = ImageCaches.register(SoftValuesLoadingCache.from(CardPanelRenderModeImage::createImage));
private static final int WIDTH_LIMIT = 90; // card width limit to create smaller counter private static final int WIDTH_LIMIT = 90; // card width limit to create smaller counter

View file

@ -31,7 +31,7 @@ public class CardPanelRenderModeMTGO extends CardPanel {
// https://www.mtg.onl/evolution-of-magic-token-card-frame-design/ // https://www.mtg.onl/evolution-of-magic-token-card-frame-design/
// Map of generated images // Map of generated images
private final static Cache<ImageKey, BufferedImage> IMAGE_CACHE = CacheBuilder private static final Cache<ImageKey, BufferedImage> IMAGE_CACHE = CacheBuilder
.newBuilder() .newBuilder()
.maximumSize(3000) .maximumSize(3000)
.expireAfterAccess(60, TimeUnit.MINUTES) .expireAfterAccess(60, TimeUnit.MINUTES)

View file

@ -154,12 +154,12 @@ class ChainerNightmareAdeptWatcher extends Watcher {
class ChainerNightmareAdeptTriggeredAbility extends EntersBattlefieldAllTriggeredAbility { class ChainerNightmareAdeptTriggeredAbility extends EntersBattlefieldAllTriggeredAbility {
private final static String abilityText = "Whenever a nontoken creature " private static final String abilityText = "Whenever a nontoken creature "
+ "enters the battlefield under your control, " + "enters the battlefield under your control, "
+ "if you didn't cast it from your hand, it gains haste until your next turn."; + "if you didn't cast it from your hand, it gains haste until your next turn.";
private final static ContinuousEffect gainHasteUntilNextTurnEffect private static final ContinuousEffect gainHasteUntilNextTurnEffect
= new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.UntilYourNextTurn); = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.UntilYourNextTurn);
private final static FilterControlledCreaturePermanent filter private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("nontoken creature"); = new FilterControlledCreaturePermanent("nontoken creature");
static { static {

View file

@ -31,7 +31,7 @@ import mage.game.Game;
*/ */
public final class LiesaForgottenArchangel extends CardImpl { public final class LiesaForgottenArchangel extends CardImpl {
private final static FilterControlledCreaturePermanent filter private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("another nontoken creature you control"); = new FilterControlledCreaturePermanent("another nontoken creature you control");
static { static {

View file

@ -39,9 +39,9 @@ public class SquadTest extends CardTestPlayerBase {
* Arco-Flagellant cant block. * Arco-Flagellant cant block.
* Endurant Pay 3 life: Arco-Flagellant gains indestructible until end of turn. * Endurant Pay 3 life: Arco-Flagellant gains indestructible until end of turn.
*/ */
private final static String flagellant = "Arco-Flagellant"; private static final String flagellant = "Arco-Flagellant";
private final static String swamp = "Swamp"; private static final String swamp = "Swamp";
@Test @Test
public void test_Squad_NotUsed_Manual() { public void test_Squad_NotUsed_Manual() {

View file

@ -7,8 +7,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
public class ValkiGodOfLiesTest extends CardTestPlayerBase { public class ValkiGodOfLiesTest extends CardTestPlayerBase {
private final static String valki = "Valki, God of Lies"; private static final String valki = "Valki, God of Lies";
private final static String kraken = "Kraken Hatchling"; private static final String kraken = "Kraken Hatchling";
@Test @Test
public void testBecomeCopyOfExiledCreatureCard() { public void testBecomeCopyOfExiledCreatureCard() {

View file

@ -1390,7 +1390,7 @@ public abstract class AbilityImpl implements Ability {
} }
@Override @Override
final public List<CardIcon> getIcons() { public final List<CardIcon> getIcons() {
return getIcons(null); return getIcons(null);
} }

View file

@ -19,11 +19,11 @@ public final class PlayableCountIcon extends CardIconImpl {
super(CardIconType.PLAYABLE_COUNT, getHint(objectStats), getAmount(objectStats)); super(CardIconType.PLAYABLE_COUNT, getHint(objectStats), getAmount(objectStats));
} }
static private String getAmount(PlayableObjectStats objectStats) { private static String getAmount(PlayableObjectStats objectStats) {
return String.valueOf(objectStats.getPlayableAmount()); return String.valueOf(objectStats.getPlayableAmount());
} }
static private String getHint(PlayableObjectStats objectStats) { private static String getHint(PlayableObjectStats objectStats) {
String res = "Playable abilities: " + objectStats.getPlayableAmount(); String res = "Playable abilities: " + objectStats.getPlayableAmount();
// abilities list already sorted // abilities list already sorted
List<String> list = objectStats.getPlayableAbilities(); List<String> list = objectStats.getPlayableAbilities();

View file

@ -31,7 +31,7 @@ public class AwakenAbility extends SpellAbility {
private static final Logger logger = Logger.getLogger(AwakenAbility.class); private static final Logger logger = Logger.getLogger(AwakenAbility.class);
static private String filterMessage = "a land you control to awake"; private static String filterMessage = "a land you control to awake";
private String rule; private String rule;
private int awakenValue; private int awakenValue;

View file

@ -112,7 +112,7 @@ public class BestowAbility extends SpellAbility {
return "Bestow " + getManaCostsToPay().getText() + " <i>(If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)</i>"; return "Bestow " + getManaCostsToPay().getText() + " <i>(If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)</i>";
} }
static public void becomeCreature(Permanent permanent, Game game) { public static void becomeCreature(Permanent permanent, Game game) {
// permanently changes to the object // permanently changes to the object
if (permanent != null) { if (permanent != null) {
MageObject basicObject = permanent.getBasicMageObject(game); MageObject basicObject = permanent.getBasicMageObject(game);
@ -126,7 +126,7 @@ public class BestowAbility extends SpellAbility {
} }
} }
static public void becomeAura(Card card) { public static void becomeAura(Card card) {
// permanently changes to the object // permanently changes to the object
if (card != null) { if (card != null) {
card.addSubType(SubType.AURA); card.addSubType(SubType.AURA);

View file

@ -41,12 +41,11 @@ public class CompanionAbility extends SpecialAction {
return "Companion &mdash; " + companionCondition.getRule(); return "Companion &mdash; " + companionCondition.getRule();
} }
final public boolean isLegal(Set<Card> cards, int startingHandSize) { public final boolean isLegal(Set<Card> cards, int startingHandSize) {
return companionCondition.isLegal(cards, startingHandSize); return companionCondition.isLegal(cards, startingHandSize);
} }
final public String getLegalRule() { public final String getLegalRule() {
return companionCondition.getRule(); return companionCondition.getRule();
} }
} }

View file

@ -17,7 +17,6 @@ import mage.constants.WatcherScope;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -74,7 +73,7 @@ public class ExertAbility extends SimpleStaticAbility {
class ExertReplacementEffect extends ReplacementEffectImpl { class ExertReplacementEffect extends ReplacementEffectImpl {
final private boolean exertOnlyOncePerTurn; private final boolean exertOnlyOncePerTurn;
public ExertReplacementEffect(boolean exertOnlyOncePerTurn) { public ExertReplacementEffect(boolean exertOnlyOncePerTurn) {
super(Duration.WhileOnBattlefield, Outcome.Detriment); super(Duration.WhileOnBattlefield, Outcome.Detriment);