Skip to content

Commit

Permalink
PMD corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Sep 22, 2023
1 parent 12df1e6 commit 0e2996a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions vassal-app/src/main/java/VASSAL/build/module/Console.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ private boolean doSides() {
else {
option = first;
}
final String property = nextString("");

if (matches("?", option) || matches("help", option)) { //NON-NLS
show("Usage:"); //NON-NLS
Expand All @@ -399,28 +398,26 @@ else if (option.isEmpty() || matches("list", option)) { //NON-NLS
// availableSides and alreadyTaken are translated side names
final PlayerRoster pr = new PlayerRoster();
final ArrayList<String> sides = new ArrayList<>(pr.getSides());
final ArrayList<String> alreadyTaken = new ArrayList<>();

// List the sides, checking each
for (int i = 0; i < sides.size(); i++) { // search of sides
final String s = sides.get(i);
for (final String s : sides) { // search of sides
// Is side allocated to a player? Which one ?
for (final PlayerRoster.PlayerInfo p : pr.players) {
if (sides.get(i).equals(p.getLocalizedSide())) {
if (s.equals(p.getLocalizedSide())) {
status = "Occupied (" + p.playerName + ")";
break;
}
}
if (status.isEmpty()) {
// No matching player, so side is either locked (by module) or available...
if (Boolean.valueOf((String) gm.getProperty("VassalHideSide_" + pr.untranslateSide(s)))) {
if (Boolean.parseBoolean((String) gm.getProperty("VassalHideSide_" + pr.untranslateSide(s)))) {
status = "Locked";
}
else {
status = "Available";
}
}
show(sides.get(i) + " " + status);
show(s + " " + status);
}
}

Expand Down

0 comments on commit 0e2996a

Please sign in to comment.