From ecb801fc736da774729e0966f00fb8f142673246 Mon Sep 17 00:00:00 2001 From: asvitkine Date: Tue, 18 Jul 2023 23:11:31 -0400 Subject: [PATCH] Run spotless. (#11793) --- .../src/main/java/games/strategy/engine/data/Territory.java | 1 + .../games/strategy/engine/data/changefactory/AddUnits.java | 1 + .../strategy/engine/data/changefactory/RemoveUnits.java | 1 + .../data/changefactory/units/UnitDamageReceivedChange.java | 1 + .../strategy/engine/data/unit/ability/CombatUnitAbility.java | 1 + .../engine/data/unit/ability/ConvertUnitAbility.java | 1 + .../main/java/games/strategy/engine/framework/HtmlUtils.java | 1 + .../java/games/strategy/engine/framework/ServerGame.java | 1 + .../engine/framework/map/download/ContentReader.java | 1 + .../framework/map/download/MapDownloadProgressListener.java | 1 + .../engine/framework/startup/WatcherThreadMessaging.java | 1 + .../engine/framework/startup/mc/ServerConnectionProps.java | 2 ++ .../framework/startup/ui/LobbyWatcherKeepAliveTask.java | 3 +++ .../strategy/engine/framework/ui/background/TaskRunner.java | 1 + .../history/change/units/RemoveUnitsHistoryChange.java | 2 ++ .../change/units/TransformDamagedUnitsHistoryChange.java | 1 + .../src/main/java/games/strategy/net/nio/Decoder.java | 1 + .../triplea/attachments/AbstractRulesAttachment.java | 2 ++ .../triplea/attachments/AbstractUserActionAttachment.java | 2 ++ .../games/strategy/triplea/attachments/UnitAttachment.java | 2 ++ .../src/main/java/games/strategy/triplea/delegate/Die.java | 1 + .../strategy/triplea/delegate/battle/AbstractBattle.java | 1 + .../java/games/strategy/triplea/image/UnitImageFactory.java | 1 + .../triplea/settings/lobby/LobbySelectionViewData.java | 2 ++ .../triplea/ui/menubar/debug/AiPlayerDebugOption.java | 3 +++ .../games/strategy/triplea/ui/panels/map/MapRouteDrawer.java | 1 + .../main/java/games/strategy/triplea/util/UnitSeparator.java | 5 +++++ .../main/java/games/strategy/ui/ImageScrollerLargeView.java | 1 + .../game-core/src/main/java/org/triplea/util/Version.java | 2 ++ .../engine/framework/startup/mc/HeadedPlayerTypes.java | 1 + .../strategy/engine/lobby/client/login/LoginResult.java | 4 ++++ .../src/main/java/games/strategy/triplea/ui/ActionPanel.java | 1 + .../java/games/strategy/triplea/ui/panel/move/MovePanel.java | 1 + .../org/triplea/map/description/file/MapDescriptionYaml.java | 1 + .../client/error/report/CanUploadErrorReportResponse.java | 2 ++ .../src/main/java/org/triplea/http/client/HttpClient.java | 2 ++ .../java/org/triplea/http/client/HttpClientConstants.java | 1 + .../java/org/triplea/http/client/github/GithubApiClient.java | 1 + .../java/org/triplea/http/client/LobbyHttpClientConfig.java | 1 + .../client/error/report/CanUploadErrorReportResponse.java | 2 ++ .../triplea/http/client/lobby/login/LobbyLoginResponse.java | 4 ++++ .../http/client/lobby/moderator/toolbox/PagingParams.java | 1 + .../triplea/http/client/maps/listing/MapDownloadItem.java | 2 ++ .../ui/events/queue/test/support/EventQueueTestSupport.java | 1 + .../org/triplea/http/client/web/socket/MessageEnvelope.java | 1 + .../java/org/triplea/web/socket/WebSocketMessagingBus.java | 1 + .../triplea/db/dao/api/key/GameHostingApiKeyDaoWrapper.java | 1 + .../org/triplea/db/dao/api/key/PlayerApiKeyDaoWrapper.java | 1 + 48 files changed, 73 insertions(+) diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/Territory.java b/game-app/game-core/src/main/java/games/strategy/engine/data/Territory.java index e93b04500aa..fabe3f6a2e7 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/Territory.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/Territory.java @@ -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. diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/AddUnits.java b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/AddUnits.java index 05d653a08a7..badbdafb7c0 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/AddUnits.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/AddUnits.java @@ -19,6 +19,7 @@ public class AddUnits extends Change { private final String name; private final Collection 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 diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/RemoveUnits.java b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/RemoveUnits.java index af26ca789c8..9a4d89528e5 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/RemoveUnits.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/RemoveUnits.java @@ -17,6 +17,7 @@ public class RemoveUnits extends Change { private final String name; private final Collection 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 diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/units/UnitDamageReceivedChange.java b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/units/UnitDamageReceivedChange.java index 49885c4a1fb..0ebf9376beb 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/units/UnitDamageReceivedChange.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/changefactory/units/UnitDamageReceivedChange.java @@ -20,6 +20,7 @@ public class UnitDamageReceivedChange extends Change { /** Maps unit ids to the total damage they have */ private final Map newTotalDamage; + /** Maps unit ids to the total damage they used to have */ private final Map oldTotalDamage; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/CombatUnitAbility.java b/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/CombatUnitAbility.java index 2f7b2d7e9ff..acadce0e538 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/CombatUnitAbility.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/CombatUnitAbility.java @@ -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 diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/ConvertUnitAbility.java b/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/ConvertUnitAbility.java index f84e490c1f5..0c91098ecba 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/ConvertUnitAbility.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/unit/ability/ConvertUnitAbility.java @@ -24,6 +24,7 @@ enum Team { } @Nonnull String name; + /** The unit types that have this ability */ @NonFinal Collection attachedUnitTypes; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/HtmlUtils.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/HtmlUtils.java index fa38470e370..e8a6be23996 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/HtmlUtils.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/HtmlUtils.java @@ -4,6 +4,7 @@ public class HtmlUtils { private HtmlUtils() {} + /** * @param text Text to be wrapped with html-tags * @return Wrapped text diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/ServerGame.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/ServerGame.java index 5c8cde2d5d9..6eac9391ef1 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/ServerGame.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/ServerGame.java @@ -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; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/ContentReader.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/ContentReader.java index 03b96c10046..07f8eb6970d 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/ContentReader.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/ContentReader.java @@ -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; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java index 4cbd7ed6da8..fe1fd204094 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/map/download/MapDownloadProgressListener.java @@ -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; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/WatcherThreadMessaging.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/WatcherThreadMessaging.java index 9d28d965290..ec84a660f73 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/WatcherThreadMessaging.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/WatcherThreadMessaging.java @@ -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 diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ServerConnectionProps.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ServerConnectionProps.java index 97906d1e717..1f9acb7bd0a 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ServerConnectionProps.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/mc/ServerConnectionProps.java @@ -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. */ diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/ui/LobbyWatcherKeepAliveTask.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/ui/LobbyWatcherKeepAliveTask.java index 5e8fcbcf91a..de1a699e646 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/ui/LobbyWatcherKeepAliveTask.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/startup/ui/LobbyWatcherKeepAliveTask.java @@ -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 gameIdSetter; + /** Call this to send a keep-alive request to server. */ @Nonnull private final Predicate keepAliveSender; + /** Call this to re-post the current game, obtains a new game id. */ @Nonnull private final Supplier gamePoster; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/ui/background/TaskRunner.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/ui/background/TaskRunner.java index 3ef6ccd2a60..5ee0e1bd375 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/ui/background/TaskRunner.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/ui/background/TaskRunner.java @@ -29,6 +29,7 @@ public class TaskRunner { * cancelled and this is invoked with the exception that occurred. */ @Nonnull private final Consumer exceptionHandler; + /** * Title of the wait spinner window that is displayed to user while a background action is being * executed. diff --git a/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/RemoveUnitsHistoryChange.java b/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/RemoveUnitsHistoryChange.java index 9a00beec439..a095d70a277 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/RemoveUnitsHistoryChange.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/RemoveUnitsHistoryChange.java @@ -37,8 +37,10 @@ public class RemoveUnitsHistoryChange implements HistoryChange { Map> unloadedUnits = new HashMap<>(); TransformDamagedUnitsHistoryChange transformDamagedUnitsHistoryChange; String messageTemplate; + /** Units that were killed */ Collection oldUnits = new ArrayList<>(); + /** The units that were created after a transformation */ Collection newUnits = new ArrayList<>(); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/TransformDamagedUnitsHistoryChange.java b/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/TransformDamagedUnitsHistoryChange.java index 61ef1b3b290..6162007459c 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/TransformDamagedUnitsHistoryChange.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/history/change/units/TransformDamagedUnitsHistoryChange.java @@ -34,6 +34,7 @@ public class TransformDamagedUnitsHistoryChange implements HistoryChange { CompositeChange change = new CompositeChange(); Territory location; + /** Map of old unit -> new unit */ Map transformingUnits = new HashMap<>(); diff --git a/game-app/game-core/src/main/java/games/strategy/net/nio/Decoder.java b/game-app/game-core/src/main/java/games/strategy/net/nio/Decoder.java index 6166d97cf8a..9859cd75c85 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/nio/Decoder.java +++ b/game-app/game-core/src/main/java/games/strategy/net/nio/Decoder.java @@ -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. diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractRulesAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractRulesAttachment.java index d1773033598..3ffb02dadf6 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractRulesAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractRulesAttachment.java @@ -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 turns = null; + // for on/off conditions protected boolean switched = true; // allows custom GameProperties diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractUserActionAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractUserActionAttachment.java index 206917c5f02..99ec917a949 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractUserActionAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/AbstractUserActionAttachment.java @@ -27,6 +27,7 @@ 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. * @@ -34,6 +35,7 @@ public abstract class AbstractUserActionAttachment extends AbstractConditionsAtt * 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 costResources = null; // how many times can you perform this action each round? diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java index c77674e9210..cf71be397d7 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java @@ -233,11 +233,13 @@ public class UnitAttachment extends DefaultAttachment { private int whenCapturedSustainsDamage = 0; private @Nullable List canBeCapturedOnEnteringBy = null; private @Nullable List 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>> 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 receivesAbilityWhenWith = null; diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/Die.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/Die.java index 4d21f496936..62d05217c5f 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/Die.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/Die.java @@ -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; diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AbstractBattle.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AbstractBattle.java index 7608023adbb..73a988562f8 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AbstractBattle.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AbstractBattle.java @@ -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. diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/image/UnitImageFactory.java b/game-app/game-core/src/main/java/games/strategy/triplea/image/UnitImageFactory.java index 10cb7930108..ef606427d4b 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/image/UnitImageFactory.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/image/UnitImageFactory.java @@ -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. diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/settings/lobby/LobbySelectionViewData.java b/game-app/game-core/src/main/java/games/strategy/triplea/settings/lobby/LobbySelectionViewData.java index 9eae45da80a..48500fad366 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/settings/lobby/LobbySelectionViewData.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/settings/lobby/LobbySelectionViewData.java @@ -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; diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/menubar/debug/AiPlayerDebugOption.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/menubar/debug/AiPlayerDebugOption.java index 32a0253e4c3..de5cd36b775 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/menubar/debug/AiPlayerDebugOption.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/menubar/debug/AiPlayerDebugOption.java @@ -25,18 +25,21 @@ public enum OptionType { /** The menu title */ @Nonnull String title; + /** * The type of option * *

Not used if subOptions is non-empty */ @Builder.Default OptionType optionType = OptionType.NORMAL; + /** * Used to group the related ON_OFF_EXCLUSIVE options * *

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 subOptions = List.of(); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/panels/map/MapRouteDrawer.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/panels/map/MapRouteDrawer.java index e692f61551d..68f3d29454d 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/panels/map/MapRouteDrawer.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/panels/map/MapRouteDrawer.java @@ -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 diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitSeparator.java b/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitSeparator.java index c3186ff213f..08ec45696f8 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitSeparator.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitSeparator.java @@ -30,14 +30,19 @@ public static class SeparatorCategories { * amount) */ @Builder.Default @Nullable final Map> 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; } diff --git a/game-app/game-core/src/main/java/games/strategy/ui/ImageScrollerLargeView.java b/game-app/game-core/src/main/java/games/strategy/ui/ImageScrollerLargeView.java index 9c2b7e252d8..dbefce66da0 100644 --- a/game-app/game-core/src/main/java/games/strategy/ui/ImageScrollerLargeView.java +++ b/game-app/game-core/src/main/java/games/strategy/ui/ImageScrollerLargeView.java @@ -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 diff --git a/game-app/game-core/src/main/java/org/triplea/util/Version.java b/game-app/game-core/src/main/java/org/triplea/util/Version.java index dcd372569d7..0029288ad90 100644 --- a/game-app/game-core/src/main/java/org/triplea/util/Version.java +++ b/game-app/game-core/src/main/java/org/triplea/util/Version.java @@ -22,8 +22,10 @@ public final class Version implements Serializable, Comparable { /** Indicates engine incompatible releases. */ private int major; + /** Indicates engine compatible releases. */ private int minor; + /** * Point (build number), unused, kept for serialization compatibility. * diff --git a/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedPlayerTypes.java b/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedPlayerTypes.java index 1a85e11860c..b4b2073c187 100644 --- a/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedPlayerTypes.java +++ b/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedPlayerTypes.java @@ -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) { diff --git a/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/login/LoginResult.java b/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/login/LoginResult.java index bda173dc38a..af8649d3c27 100644 --- a/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/login/LoginResult.java +++ b/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/login/LoginResult.java @@ -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. diff --git a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/ActionPanel.java b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/ActionPanel.java index 985aca26330..e4b2fa5eff2 100644 --- a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/ActionPanel.java +++ b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/ActionPanel.java @@ -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)); diff --git a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/panel/move/MovePanel.java b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/panel/move/MovePanel.java index 6b51fbbce12..c4ef0b23295 100644 --- a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/panel/move/MovePanel.java +++ b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/panel/move/MovePanel.java @@ -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; diff --git a/game-app/map-data/src/main/java/org/triplea/map/description/file/MapDescriptionYaml.java b/game-app/map-data/src/main/java/org/triplea/map/description/file/MapDescriptionYaml.java index 2858ab14930..42f2191b2e3 100644 --- a/game-app/map-data/src/main/java/org/triplea/map/description/file/MapDescriptionYaml.java +++ b/game-app/map-data/src/main/java/org/triplea/map/description/file/MapDescriptionYaml.java @@ -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; } diff --git a/http-clients/error-reporting-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java b/http-clients/error-reporting-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java index b88fc7e40e1..9eff38955d4 100644 --- a/http-clients/error-reporting-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java +++ b/http-clients/error-reporting-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java @@ -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; } diff --git a/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClient.java b/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClient.java index 9bdba43f797..7039a07fa44 100644 --- a/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClient.java +++ b/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClient.java @@ -30,11 +30,13 @@ public class HttpClient implements Supplier { 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. diff --git a/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClientConstants.java b/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClientConstants.java index 68a32a56a33..018c419cbbb 100644 --- a/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClientConstants.java +++ b/http-clients/feign-common/src/main/java/org/triplea/http/client/HttpClientConstants.java @@ -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; } diff --git a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java b/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java index a612f3fb34a..4d61fc428a7 100644 --- a/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java +++ b/http-clients/github-client/src/main/java/org/triplea/http/client/github/GithubApiClient.java @@ -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. diff --git a/http-clients/lobby-client/src/main/java/org/triplea/http/client/LobbyHttpClientConfig.java b/http-clients/lobby-client/src/main/java/org/triplea/http/client/LobbyHttpClientConfig.java index 249c23dbfb0..052f3e53f5e 100644 --- a/http-clients/lobby-client/src/main/java/org/triplea/http/client/LobbyHttpClientConfig.java +++ b/http-clients/lobby-client/src/main/java/org/triplea/http/client/LobbyHttpClientConfig.java @@ -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; diff --git a/http-clients/lobby-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java b/http-clients/lobby-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java index b88fc7e40e1..9eff38955d4 100644 --- a/http-clients/lobby-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java +++ b/http-clients/lobby-client/src/main/java/org/triplea/http/client/error/report/CanUploadErrorReportResponse.java @@ -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; } diff --git a/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/login/LobbyLoginResponse.java b/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/login/LobbyLoginResponse.java index 4828b9134d9..d73ddb018a4 100644 --- a/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/login/LobbyLoginResponse.java +++ b/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/login/LobbyLoginResponse.java @@ -16,15 +16,19 @@ public class LobbyLoginResponse { /** On successful login, a non-null API key token is passed back from the server. */ @Nullable private final String apiKey; + /** When non-null, indicates login did not occur, reason for failed login will be present. */ @Nullable private final String failReason; + /** True if the authenticated user is a moderator. */ private final boolean moderator; + /** * True indicates user has used a temporary password that is now expired and should change their * password. */ private final boolean passwordChangeRequired; + /** * When users log in to lobby successfully, we optionally can optionally send them a banner * message that is printed on the lobby screen. diff --git a/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/moderator/toolbox/PagingParams.java b/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/moderator/toolbox/PagingParams.java index b23a1559610..e0aede14af2 100644 --- a/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/moderator/toolbox/PagingParams.java +++ b/http-clients/lobby-client/src/main/java/org/triplea/http/client/lobby/moderator/toolbox/PagingParams.java @@ -16,6 +16,7 @@ public class PagingParams { /** The next row to fetch, zero-based. */ private int rowNumber; + /** How many rows to fetch, should be greater than zero. */ private Integer pageSize; } diff --git a/http-clients/lobby-client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java b/http-clients/lobby-client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java index bffd5bca644..29a8012b0cb 100644 --- a/http-clients/lobby-client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java +++ b/http-clients/lobby-client/src/main/java/org/triplea/http/client/maps/listing/MapDownloadItem.java @@ -20,11 +20,13 @@ public class MapDownloadItem { /** URL where the map can be downloaded. */ @Nonnull private final String downloadUrl; + /** URL of the preview image of the map. */ @Nonnull private final String previewImageUrl; @Nonnull private final String mapName; @Nonnull private final Long lastCommitDateEpochMilli; + /** HTML description of the map. */ @Nonnull private final String description; diff --git a/lib/swing-lib-test-support/src/main/java/org/triplea/ui/events/queue/test/support/EventQueueTestSupport.java b/lib/swing-lib-test-support/src/main/java/org/triplea/ui/events/queue/test/support/EventQueueTestSupport.java index 957db4dea69..2f5bda0a9a0 100644 --- a/lib/swing-lib-test-support/src/main/java/org/triplea/ui/events/queue/test/support/EventQueueTestSupport.java +++ b/lib/swing-lib-test-support/src/main/java/org/triplea/ui/events/queue/test/support/EventQueueTestSupport.java @@ -47,6 +47,7 @@ public class EventQueueTestSupport< ViewDataT extends ViewData> { @Getter private final EventQueueTypeT eventQueue; + /** List of all controller events received. */ @Getter private final Deque> controllerEvents = diff --git a/lib/websocket-client/src/main/java/org/triplea/http/client/web/socket/MessageEnvelope.java b/lib/websocket-client/src/main/java/org/triplea/http/client/web/socket/MessageEnvelope.java index bc441404d1f..b3ab4163268 100644 --- a/lib/websocket-client/src/main/java/org/triplea/http/client/web/socket/MessageEnvelope.java +++ b/lib/websocket-client/src/main/java/org/triplea/http/client/web/socket/MessageEnvelope.java @@ -18,6 +18,7 @@ public class MessageEnvelope { private static final Gson gson = new Gson(); @Getter @Nonnull private final String messageTypeId; + /** * Payload itself is a JSON string. This is so we can preserve any underlying data objects. If we * try to store this as a generic object, then we'd have to know the generic type when diff --git a/lib/websocket-server/src/main/java/org/triplea/web/socket/WebSocketMessagingBus.java b/lib/websocket-server/src/main/java/org/triplea/web/socket/WebSocketMessagingBus.java index 0a9db4a6279..82252db290b 100644 --- a/lib/websocket-server/src/main/java/org/triplea/web/socket/WebSocketMessagingBus.java +++ b/lib/websocket-server/src/main/java/org/triplea/web/socket/WebSocketMessagingBus.java @@ -39,6 +39,7 @@ private static class MessageListener { /** These listeners are for specific message types. */ private final List> messageListeners = new ArrayList<>(); + /** These listeners are invoked when we receive any type of message. */ private final List> anyMessageListeners = new ArrayList<>(); diff --git a/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/GameHostingApiKeyDaoWrapper.java b/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/GameHostingApiKeyDaoWrapper.java index a9bd2020e26..26cb3095f1a 100644 --- a/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/GameHostingApiKeyDaoWrapper.java +++ b/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/GameHostingApiKeyDaoWrapper.java @@ -16,6 +16,7 @@ public class GameHostingApiKeyDaoWrapper { @Nonnull private final GameHostingApiKeyDao gameHostApiKeyDao; @Nonnull private final Supplier keyMaker; + /** Hashing function so that we do not store plain-text API key values in database. */ @Nonnull private final Function keyHashingFunction; diff --git a/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/PlayerApiKeyDaoWrapper.java b/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/PlayerApiKeyDaoWrapper.java index 640de07a77e..5d9a1c8cdd6 100644 --- a/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/PlayerApiKeyDaoWrapper.java +++ b/spitfire-server/lobby-module/src/main/java/org/triplea/db/dao/api/key/PlayerApiKeyDaoWrapper.java @@ -26,6 +26,7 @@ public class PlayerApiKeyDaoWrapper { @Nonnull private final UserJdbiDao userJdbiDao; @Nonnull private final UserRoleDao userRoleDao; @Nonnull private final Supplier keyMaker; + /** Hashing function so that we do not store plain-text API key values in database. */ @Nonnull private final Function keyHashingFunction;