Skip to content

Commit

Permalink
Run spotless. (#11793)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Jul 19, 2023
1 parent 8a8d888 commit ecb801f
Show file tree
Hide file tree
Showing 48 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Territory extends NamedAttachable implements NamedUnitHolder, Compa
private static final long serialVersionUID = -6390555051736721082L;

private final boolean water;

/**
* The territory owner; defaults to {@link PlayerList#getNullPlayer()} if the territory is not
* owned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class AddUnits extends Change {
private final String name;
private final Collection<Unit> units;
private final String type;

/**
* The unit's owner can be modified sometime after this Change is created but before it is
* performed. To ensure that the newly created units have the correct ownership, their original
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class RemoveUnits extends Change {
private final String name;
private final Collection<Unit> units;
private final String type;

/**
* The unit's owner can be modified sometime after this Change is created but before it is
* performed. To ensure that the newly created units have the correct ownership, their original
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class UnitDamageReceivedChange extends Change {

/** Maps unit ids to the total damage they have */
private final Map<String, Integer> newTotalDamage;

/** Maps unit ids to the total damage they used to have */
private final Map<String, Integer> oldTotalDamage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum Suicide {
@Getter(value = AccessLevel.NONE)
@Builder.Default
Suicide suicideOnOffense = Suicide.NONE;

/** When should this unit commit suicide on defense */
@Getter(value = AccessLevel.NONE)
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enum Team {
}

@Nonnull String name;

/** The unit types that have this ability */
@NonFinal Collection<UnitType> attachedUnitTypes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

public class HtmlUtils {
private HtmlUtils() {}

/**
* @param text Text to be wrapped with html-tags
* @return Wrapped text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class ServerGame extends AbstractGame {
* startgame(...) method from returning.
*/
private final CountDownLatch delegateExecutionStoppedLatch = new CountDownLatch(1);

/** Has the delegate signaled that delegate execution should stop. */
private volatile boolean delegateExecutionStopped = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package games.strategy.engine.framework.map.download;

// TODO: move to package games.strategy.engine.framework.map.download.client

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
final class MapDownloadProgressListener {
private final MapDownloadItem download;
private final JProgressBar progressBar;

/** The amount total that we will be downloading. */
private final long downloadLength;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public interface WatcherThreadMessaging {
+ "TripleA comes out.)\n"
+ "And that your Router is configured to send TCP traffic the correct port "
+ " to your local ip address.";

/**
* When a host posts a game to the lobby, the lobby will verify connectivity to the host via a
* 'reverse connection' back to the game host. If the reverse connection fails then this method is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
public class ServerConnectionProps {
/** Player name, the desired name for the current player connecting to remote host. */
@Nonnull private final String name;

/** Remote host address. */
@Nonnull private final Integer port;

/**
* Password to use to connect to the remotely hosted game, this is set by the host of the game.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
class LobbyWatcherKeepAliveTask implements Runnable {
/** The current gameId, updated if we re-post. */
@Nonnull private String gameId;

/** Call this after re-posting so we can update with a new game id. */
@Nonnull private final Consumer<String> gameIdSetter;

/** Call this to send a keep-alive request to server. */
@Nonnull private final Predicate<String> keepAliveSender;

/** Call this to re-post the current game, obtains a new game id. */
@Nonnull private final Supplier<GamePostingResponse> gamePoster;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class TaskRunner<E extends Exception> {
* cancelled and this is invoked with the exception that occurred.
*/
@Nonnull private final Consumer<E> exceptionHandler;

/**
* Title of the wait spinner window that is displayed to user while a background action is being
* executed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ public class RemoveUnitsHistoryChange implements HistoryChange {
Map<Territory, Collection<Unit>> unloadedUnits = new HashMap<>();
TransformDamagedUnitsHistoryChange transformDamagedUnitsHistoryChange;
String messageTemplate;

/** Units that were killed */
Collection<Unit> oldUnits = new ArrayList<>();

/** The units that were created after a transformation */
Collection<Unit> newUnits = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class TransformDamagedUnitsHistoryChange implements HistoryChange {

CompositeChange change = new CompositeChange();
Territory location;

/** Map of old unit -> new unit */
Map<Unit, Unit> transformingUnits = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Decoder {
private final ErrorReporter errorReporter;
private final IObjectStreamFactory objectStreamFactory;
private final NioSocket nioSocket;

/**
* These sockets are quarantined. They have not logged in, and messages read from them are not
* passed outside of the quarantine conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ public abstract class AbstractRulesAttachment extends AbstractConditionsAttachme
protected int objectiveValue = 0;
// only matters for objectiveValue, does not affect the condition
protected int uses = -1;

// condition for what turn it is
@RenameOnNextMajorRelease(newName = "rounds")
protected @Nullable Map<Integer, Integer> turns = null;

// for on/off conditions
protected boolean switched = true;
// allows custom GameProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ public abstract class AbstractUserActionAttachment extends AbstractConditionsAtt
// a key referring to politicaltexts.properties or other .properties for all the UI messages
// belonging to this action.
protected String text = "";

/**
* The cost in PUs to attempt this action.
*
* @deprecated Replaced by costResources. The value is here only for backward compatibility with
* possibly old map downloads that still have this value.
*/
@Deprecated protected int costPu = 0;

// cost in any resources to attempt this action
protected @Nullable IntegerMap<Resource> costResources = null;
// how many times can you perform this action each round?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,13 @@ public class UnitAttachment extends DefaultAttachment {
private int whenCapturedSustainsDamage = 0;
private @Nullable List<GamePlayer> canBeCapturedOnEnteringBy = null;
private @Nullable List<GamePlayer> canBeGivenByTerritoryTo = null;

// a set of information for dealing with special abilities or loss of abilities when a unit takes
// x-y amount of damage
@ChangeOnNextMajorRelease("This should be a list of WhenCombatDamaged objects instead of Tuples")
private @Nullable List<Tuple<Tuple<Integer, Integer>, Tuple<String, String>>> whenCombatDamaged =
null;

// a kind of support attachment for giving actual unit attachment abilities or other to a unit,
// when in the presence or on the same route with another unit
private @Nullable List<String> receivesAbilityWhenWith = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum DieType {

/** The value of the dice, 0 based. */
private final int value;

/** This value is 1 based. */
private final int rolledAt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ abstract class AbstractBattle implements IBattle {
private static final long serialVersionUID = 871090498661731337L;

final UUID battleId = UUID.randomUUID();

/**
* In headless mode we should NOT access any Delegates. In headless mode we are just being used to
* calculate results for an odds calculator so we can skip some steps for efficiency.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class UnitImageFactory {
* account.
*/
private final int unitIconWidth;

/**
* Height of all icons. You probably want getUnitImageHeight(), which takes scale factor into
* account.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ LobbySelectionViewData toLobbySelectionViewData() {

/** Which lobby choice radio button is selected eg: prod / local / other */
@Nonnull LobbyChoice selectedRadioButton;

/** The string text in the uri field. */
@Nonnull String uriFieldValue;

/** Whether a user can edit the uri field. */
@Nonnull Boolean uriFieldEnabled;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ public enum OptionType {

/** The menu title */
@Nonnull String title;

/**
* The type of option
*
* <p>Not used if subOptions is non-empty
*/
@Builder.Default OptionType optionType = OptionType.NORMAL;

/**
* Used to group the related ON_OFF_EXCLUSIVE options
*
* <p>Only used if optionType is ON_OFF_EXCLUSIVE
*/
@Builder.Default String exclusiveGroup = "";

/** These options become available when the parent option is selected */
@Builder.Default List<AiPlayerDebugOption> subOptions = List.of();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public class MapRouteDrawer {

private static final SplineInterpolator splineInterpolator = new SplineInterpolator();

/**
* This value influences the "resolution" of the Path. Too low values make the Path look edgy, too
* high values will cause lag and rendering errors because the distance between the drawing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ public static class SeparatorCategories {
* amount)
*/
@Builder.Default @Nullable final Map<Unit, Collection<Unit>> dependents = null;

/** whether to categorize by movement */
@Builder.Default final boolean movement = false;

/** whether to categorize by movement for air units only */
@Builder.Default final boolean movementForAirUnitsOnly = false;

/** whether to categorize by transport cost */
@Builder.Default final boolean transportCost = false;

/** whether to categorize transports by movement */
@Builder.Default final boolean transportMovement = false;

/** whether to categorize by whether the unit can retreat or not */
@Builder.Default final boolean retreatPossibility = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class ImageScrollerLargeView extends JComponent {
protected double scale = 1;
private int dragScrollingLastX;
private int dragScrollingLastY;

/**
* 'wasLastActionDragging' tracks if the last user action was right click dragging the map. It is
* used so if we have units selected and drag the map that we will not deselect the units. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ public final class Version implements Serializable, Comparable<Version> {

/** Indicates engine incompatible releases. */
private int major;

/** Indicates engine compatible releases. */
private int minor;

/**
* Point (build number), unused, kept for serialization compatibility.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public Player newPlayerWithName(final String name) {
return new TripleAPlayer(name, getLabel(), false);
}
};

/** A hidden player type to represent network connected players. */
public static final PlayerTypes.Type CLIENT_PLAYER =
new PlayerTypes.Type("Client", false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ public class LoginResult {
* with the lobby we can send this API-Key instead of logging in again.
*/
private final ApiKey apiKey;

/** The name of the user that has logged in. */
private final UserName username;

/**
* Anonymous login is a login without an account, an unregistered login. No password is required.
*/
private final boolean anonymousLogin;

/**
* Moderator flag indicates if the user is a moderator, this comes from a lookup on the lobby side
* and the lobby tells us if this user is a moderator.
*/
private final boolean moderator;

/**
* If the user is using a temporary password, the lobby will set the password change required flag
* in its response to indicate the user should be prompted with a password change prompt.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public abstract class ActionPanel extends JPanel {

@Getter(AccessLevel.PROTECTED)
protected final MapPanel map;

/** Refreshes the action panel. */
protected final Runnable refresh =
() -> SwingUtilities.invokeLater(() -> SwingComponents.redraw(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
public class MovePanel extends AbstractMovePanel {
private static final long serialVersionUID = 5004515340964828564L;
private static final int defaultMinTransportCost = 5;

/** Number of units to add/remove when Alt key is down. */
private static final int MULTI_SELECT_NUMBER = 10;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ interface YamlKeys {
@EqualsAndHashCode
public static class MapGame {
private final String gameName;

/** Path of the XML file relative to the location of map.yml file. */
private final String xmlFileName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public class CanUploadErrorReportResponse {
* If true, then responseDetails and existingBugReportUrl will be null.
*/
@Nonnull private final Boolean canUpload;

/**
* Contains any message details that should be displayed to the user. EG: "This error is already
* uploaded"
*/
@Nullable private final String responseDetails;

/** Contains a link to any existing error report that matches the same error the user sees. */
@Nullable private final String existingBugReportUrl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
public class HttpClient<ClientTypeT> implements Supplier<ClientTypeT> {

private static final Decoder gsonDecoder = JsonDecoder.gsonDecoder();

/**
* Allowed idle time for a connection with no activity (waiting to receive a message). Expressed
* in milliseconds. Default 5 seconds.
*/
private static final int DEFAULT_CONNECT_TIMEOUT_MS = 5000;

/**
* The time a connection should allow for completely receiving a message. Expressed in
* milliseconds. Default 20 seconds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class HttpClientConstants {
* Arbitrary length to prevent titles from being too large and cluttering up the issue display.
*/
public static final int TITLE_MAX_LENGTH = 125;

/** Max length for github issue body text. */
public static final int REPORT_BODY_MAX_LENGTH = 65536;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GithubApiClient {
"API-token==test--returned-a-stubbed-github-issue-link";

private final GithubApiFeignClient githubApiFeignClient;

/**
* Flag useful for testing, when set to true no API calls will be made and a hardcoded stubbed
* value of {@code STUBBED_RETURN_VALUE} will always be returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class LobbyHttpClientConfig {

/** The "major.minor" version of the client using the http-client (EG: "3.6") */
@Nonnull private final String clientVersion;

/** The system-id of the client using the http-client. */
@Nonnull private final String systemId;

Expand Down
Loading

0 comments on commit ecb801f

Please sign in to comment.