- CheckStyle.

This commit is contained in:
Chris
2012-04-09 19:05:04 +00:00
parent f77c9cdde7
commit ed1915fba8
8 changed files with 31 additions and 29 deletions

View File

@@ -32,13 +32,14 @@ public enum PhaseType {
} }
public static PhaseType getByIndex(int idx) { public static PhaseType getByIndex(int idx) {
for( PhaseType ph : PhaseType.values() ) for (PhaseType ph : PhaseType.values()) {
{
if ( ph.Index == idx ) return ph;
}
throw new InvalidParameterException("No PhaseType found with index " + idx );
}
if (ph.Index == idx) {
return ph;
}
}
throw new InvalidParameterException("No PhaseType found with index " + idx);
}
public final boolean isAfter(final PhaseType phase) { public final boolean isAfter(final PhaseType phase) {
return this.Index > phase.Index; return this.Index > phase.Index;

View File

@@ -391,8 +391,8 @@ public class PhaseUtil {
// Index of field; computer is 0, human is 1 // Index of field; computer is 0, human is 1
int i = p.isComputer() ? 0 : 1; int i = p.isComputer() ? 0 : 1;
switch(s) switch(s) {
{
case UPKEEP: case UPKEEP:
lbl = t.getFieldControls().get(i).getView().getLblUpkeep(); lbl = t.getFieldControls().get(i).getView().getLblUpkeep();
break; break;

View File

@@ -77,7 +77,8 @@ public final class MenuCommon extends MenuBase<Deck> {
// The only remaining reference to global variable! // The only remaining reference to global variable!
randomDeck.getMain().addAllFlat(Predicate.not(CardRules.Predicates.Presets.IS_BASIC_LAND).random(CardDb.instance().getAllUniqueCards(), CardPrinted.FN_GET_RULES, 15*5)); randomDeck.getMain().addAllFlat(Predicate.not(CardRules.Predicates.Presets.IS_BASIC_LAND)
.random(CardDb.instance().getAllUniqueCards(), CardPrinted.FN_GET_RULES, 15 * 5));
randomDeck.getMain().add("Plains"); randomDeck.getMain().add("Plains");
randomDeck.getMain().add("Island"); randomDeck.getMain().add("Island");
randomDeck.getMain().add("Swamp"); randomDeck.getMain().add("Swamp");

View File

@@ -276,10 +276,10 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
// Store the current rows and others. // Store the current rows and others.
final List<CardStackRow> storedRows = new ArrayList<CardStackRow>(this.rows.size()); final List<CardStackRow> storedRows = new ArrayList<CardStackRow>(this.rows.size());
for (final CardStackRow row : this.rows) { for (final CardStackRow row : this.rows) {
try{ try {
storedRows.add((CardStackRow) row.clone()); storedRows.add((CardStackRow) row.clone());
} }
catch(NullPointerException e){ catch (NullPointerException e) {
System.out.println("Null pointer exception in Row Spacing. Possibly also part of the issue."); System.out.println("Null pointer exception in Row Spacing. Possibly also part of the issue.");
} }
} }
@@ -342,9 +342,9 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
try { try {
rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow); rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow);
} }
catch(ArrayIndexOutOfBoundsException e) { catch (ArrayIndexOutOfBoundsException e) {
System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, " + System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, "
" I believe it causes the no cards loading in issue we've noticed."); + " I believe it causes the no cards loading in issue we've noticed.");
// TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0 // TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0
} }
currentRow = new CardStackRow(); currentRow = new CardStackRow();
@@ -360,9 +360,9 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
try { try {
rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow); rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow);
} }
catch(ArrayIndexOutOfBoundsException e) { catch (ArrayIndexOutOfBoundsException e) {
System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, " + System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, "
" I believe it causes the no cards loading in issue we've noticed."); + " I believe it causes the no cards loading in issue we've noticed.");
// TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0 // TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0
} }
} }