- CheckStyle.

This commit is contained in:
Chris
2012-02-23 03:13:26 +00:00
parent 4819fd11c4
commit ce5616b220
12 changed files with 31 additions and 32 deletions

View File

@@ -424,10 +424,10 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
@SuppressWarnings("unchecked")
@Override
public int compare(Entry<T, Integer> o1, Entry<T, Integer> o2) {
return sorter.compare((Entry<InventoryItem, Integer>)o1, (Entry<InventoryItem, Integer>)o2);
return sorter.compare((Entry<InventoryItem, Integer>) o1, (Entry<InventoryItem, Integer>) o2);
}
}
/**
* Resort.
*/

View File

@@ -67,9 +67,8 @@ public final class TableView<T extends InventoryItem> {
/** The want unique. */
private boolean wantUnique = false;
private final Class<T> genericType;
// need this to allow users place its contents
/**
*
@@ -128,7 +127,7 @@ public final class TableView<T extends InventoryItem> {
public TableView(final String title, final boolean showStats, final boolean forceUnique, Class<T> cls) {
// components
genericType = cls;
final Color gray = new Color(148, 145, 140);
final TitledBorder titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, gray), title);
@@ -277,7 +276,6 @@ public final class TableView<T extends InventoryItem> {
this.setDeckImpl(pool);
}
/**
*
* setDeckImpl.

View File

@@ -85,11 +85,12 @@ public class PreconDeck implements InventoryItemFromSet {
String setProxy = "n/a";
FileSection kv = FileSection.parse(sections.get("metadata"), "=");
imageFilename = kv.get("Image");
description = kv.get("Description");
if( AllZone.getEditions().getEditionByCode(kv.get("set").toUpperCase()) != null )
{ setProxy = kv.get("set"); }
if (AllZone.getEditions().getEditionByCode(kv.get("set").toUpperCase()) != null) {
setProxy = kv.get("set");
}
this.set = setProxy;
this.recommendedDeals = new SellRules(sections.get("shop"));

View File

@@ -75,8 +75,8 @@ public enum FModel {
private final QuestEventManager questEventManager;
private final GameState gameState;
private final FMatchState matchState;
// have to implement lazy initialization - at the moment of FModel.ctor() CardDb is not ready yet.
// have to implement lazy initialization - at the moment of FModel.ctor() CardDb is not ready yet.
private CardCollections decks;
/**
@@ -310,12 +310,13 @@ public enum FModel {
}
/**
* Returns all player's decks for constructed, sealed and whatever
* Returns all player's decks for constructed, sealed and whatever.
* @return {@link forge.decks.CardCollections}
*/
public final CardCollections getDecks() {
if (decks == null)
this.decks = new CardCollections(ForgeProps.getFile(NewConstants.NEW_DECKS));
if (decks == null) {
this.decks = new CardCollections(ForgeProps.getFile(NewConstants.NEW_DECKS));
}
return decks;
}

View File

@@ -42,7 +42,7 @@ public class SellRules {
if (null == questShop || questShop.isEmpty()) {
return;
}
FileSection section = FileSection.parse(questShop, "=");
minWins = section.getInt("WinsToUnlock");
cost = section.getInt("Credits", 250);

View File

@@ -117,7 +117,7 @@ public final class QuestData {
// Decks collected by player
/** The my decks. */
private final HashMap<String, Deck> myDecks = new HashMap<String, Deck>();
private transient IFolderMap<Deck> decks;
// Cards associated with quest
@@ -199,8 +199,9 @@ public final class QuestData {
this.initTransients();
this.setName(s0);
QuestPreferences prefs = Singletons.getModel().getQuestPreferences();
ItemPoolView<CardPrinted> lands = QuestUtilCards.generateBasicLands( prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS), prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS) );
QuestPreferences prefs = Singletons.getModel().getQuestPreferences();
ItemPoolView<CardPrinted> lands = QuestUtilCards.generateBasicLands(prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS),
prefs.getPreferenceInt(QPref.STARTING_BASIC_LANDS));
this.getCardPool().addAll(lands);
this.randomizeOpponents();
}
@@ -210,8 +211,7 @@ public final class QuestData {
this.decks = new QuestDeckMap(myDecks);
this.myCards = new QuestUtilCards(this);
// to avoid NPE some pools will be created here if they are null
if (null == this.getNewCardList()) {
this.setNewCardList(new ItemPool<InventoryItem>(InventoryItem.class));

View File

@@ -14,15 +14,14 @@ import forge.util.IFolderMap;
*/
public class QuestDeckMap implements IFolderMap<Deck> {
public QuestDeckMap() {
map = new HashMap<String,Deck>();
map = new HashMap<String, Deck>();
}
public QuestDeckMap(Map<String,Deck> inMap) {
public QuestDeckMap(Map<String, Deck> inMap) {
map = inMap;
}
private final Map<String, Deck> map;
/* (non-Javadoc)
* @see forge.util.IFolderMapView#get(java.lang.String)

View File

@@ -58,7 +58,7 @@ public class QuestEventManager {
/** The very hard a iduels. */
private final List<QuestDuel> veryHardAIduels = new ArrayList<QuestDuel>();
/** The all duels. */
private List<QuestDuel> allDuels = null;

View File

@@ -27,7 +27,7 @@ import javax.swing.JOptionPane;
import org.apache.commons.lang3.StringUtils;
/**
* This class treats every line of a given file as a source for a named object.
* This class treats every line of a given file as a source for a named object.
*
*/
public abstract class StorageReaderFile<T extends IHasName> implements IItemReader<T> {

View File

@@ -33,8 +33,8 @@ import org.apache.commons.lang3.StringUtils;
import forge.error.ErrorViewer;
/**
* This class treats every file in the given folder as a source for a named object.
* The descendant should implement read method to deserialize a single item.
* This class treats every file in the given folder as a source for a named object.
* The descendant should implement read method to deserialize a single item.
* So that readAll will return a map of Name => Object as read from disk
*
*/
@@ -102,7 +102,7 @@ public abstract class StorageReaderFolder<T extends IHasName> implements IItemRe
/**
* Read the object from file
* Read the object from file.
* @param file
* @return the object deserialized by inherited class
*/

View File

@@ -519,7 +519,7 @@ public class QuestWinLoseHandler extends ControlWinLose {
*/
private void awardBooster() {
final GameFormat[] emptyFormatArray = {};
final GameFormat[] formats = AllZone.getFormats().getFormats().toArray(emptyFormatArray) ;
final GameFormat[] formats = AllZone.getFormats().getFormats().toArray(emptyFormatArray);
final ListChooser<GameFormat> ch = new ListChooser<GameFormat>("Choose bonus booster format", 1, formats);
String prefferedFormat = Singletons.getModel().getQuestPreferences().getPreference(QPref.BOOSTER_FORMAT);

View File

@@ -392,7 +392,7 @@ public class DeckLister extends JPanel {
if (n == JOptionPane.NO_OPTION) {
return;
}
final CardCollections deckManager = Singletons.getModel().getDecks();
if (gametype.equals(GameType.Draft)) {