From 9a1f926a52340a928a98734658bcb58dfe3aabbe Mon Sep 17 00:00:00 2001 From: frigoref Date: Wed, 6 Nov 2024 20:47:47 +0100 Subject: [PATCH] Ensure spaces after double points in messages (#12986) Regex: - (throw.*):" \+ - (return.*):" \+ - ([a-z]+):" \+ - ([a-z1-9]+[a-z1-9]+):" \+ + $1: " + --- .../strategy/engine/chat/ChatController.java | 4 +- .../engine/data/BombingUnitDamageChange.java | 2 +- .../games/strategy/engine/data/GameData.java | 2 +- .../engine/data/GameObjectStreamData.java | 2 +- .../strategy/engine/data/GamePlayer.java | 4 +- .../strategy/engine/data/MoveDescription.java | 2 +- .../engine/data/ProductionFrontier.java | 4 +- .../engine/data/RelationshipTracker.java | 2 +- .../strategy/engine/data/RepairFrontier.java | 2 +- .../engine/data/ResourceCollection.java | 2 +- .../games/strategy/engine/data/Route.java | 4 +- .../java/games/strategy/engine/data/Rule.java | 2 +- .../engine/data/TechnologyFrontier.java | 2 +- .../strategy/engine/data/UnitCollection.java | 2 +- .../engine/data/changefactory/AddUnits.java | 2 +- .../data/changefactory/RemoveUnits.java | 2 +- .../strategy/engine/framework/ClientGame.java | 2 +- .../framework/VerifiedRandomNumbers.java | 2 +- .../framework/message/PlayerListing.java | 2 +- .../engine/message/RemoteMethodCall.java | 2 +- .../strategy/engine/message/RemoteName.java | 2 +- .../engine/message/UnifiedMessengerHub.java | 2 +- .../message/unifiedmessenger/EndPoint.java | 12 +++-- .../HasEndPointImplementor.java | 2 +- .../unifiedmessenger/InvocationResults.java | 2 +- .../unifiedmessenger/UnifiedMessenger.java | 8 ++-- .../engine/random/CryptoRandomSource.java | 2 +- .../engine/random/PbemDiceRoller.java | 4 +- .../games/strategy/engine/vault/Vault.java | 10 ++-- .../games/strategy/engine/vault/VaultId.java | 2 +- .../games/strategy/net/ClientMessenger.java | 4 +- .../games/strategy/net/ServerMessenger.java | 2 +- .../java/games/strategy/net/nio/Decoder.java | 2 +- .../java/games/strategy/net/nio/Encoder.java | 2 +- .../games/strategy/net/nio/NioWriter.java | 2 +- .../strategy/net/nio/SocketReadData.java | 2 +- .../strategy/net/nio/SocketWriteData.java | 2 +- .../triplea/ai/pro/util/ProPurchaseUtils.java | 2 +- .../attachments/AbstractRulesAttachment.java | 4 +- .../triplea/attachments/PlayerAttachment.java | 2 +- .../triplea/attachments/RulesAttachment.java | 2 +- .../triplea/attachments/TechAttachment.java | 3 +- .../attachments/TerritoryAttachment.java | 6 +-- .../attachments/TriggerAttachment.java | 47 ++++++++++--------- .../triplea/attachments/UnitAttachment.java | 2 +- .../delegate/AbstractEndTurnDelegate.java | 2 +- .../delegate/AbstractPlaceDelegate.java | 2 +- .../strategy/triplea/delegate/DiceRoll.java | 2 +- .../games/strategy/triplea/delegate/Die.java | 4 +- .../triplea/delegate/EndTurnDelegate.java | 2 +- .../delegate/ImprovedShipyardsAdvance.java | 2 +- .../delegate/IndustrialTechnologyAdvance.java | 2 +- .../delegate/InitializationDelegate.java | 2 +- .../triplea/delegate/RocketsFireHelper.java | 4 +- .../triplea/delegate/TechnologyDelegate.java | 2 +- .../triplea/delegate/TransportTracker.java | 7 +-- .../triplea/delegate/UndoableMove.java | 2 +- .../triplea/delegate/battle/AirBattle.java | 2 +- .../delegate/battle/MustFightBattle.java | 2 +- .../delegate/data/MoveValidationResult.java | 2 +- .../triplea/delegate/data/PlaceableUnits.java | 2 +- .../delegate/data/PlacementDescription.java | 2 +- .../move/validation/MoveValidator.java | 4 +- .../strategy/triplea/image/ImageFactory.java | 2 +- .../calculator/BattleCalculatorPanel.java | 2 +- .../strategy/triplea/ui/BattleStepsPanel.java | 4 +- .../games/strategy/triplea/ui/BottomBar.java | 2 +- .../ui/ObjectiveDummyDelegateBridge.java | 2 +- .../strategy/triplea/ui/mapdata/MapData.java | 2 +- .../triplea/ui/screen/TileManager.java | 2 +- .../triplea/ui/screen/UnitsDrawer.java | 2 +- .../strategy/triplea/util/UnitOwner.java | 2 +- .../triplea/util/PointFileReaderWriter.java | 4 +- .../java/tools/image/AutoPlacementFinder.java | 4 +- .../main/java/tools/image/CenterPicker.java | 4 +- .../java/tools/image/DecorationPlacer.java | 2 +- .../main/java/tools/image/PolygonGrabber.java | 8 ++-- .../tools/map/making/ConnectionFinder.java | 2 +- .../tools/map/making/MapPropertiesMaker.java | 2 +- .../tools/map/making/PlacementPicker.java | 6 +-- .../ObjectPropertyChangeMatcher.java | 6 +-- .../triplea/delegate/GameDataTestUtil.java | 10 ++-- .../startup/mc/HeadedLaunchAction.java | 2 +- .../lobby/client/ui/LobbyGameTableModel.java | 2 +- .../games/strategy/triplea/TripleAPlayer.java | 2 +- .../strategy/triplea/ui/BattlePanel.java | 5 +- .../games/strategy/triplea/ui/TechPanel.java | 8 ++-- .../triplea/ui/panel/move/MovePanel.java | 2 +- .../triplea/game/server/GameRelayServer.java | 2 +- 89 files changed, 164 insertions(+), 152 deletions(-) diff --git a/game-app/game-core/src/main/java/games/strategy/engine/chat/ChatController.java b/game-app/game-core/src/main/java/games/strategy/engine/chat/ChatController.java index f5dfcfedb05..4c424fb793b 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/chat/ChatController.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/chat/ChatController.java @@ -107,7 +107,7 @@ private IChatChannel getChatBroadcaster() { @Override public Collection joinChat() { final INode node = MessageContext.getSender(); - log.info("Chatter:" + node + " is joining chat:" + chatName); + log.info("Chatter: " + node + " is joining chat: " + chatName); final Tag tag = Tag.NONE; synchronized (mutex) { final PlayerChatId id = PlayerChatId.newId(); @@ -156,6 +156,6 @@ private void leaveChatInternal(final INode node) { chatters.remove(node); } getChatBroadcaster().speakerRemoved(node.getPlayerName()); - log.info("Chatter:" + node + " has left chat:" + chatName); + log.info("Chatter: " + node + " has left chat: " + chatName); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/BombingUnitDamageChange.java b/game-app/game-core/src/main/java/games/strategy/engine/data/BombingUnitDamageChange.java index 7b72c66fe67..2034543944d 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/BombingUnitDamageChange.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/BombingUnitDamageChange.java @@ -48,6 +48,6 @@ public Change invert() { @Override public String toString() { - return "Bombing unit damage change. Hits:" + hits + " undoHits:" + undoHits; + return "Bombing unit damage change. Hits: " + hits + " undoHits: " + undoHits; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/GameData.java b/game-app/game-core/src/main/java/games/strategy/engine/data/GameData.java index 1e4e92ab4cc..df3b6ac4097 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/GameData.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/GameData.java @@ -255,7 +255,7 @@ public UnitHolder getUnitHolder(final String name, final String type) { case UnitHolder.TERRITORY: return map.getTerritory(name); default: - throw new IllegalStateException("Invalid type:" + type); + throw new IllegalStateException("Invalid type: " + type); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/GameObjectStreamData.java b/game-app/game-core/src/main/java/games/strategy/engine/data/GameObjectStreamData.java index ae0eee95f4c..ace67fe7c49 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/GameObjectStreamData.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/GameObjectStreamData.java @@ -35,7 +35,7 @@ public GameObjectStreamData(final Named named) { } else if (named instanceof ProductionFrontier) { type = GameType.PRODUCTIONFRONTIER; } else { - throw new IllegalArgumentException("Wrong type:" + named); + throw new IllegalArgumentException("Wrong type: " + named); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/GamePlayer.java b/game-app/game-core/src/main/java/games/strategy/engine/data/GamePlayer.java index 10dad535b35..3fe62845c1b 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/GamePlayer.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/GamePlayer.java @@ -54,7 +54,7 @@ public boolean isNull() { @Getter private String whoAmI = // @TODO why : separation, no_one also used in ServerSetupPanel; create constant - "null:" + "no_one"; + "null: " + "no_one"; private TechAttachment techAttachment; @@ -124,7 +124,7 @@ public boolean isNull() { @Override public String toString() { - return "PlayerId named:" + getName(); + return "PlayerId named: " + getName(); } @Override diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/MoveDescription.java b/game-app/game-core/src/main/java/games/strategy/engine/data/MoveDescription.java index 2033e8c30d5..ef60e2d7f87 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/MoveDescription.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/MoveDescription.java @@ -78,6 +78,6 @@ private static boolean collectionsAreEqual(final Collection a, final Colle @Override public String toString() { - return "Move message route:" + route + " units:" + getUnits(); + return "Move message route: " + route + " units: " + getUnits(); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/ProductionFrontier.java b/game-app/game-core/src/main/java/games/strategy/engine/data/ProductionFrontier.java index d0243aa203f..76eb5420843 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/ProductionFrontier.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/ProductionFrontier.java @@ -30,7 +30,7 @@ public ProductionFrontier( public void addRule(final ProductionRule rule) { if (rules.contains(rule)) { - throw new IllegalStateException("Rule already added:" + rule); + throw new IllegalStateException("Rule already added: " + rule); } rules.add(rule); cachedRules = null; @@ -38,7 +38,7 @@ public void addRule(final ProductionRule rule) { public void removeRule(final ProductionRule rule) { if (!rules.contains(rule)) { - throw new IllegalStateException("Rule not present:" + rule); + throw new IllegalStateException("Rule not present: " + rule); } rules.remove(rule); cachedRules = null; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/RelationshipTracker.java b/game-app/game-core/src/main/java/games/strategy/engine/data/RelationshipTracker.java index 207b2a24055..a2bf31cb2aa 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/RelationshipTracker.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/RelationshipTracker.java @@ -265,7 +265,7 @@ public Relationship(final RelationshipType relationshipType, final int roundValu @Override public String toString() { - return roundCreated + ":" + relationshipType; + return roundCreated + ": " + relationshipType; } } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/RepairFrontier.java b/game-app/game-core/src/main/java/games/strategy/engine/data/RepairFrontier.java index 8702f1146c3..bd942ffde2f 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/RepairFrontier.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/RepairFrontier.java @@ -28,7 +28,7 @@ public RepairFrontier(final String name, final GameData data, final List c1 = new ArrayList<>(r1.steps); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/Rule.java b/game-app/game-core/src/main/java/games/strategy/engine/data/Rule.java index 51879f7ea2d..e54b344b9b0 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/Rule.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/Rule.java @@ -29,7 +29,7 @@ public interface Rule { default void addResult(final NamedAttachable obj, final int quantity) { if (!(obj instanceof UnitType) && !(obj instanceof Resource)) { throw new IllegalArgumentException( - "results must be units or resources, not:" + obj.getClass().getName()); + "results must be units or resources, not: " + obj.getClass().getName()); } getResults().put(obj, quantity); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/TechnologyFrontier.java b/game-app/game-core/src/main/java/games/strategy/engine/data/TechnologyFrontier.java index ec8e147d250..858af956dc7 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/TechnologyFrontier.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/TechnologyFrontier.java @@ -50,7 +50,7 @@ public void addAdvance(final List list) { public void removeAdvance(final TechAdvance t) { if (!techs.contains(t)) { - throw new IllegalStateException("Advance not present:" + t); + throw new IllegalStateException("Advance not present: " + t); } techs.remove(t); getData().getTechTracker().clearCache(); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/data/UnitCollection.java b/game-app/game-core/src/main/java/games/strategy/engine/data/UnitCollection.java index a4b7af12d8c..d6d9e0d2dd9 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/data/UnitCollection.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/data/UnitCollection.java @@ -84,7 +84,7 @@ public Collection getUnits(final UnitType type, final int maxUnits) { return new ArrayList<>(); } if (maxUnits < 0) { - throw new IllegalArgumentException("value must be positive. Instead its:" + maxUnits); + throw new IllegalArgumentException("value must be positive. Instead its: " + maxUnits); } final Collection units = new ArrayList<>(); for (final Unit current : this.units) { 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 23face3174f..be41a629aae 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 @@ -83,6 +83,6 @@ private Collection buildUnitsWithOwner(final GameState data) { @Override public String toString() { - return "Add unit change. Add to:" + name + " units:" + units; + return "Add unit change. Add to: " + name + " units: " + units; } } 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 9a4d89528e5..73ab74e1692 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 @@ -63,6 +63,6 @@ protected void perform(final GameState data) { @Override public String toString() { - return "Remove unit change. Remove from:" + name + " units:" + units; + return "Remove unit change. Remove from: " + name + " units: " + units; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/ClientGame.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/ClientGame.java index dd22569eec1..a04bbfeba6e 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/ClientGame.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/ClientGame.java @@ -166,7 +166,7 @@ public void shutDown() { final Player gp = this.gamePlayers.get(player); if (gp == null) { throw new IllegalStateException( - "Game player not found. Player:" + player + " on:" + messengers.getLocalNode()); + "Game player not found. Player: " + player + " on: " + messengers.getLocalNode()); } gp.start(stepName); }; diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/VerifiedRandomNumbers.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/VerifiedRandomNumbers.java index 16ad4dd4243..2df6e085f2f 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/VerifiedRandomNumbers.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/VerifiedRandomNumbers.java @@ -19,6 +19,6 @@ public VerifiedRandomNumbers(final String annotation, final int[] values) { @Override public String toString() { - return "Rolled :" + MyFormatter.asDice(values) + " for " + annotation; + return "Rolled : " + MyFormatter.asDice(values) + " for " + annotation; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/framework/message/PlayerListing.java b/game-app/game-core/src/main/java/games/strategy/engine/framework/message/PlayerListing.java index f8f9f3552dd..d784c67dea3 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/framework/message/PlayerListing.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/framework/message/PlayerListing.java @@ -105,7 +105,7 @@ public PlayerListing( @Override public String toString() { - return "PlayerListingMessage:" + playerToNodeListing; + return "PlayerListingMessage: " + playerToNodeListing; } public Map getLocalPlayerTypeMap(final PlayerTypes playerTypes) { diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteMethodCall.java b/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteMethodCall.java index cdd6f04e7c7..f4f186f20d1 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteMethodCall.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteMethodCall.java @@ -106,7 +106,7 @@ private static String[] classesToString(final Class[] classes, final Object[] @Override public String toString() { - return "Remote method call, method name:" + methodName + " remote name:" + remoteName; + return "Remote method call, method name: " + methodName + " remote name: " + remoteName; } @Override diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteName.java b/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteName.java index d766a4ef3c1..f84002a0918 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteName.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/RemoteName.java @@ -23,6 +23,6 @@ public RemoteName(final String name, final Class clazz) { @Override public String toString() { - return name + ":" + clazz.getSimpleName(); + return name + ": " + clazz.getSimpleName(); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/UnifiedMessengerHub.java b/game-app/game-core/src/main/java/games/strategy/engine/message/UnifiedMessengerHub.java index 886a7c9d734..dbd32061894 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/UnifiedMessengerHub.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/UnifiedMessengerHub.java @@ -127,7 +127,7 @@ private void invoke(final HubInvoke hubInvoke, final Collection remote, f if (hubInvoke.needReturnValues) { if (remote.size() != 1) { throw new IllegalStateException( - "Too many nodes:" + remote + " for remote name " + hubInvoke.call); + "Too many nodes: " + remote + " for remote name " + hubInvoke.call); } final InvocationInProgress invocationInProgress = new InvocationInProgress(CollectionUtils.getAny(remote), hubInvoke, from); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/EndPoint.java b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/EndPoint.java index 8f26106663c..1e33e04559f 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/EndPoint.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/EndPoint.java @@ -92,7 +92,8 @@ public boolean hasSingleImplementor() { */ boolean removeImplementor(final Object implementor) { if (!implementors.remove(implementor)) { - throw new IllegalStateException("Not removed, impl:" + implementor + " have " + implementors); + throw new IllegalStateException( + "Not removed, impl: " + implementor + " have " + implementors); } return implementors.isEmpty(); } @@ -138,7 +139,7 @@ private RemoteMethodCallResults invokeSingle( } catch (final InvocationTargetException e) { return new RemoteMethodCallResults(e.getTargetException()); } catch (final IllegalAccessException | IllegalArgumentException e) { - log.error("error in call:" + call, e); + log.error("error in call: " + call, e); return new RemoteMethodCallResults(e); } finally { MessageContext.setSenderNodeForThread(null); @@ -147,6 +148,11 @@ private RemoteMethodCallResults invokeSingle( @Override public String toString() { - return "Name:" + name + " singleThreaded:" + singleThreaded + " implementors:" + implementors; + return "Name: " + + name + + " singleThreaded: " + + singleThreaded + + " implementors: " + + implementors; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/HasEndPointImplementor.java b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/HasEndPointImplementor.java index 9b52dd157b0..d404868e2de 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/HasEndPointImplementor.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/HasEndPointImplementor.java @@ -13,6 +13,6 @@ public HasEndPointImplementor(final String endPointName) { @Override public String toString() { - return this.getClass().getName() + ":" + endPointName; + return this.getClass().getName() + ": " + endPointName; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/InvocationResults.java b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/InvocationResults.java index a5fe047e879..67e8da70260 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/InvocationResults.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/InvocationResults.java @@ -27,7 +27,7 @@ public InvocationResults(final RemoteMethodCallResults results, final UUID metho @Override public String toString() { - return "Invocation results for method id:" + methodCallId + " results:" + results; + return "Invocation results for method id: " + methodCallId + " results: " + results; } @Override diff --git a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/UnifiedMessenger.java b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/UnifiedMessenger.java index 3a6f4aadeae..52c15b68471 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/UnifiedMessenger.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/message/unifiedmessenger/UnifiedMessenger.java @@ -105,7 +105,7 @@ public RemoteMethodCallResults invokeAndWait( + remoteCall.getRemoteName()); } if (results.size() > 1) { - throw new IllegalStateException("Too many implementors, got back:" + results); + throw new IllegalStateException("Too many implementors, got back: " + results); } return results.get(0); } @@ -208,7 +208,7 @@ public void removeImplementor(final String name, final Object implementor) { synchronized (endPointMutex) { final EndPoint endPoint = localEndPoints.get(name); if (endPoint == null) { - throw new IllegalStateException("No end point for:" + name); + throw new IllegalStateException("No end point for: " + name); } final boolean noneLeft = endPoint.removeImplementor(implementor); if (noneLeft) { @@ -350,11 +350,11 @@ private void processMessage(final EndPoint local, final SpokeInvoke invoke, fina private void assertIsServer(final INode from) { Preconditions.checkState( - from.equals(messenger.getServerNode()), "Not from server! Instead from:" + from); + from.equals(messenger.getServerNode()), "Not from server! Instead from: " + from); } @Override public String toString() { - return "Server:" + messenger.isServer() + " EndPoints:" + localEndPoints; + return "Server: " + messenger.isServer() + " EndPoints: " + localEndPoints; } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/random/CryptoRandomSource.java b/game-app/game-core/src/main/java/games/strategy/engine/random/CryptoRandomSource.java index d5a149e1d36..9334c068936 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/random/CryptoRandomSource.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/random/CryptoRandomSource.java @@ -89,7 +89,7 @@ public int getRandom(final int max, final String annotation) { @Override public int[] getRandom(final int max, final int count, final String annotation) { if (count <= 0) { - throw new IllegalArgumentException("Invalid count:" + count); + throw new IllegalArgumentException("Invalid count: " + count); } final Vault vault = game.getVault(); // generate numbers locally, and put them in the vault diff --git a/game-app/game-core/src/main/java/games/strategy/engine/random/PbemDiceRoller.java b/game-app/game-core/src/main/java/games/strategy/engine/random/PbemDiceRoller.java index 45a4b830bb8..975537a6599 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/random/PbemDiceRoller.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/random/PbemDiceRoller.java @@ -217,7 +217,7 @@ private void rollInSeparateThread() { waitForWindowToBecomeVisible(); appendText(subjectMessage + "\n"); - appendText("Contacting " + diceServer.getDisplayName() + "\n"); + appendText("Contacting " + diceServer.getDisplayName() + "\n"); try { final String text = diceServer.postRequest(sides, count, subjectMessage, gameId); if (text.isEmpty()) { @@ -226,7 +226,7 @@ private void rollInSeparateThread() { notifyError(); } if (!test) { - appendText("Contacted :" + text + "\n"); + appendText("Contacted: " + text + "\n"); } diceRoll = diceServer.getDice(text, count); appendText("Success!"); diff --git a/game-app/game-core/src/main/java/games/strategy/engine/vault/Vault.java b/game-app/game-core/src/main/java/games/strategy/engine/vault/Vault.java index b25ef902074..62154a2d9b7 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/vault/Vault.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/vault/Vault.java @@ -60,7 +60,7 @@ public void addLockedValue(final VaultId id, final byte[] data) { return; } if (unverifiedValues.putIfAbsent(id, data) != null) { - throw new IllegalStateException("duplicate values for id:" + id); + throw new IllegalStateException("duplicate values for id: " + id); } synchronized (waitForLock) { waitForLock.notifyAll(); @@ -105,7 +105,7 @@ public void unlock(final VaultId id, final byte[] secretKeyBytes) { final byte[] data = new byte[decrypted.length - KNOWN_VAL.length]; System.arraycopy(decrypted, KNOWN_VAL.length, data, 0, data.length); if (verifiedValues.putIfAbsent(id, data) != null) { - throw new IllegalStateException("duplicate values for id:" + id); + throw new IllegalStateException("duplicate values for id: " + id); } synchronized (waitForLock) { waitForLock.notifyAll(); @@ -126,7 +126,7 @@ public Vault(final IChannelMessenger channelMessenger) { secretKeyFactory = SecretKeyFactory.getInstance(ALGORITHM); keyGen = KeyGenerator.getInstance(ALGORITHM); } catch (final NoSuchAlgorithmException e) { - throw new IllegalStateException("Nothing known about algorithm:" + ALGORITHM, e); + throw new IllegalStateException("Nothing known about algorithm: " + ALGORITHM, e); } } @@ -169,7 +169,7 @@ public VaultId lock(final byte[] data) { final VaultId id = new VaultId(channelMessenger.getLocalNode()); final SecretKey key = keyGen.generateKey(); if (secretKeys.putIfAbsent(id, key) != null) { - throw new IllegalStateException("duplicate id:" + id); + throw new IllegalStateException("duplicate id: " + id); } // we already know it, so might as well keep it verifiedValues.put(id, data); @@ -238,7 +238,7 @@ public byte[] get(final VaultId id) throws NotUnlockedException { } else if (unverifiedValues.containsKey(id)) { throw new NotUnlockedException(); } else { - throw new IllegalStateException("Nothing known about id:" + id); + throw new IllegalStateException("Nothing known about id: " + id); } } diff --git a/game-app/game-core/src/main/java/games/strategy/engine/vault/VaultId.java b/game-app/game-core/src/main/java/games/strategy/engine/vault/VaultId.java index 8ea763d48e9..196db772448 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/vault/VaultId.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/vault/VaultId.java @@ -29,6 +29,6 @@ INode getGeneratedOn() { @Override public String toString() { - return "VaultId generated on:" + generatedOn + " id:" + uniqueId; + return "VaultId generated on: " + generatedOn + " id: " + uniqueId; } } diff --git a/game-app/game-core/src/main/java/games/strategy/net/ClientMessenger.java b/game-app/game-core/src/main/java/games/strategy/net/ClientMessenger.java index 06f5d3e6300..828d86ff0a2 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/ClientMessenger.java +++ b/game-app/game-core/src/main/java/games/strategy/net/ClientMessenger.java @@ -166,7 +166,7 @@ public void shutDown() { @Override public void messageReceived(final MessageHeader msg, final SocketChannel channel) { if (msg.getTo() != null && !msg.getTo().equals(node)) { - throw new IllegalStateException("msg not for me:" + msg); + throw new IllegalStateException("msg not for me: " + msg); } for (final IMessageListener listener : listeners) { listener.messageReceived(msg.getMessage(), msg.getFrom()); @@ -227,6 +227,6 @@ public void removeConnectionChangeListener(final IConnectionChangeListener liste @Override public String toString() { - return "ClientMessenger LocalNode:" + node + " ServerNodes:" + serverNode; + return "ClientMessenger LocalNode: " + node + " ServerNodes: " + serverNode; } } diff --git a/game-app/game-core/src/main/java/games/strategy/net/ServerMessenger.java b/game-app/game-core/src/main/java/games/strategy/net/ServerMessenger.java index 368b1186c78..51d6a8f1861 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/ServerMessenger.java +++ b/game-app/game-core/src/main/java/games/strategy/net/ServerMessenger.java @@ -195,7 +195,7 @@ private void forward(final MessageHeader msg) { } final SocketChannel socketChannel = nodeToChannel.get(msg.getTo()); if (socketChannel == null) { - throw new IllegalStateException("No channel for:" + msg.getTo()); + throw new IllegalStateException("No channel for: " + msg.getTo()); } nioSocket.send(socketChannel, msg); } 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 9859cd75c85..923a6ba12f2 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 @@ -79,7 +79,7 @@ private void loop() { throw new IllegalStateException("we are writing messages, but no local node"); } if (header.getFrom() == null) { - throw new IllegalArgumentException("Null from:" + header); + throw new IllegalArgumentException("Null from: " + header); } nioSocket.messageReceived(header, data.getChannel()); } diff --git a/game-app/game-core/src/main/java/games/strategy/net/nio/Encoder.java b/game-app/game-core/src/main/java/games/strategy/net/nio/Encoder.java index e8d391ff338..3be2c0e015d 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/nio/Encoder.java +++ b/game-app/game-core/src/main/java/games/strategy/net/nio/Encoder.java @@ -30,7 +30,7 @@ void write(final SocketChannel to, final MessageHeader header) { writer.enque(data, to); } catch (final IOException e) { // we aren't doing any I/O, just writing in memory so something is very wrong - log.error("Error writing object:" + header, e); + log.error("Error writing object: " + header, e); } } diff --git a/game-app/game-core/src/main/java/games/strategy/net/nio/NioWriter.java b/game-app/game-core/src/main/java/games/strategy/net/nio/NioWriter.java index 04fa4fe59f5..0791a8954c6 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/nio/NioWriter.java +++ b/game-app/game-core/src/main/java/games/strategy/net/nio/NioWriter.java @@ -127,7 +127,7 @@ private void removeLast(final SocketChannel to) { synchronized (mutex) { final List values = writing.get(to); if (values == null) { - log.error("NO socket data to:" + to); + log.error("NO socket data to: " + to); return; } values.remove(0); diff --git a/game-app/game-core/src/main/java/games/strategy/net/nio/SocketReadData.java b/game-app/game-core/src/main/java/games/strategy/net/nio/SocketReadData.java index 4d9e100d36f..fb60d105a13 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/nio/SocketReadData.java +++ b/game-app/game-core/src/main/java/games/strategy/net/nio/SocketReadData.java @@ -57,7 +57,7 @@ public boolean read(final SocketChannel channel) throws IOException { targetSize = targetSize & 0x00ffffff; // limit messages to 10MB if (targetSize <= 0 || targetSize > MAX_MESSAGE_SIZE) { - throw new IOException("Invalid triplea packet size:" + targetSize); + throw new IOException("Invalid triplea packet size: " + targetSize); } contentBuffer = ByteBuffer.allocate(targetSize); sizeBuffer = null; diff --git a/game-app/game-core/src/main/java/games/strategy/net/nio/SocketWriteData.java b/game-app/game-core/src/main/java/games/strategy/net/nio/SocketWriteData.java index 570d4e6d79f..cbae959d8d8 100644 --- a/game-app/game-core/src/main/java/games/strategy/net/nio/SocketWriteData.java +++ b/game-app/game-core/src/main/java/games/strategy/net/nio/SocketWriteData.java @@ -56,6 +56,6 @@ boolean write(final SocketChannel channel) throws IOException { @Override public String toString() { - return ""; + return ""; } } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProPurchaseUtils.java b/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProPurchaseUtils.java index 8f8c393f997..0ecbed119e5 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProPurchaseUtils.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProPurchaseUtils.java @@ -242,7 +242,7 @@ private static GamePlayer getOriginalFactoryOwner( final Collection factoryUnits = territory.getMatches(Matches.unitCanProduceUnits()); if (factoryUnits.isEmpty()) { - throw new IllegalStateException("No factory in territory:" + territory); + throw new IllegalStateException("No factory in territory: " + territory); } for (final Unit factory2 : factoryUnits) { if (player.equals(factory2.getOriginalOwner())) { 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 6c13ff3b997..a76b655a1b3 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 @@ -284,7 +284,7 @@ private Set getTerritoriesBasedOnStringName( default: // The list just contained 1 territory final Territory t = data.getMap().getTerritory(name); if (t == null) { - throw new IllegalStateException("No territory called:" + name + thisErrorMsg()); + throw new IllegalStateException("No territory called: " + name + thisErrorMsg()); } final Set terr = new HashSet<>(); terr.add(t); @@ -393,7 +393,7 @@ public Set getListedTerritories( // Validate all territories exist final Territory territory = getData().getMap().getTerritory(name); if (territory == null) { - throw new IllegalStateException("No territory called:" + name + thisErrorMsg()); + throw new IllegalStateException("No territory called: " + name + thisErrorMsg()); } territories.add(territory); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/PlayerAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/PlayerAttachment.java index 5059cfee719..86046fbba78 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/PlayerAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/PlayerAttachment.java @@ -71,7 +71,7 @@ static PlayerAttachment get(final GamePlayer p, final String nameOfAttachment) { final PlayerAttachment playerAttachment = p.getPlayerAttachment(); if (playerAttachment == null) { throw new IllegalStateException( - "No player attachment for:" + p.getName() + " with name:" + nameOfAttachment); + "No player attachment for: " + p.getName() + " with name: " + nameOfAttachment); } return playerAttachment; } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/RulesAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/RulesAttachment.java index 32c6d625a4a..edd1f6ba1d6 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/RulesAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/RulesAttachment.java @@ -571,7 +571,7 @@ private void setTechs(final String newTechs) throws GameParseException { } if (ta == null) { throw new GameParseException( - "Technology not found :" + Arrays.toString(s) + thisErrorMsg()); + "Technology not found: " + Arrays.toString(s) + thisErrorMsg()); } techs.add(ta); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TechAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TechAttachment.java index 765dbf1c635..2daf743a39a 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TechAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TechAttachment.java @@ -48,7 +48,8 @@ public TechAttachment(final String name, final Attachable attachable, final Game static TechAttachment get(final GamePlayer gamePlayer, final String nameOfAttachment) { if (!nameOfAttachment.equals(Constants.TECH_ATTACHMENT_NAME)) { throw new IllegalStateException( - "TechAttachment may not yet get attachments not named:" + Constants.TECH_ATTACHMENT_NAME); + "TechAttachment may not yet get attachments not named: " + + Constants.TECH_ATTACHMENT_NAME); } return gamePlayer.getTechAttachment(); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TerritoryAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TerritoryAttachment.java index 691c856ebe7..935e4f44cd1 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TerritoryAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TerritoryAttachment.java @@ -113,7 +113,7 @@ public static boolean doWeHaveEnoughCapitalsToProduce( if (player.getOptional()) { return null; } - throw new IllegalStateException("Capital not found for:" + player); + throw new IllegalStateException("Capital not found for: " + player); } /** will return empty list if none controlled, never returns null. */ @@ -134,7 +134,7 @@ public static List getAllCapitals(final GamePlayer player, final Game if (player.getOptional()) { return capitals; } - throw new IllegalStateException("Capital not found for:" + player); + throw new IllegalStateException("Capital not found for: " + player); } /** will return empty list if none controlled, never returns null. */ @@ -162,7 +162,7 @@ static TerritoryAttachment get(final Territory t, final String nameOfAttachment) (TerritoryAttachment) t.getAttachment(nameOfAttachment); if (territoryAttachment == null && !t.isWater()) { throw new IllegalStateException( - "No territory attachment for:" + t.getName() + " with name:" + nameOfAttachment); + "No territory attachment for: " + t.getName() + " with name: " + nameOfAttachment); } return territoryAttachment; } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java index 54444024431..399b485e73c 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java @@ -400,7 +400,7 @@ private void resetActivateTrigger() { private void setFrontier(final String s) throws GameParseException { final ProductionFrontier front = getData().getProductionFrontierList().getProductionFrontier(s); if (front == null) { - throw new GameParseException("Could not find frontier. name:" + s + thisErrorMsg()); + throw new GameParseException("Could not find frontier. name: " + s + thisErrorMsg()); } frontier = front; } @@ -423,14 +423,15 @@ private void setProductionRule(final String prop) throws GameParseException { throw new GameParseException("Invalid productionRule declaration: " + prop + thisErrorMsg()); } if (getData().getProductionFrontierList().getProductionFrontier(s[0]) == null) { - throw new GameParseException("Could not find frontier. name:" + s[0] + thisErrorMsg()); + throw new GameParseException("Could not find frontier. name: " + s[0] + thisErrorMsg()); } String rule = s[1]; if (rule.startsWith("-")) { rule = rule.replaceFirst("-", ""); } if (getData().getProductionRuleList().getProductionRule(rule) == null) { - throw new GameParseException("Could not find production rule. name:" + rule + thisErrorMsg()); + throw new GameParseException( + "Could not find production rule. name: " + rule + thisErrorMsg()); } if (productionRule == null) { productionRule = new ArrayList<>(); @@ -485,7 +486,7 @@ private void setTech(final String techs) throws GameParseException { ta = getData().getTechnologyFrontier().getAdvanceByName(subString); } if (ta == null) { - throw new GameParseException("Technology not found :" + subString + thisErrorMsg()); + throw new GameParseException("Technology not found : " + subString + thisErrorMsg()); } if (tech == null) { tech = new ArrayList<>(); @@ -525,7 +526,7 @@ private void setAvailableTech(final String techs) throws GameParseException { ta = getData().getTechnologyFrontier().getAdvanceByName(s[i]); } if (ta == null) { - throw new GameParseException("Technology not found :" + s[i] + thisErrorMsg()); + throw new GameParseException("Technology not found : " + s[i] + thisErrorMsg()); } tlist.put(ta, add); } @@ -560,7 +561,7 @@ private void setSupport(final String value) throws GameParseException { .orElseThrow( () -> new GameParseException( - "Could not find unitSupportAttachment. name:" + name + thisErrorMsg())); + "Could not find unitSupportAttachment. name: " + name + thisErrorMsg())); if (support == null) { support = new LinkedHashMap<>(); } @@ -697,11 +698,11 @@ private void setUnitAttachmentName(final String name) throws GameParseException "unitAttachmentName count must be a valid attachment name" + thisErrorMsg()); } if (s[1].equals("UnitAttachment") && !s[0].startsWith(Constants.UNIT_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("UnitSupportAttachment") && !s[0].startsWith(Constants.SUPPORT_ATTACHMENT_PREFIX)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } unitAttachmentName = Tuple.of(s[1].intern(), s[0].intern()); } @@ -787,10 +788,10 @@ private void setTerritoryAttachmentName(final String name) throws GameParseExcep } if (s[1].equals("TerritoryAttachment") && !s[0].startsWith(Constants.TERRITORY_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("CanalAttachment") && !s[0].startsWith(Constants.CANAL_ATTACHMENT_PREFIX)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } territoryAttachmentName = Tuple.of(s[1].intern(), s[0].intern()); } @@ -880,27 +881,27 @@ private void setPlayerAttachmentName(final String playerAttachmentName) "playerAttachmentName count must be a valid attachment name" + thisErrorMsg()); } if (s[1].equals("PlayerAttachment") && !s[0].startsWith(Constants.PLAYER_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("RulesAttachment") && !(s[0].startsWith(Constants.RULES_ATTACHMENT_NAME) || s[0].startsWith(Constants.RULES_OBJECTIVE_PREFIX) || s[0].startsWith(Constants.RULES_CONDITION_PREFIX))) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("TriggerAttachment") && !s[0].startsWith(Constants.TRIGGER_ATTACHMENT_PREFIX)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("TechAttachment") && !s[0].startsWith(Constants.TECH_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("PoliticalActionAttachment") && !s[0].startsWith(Constants.POLITICALACTION_ATTACHMENT_PREFIX)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } if (s[1].equals("UserActionAttachment") && !s[0].startsWith(Constants.USERACTION_ATTACHMENT_PREFIX)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } this.playerAttachmentName = Tuple.of(s[1].intern(), s[0].intern()); } @@ -949,7 +950,7 @@ private void setRelationshipTypes(final String names) throws GameParseException getData().getRelationshipTypeList().getRelationshipType(element); if (relation == null) { throw new GameParseException( - "Could not find relationshipType. name:" + element + thisErrorMsg()); + "Could not find relationshipType. name: " + element + thisErrorMsg()); } if (relationshipTypes == null) { relationshipTypes = new ArrayList<>(); @@ -990,7 +991,7 @@ private void setRelationshipTypeAttachmentName(final String name) throws GamePar "relationshipTypeAttachmentName count must be a valid attachment name" + thisErrorMsg()); } if (!s[0].startsWith(Constants.RELATIONSHIPTYPE_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } relationshipTypeAttachmentName = Tuple.of(s[1].intern(), s[0].intern()); } @@ -1039,7 +1040,7 @@ private void setTerritoryEffects(final String effectNames) throws GameParseExcep final TerritoryEffect effect = getData().getTerritoryEffectList().get(name); if (effect == null) { throw new GameParseException( - "Could not find territoryEffect. name:" + name + thisErrorMsg()); + "Could not find territoryEffect. name: " + name + thisErrorMsg()); } if (territoryEffects == null) { territoryEffects = new ArrayList<>(); @@ -1079,7 +1080,7 @@ private void setTerritoryEffectAttachmentName(final String name) throws GamePars "territoryEffectAttachmentName count must be a valid attachment name" + thisErrorMsg()); } if (!s[0].startsWith(Constants.TERRITORYEFFECT_ATTACHMENT_NAME)) { - throw new GameParseException("attachment incorrectly named:" + s[0] + thisErrorMsg()); + throw new GameParseException("attachment incorrectly named: " + s[0] + thisErrorMsg()); } territoryEffectAttachmentName = Tuple.of(s[1].intern(), s[0].intern()); } @@ -1702,7 +1703,7 @@ public static void triggerTerritoryPropertyChange( if (attachment == null) { // water territories may not have an attachment, so this could be null throw new IllegalStateException( - "Triggers: No territory attachment for:" + territory.getName()); + "Triggers: No territory attachment for: " + territory.getName()); } getPropertyChangeHistoryStartEvent( @@ -1923,7 +1924,7 @@ public static void triggerAvailableTechChange( player.getTechnologyFrontierList().getTechnologyFrontier(cat); if (tf == null) { throw new IllegalStateException( - "Triggers: tech category doesn't exist:" + cat + " for player:" + player); + "Triggers: tech category doesn't exist: " + cat + " for player: " + player); } for (final TechAdvance ta : t.getAvailableTech().get(cat).keySet()) { if (t.getAvailableTech().get(cat).get(ta)) { @@ -2096,7 +2097,7 @@ public static void triggerSupportChange( .orElseThrow( () -> new IllegalStateException( - "Could not find unitSupportAttachment. name:" + entry.getKey())); + "Could not find unitSupportAttachment. name: " + entry.getKey())); final List p = new ArrayList<>(usa.getPlayers()); final boolean addPlayer = entry.getValue(); if (p.contains(player) == addPlayer) { 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 0db708b24f7..95d4d483d47 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 @@ -1949,7 +1949,7 @@ private void addToResourceMap( final Resource r = getData().getResourceList().getResource(resourceToProduce); if (r == null) { throw new GameParseException( - description + ": No resource called:" + resourceToProduce + thisErrorMsg()); + description + ": No resource called: " + resourceToProduce + thisErrorMsg()); } final int n = getInt(s[0]); if (!allowNegative && n < 0) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractEndTurnDelegate.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractEndTurnDelegate.java index 290a78d03e2..7a2b6e1667b 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractEndTurnDelegate.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractEndTurnDelegate.java @@ -464,7 +464,7 @@ public static int getProduction(final Collection territories, final G for (final Territory current : territories) { final TerritoryAttachment attachment = TerritoryAttachment.get(current); if (attachment == null) { - throw new IllegalStateException("No attachment for owned territory:" + current.getName()); + throw new IllegalStateException("No attachment for owned territory: " + current.getName()); } // Match will Check if territory is originally owned convoy center, or if it is contested if (Matches.territoryCanCollectIncomeFrom(current.getOwner()).test(current)) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractPlaceDelegate.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractPlaceDelegate.java index 9d5f4d16346..7dd24828535 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractPlaceDelegate.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/AbstractPlaceDelegate.java @@ -1611,7 +1611,7 @@ private boolean wasOwnedUnitThatCanProduceUnitsOrIsFactoryInTerritoryAtStartOfSt private GamePlayer getOriginalFactoryOwner(final Territory territory) { final Collection factoryUnits = territory.getMatches(Matches.unitCanProduceUnits()); if (factoryUnits.isEmpty()) { - throw new IllegalStateException("No factory in territory:" + territory); + throw new IllegalStateException("No factory in territory: " + territory); } for (final Unit factory : factoryUnits) { if (player.equals(factory.getOriginalOwner())) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/DiceRoll.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/DiceRoll.java index b3ee0e4a5fd..c5e64e7cf89 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/DiceRoll.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/DiceRoll.java @@ -166,6 +166,6 @@ private int readSerializeVersion(final ObjectInput in) { @Override public String toString() { - return "DiceRoll dice:" + rolls + " hits:" + hits + " expectedHits:" + expectedHits; + return "DiceRoll dice: " + rolls + " hits: " + hits + " expectedHits: " + expectedHits; } } 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 62d05217c5f..4589a35f6ac 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 @@ -54,8 +54,8 @@ static Die getFromWriteValue(final int value) { @Override public String toString() { if (rolledAt < 0) { - return "Die roll:" + value + (type == DieType.IGNORED ? " type:" + type : ""); + return "Die roll: " + value + (type == DieType.IGNORED ? " type: " + type : ""); } - return "Die roll:" + value + " rolled at:" + rolledAt + " type:" + type; + return "Die roll: " + value + " rolled at: " + rolledAt + " type: " + type; } } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/EndTurnDelegate.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/EndTurnDelegate.java index 2888a307ae2..ccff04b784f 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/EndTurnDelegate.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/EndTurnDelegate.java @@ -424,7 +424,7 @@ public static IntegerMap getResourceProduction( for (final Territory current : territories) { final TerritoryAttachment attachment = TerritoryAttachment.get(current); if (attachment == null) { - throw new IllegalStateException("No attachment for owned territory:" + current.getName()); + throw new IllegalStateException("No attachment for owned territory: " + current.getName()); } final ResourceCollection toAdd = attachment.getResources(); if (toAdd == null) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/ImprovedShipyardsAdvance.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/ImprovedShipyardsAdvance.java index c70ddde6f19..291d6627085 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/ImprovedShipyardsAdvance.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/ImprovedShipyardsAdvance.java @@ -41,7 +41,7 @@ public void perform(final GamePlayer gamePlayer, final IDelegateBridge bridge) { data.getProductionFrontierList().getProductionFrontier(industrialTechName); // it doesnt exist, dont crash if (advancedTech == null) { - log.warn("No tech named:" + industrialTechName + " not adding tech"); + log.warn("No tech named: " + industrialTechName + " not adding tech"); return; } final Change prodChange = ChangeFactory.changeProductionFrontier(gamePlayer, advancedTech); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/IndustrialTechnologyAdvance.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/IndustrialTechnologyAdvance.java index e811f077cf0..a57b48aef88 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/IndustrialTechnologyAdvance.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/IndustrialTechnologyAdvance.java @@ -35,7 +35,7 @@ public void perform(final GamePlayer gamePlayer, final IDelegateBridge bridge) { bridge.getData().getProductionFrontierList().getProductionFrontier(industrialTechName); // it doesnt exist, dont crash if (advancedTech == null) { - log.warn("No tech named:" + industrialTechName + " not adding tech"); + log.warn("No tech named: " + industrialTechName + " not adding tech"); return; } final Change prodChange = ChangeFactory.changeProductionFrontier(gamePlayer, advancedTech); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/InitializationDelegate.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/InitializationDelegate.java index 2a9d90e550d..65690bc2010 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/InitializationDelegate.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/InitializationDelegate.java @@ -316,7 +316,7 @@ private static void initTwoHitBattleship(final IDelegateBridge bridge) { final UnitAttachment battleShipAttachment = battleShipUnit.getUnitAttachment(); final boolean defaultEnabled = battleShipAttachment.getHitPoints() > 1; if (userEnabled != defaultEnabled) { - bridge.getHistoryWriter().startEvent("TwoHitBattleships:" + userEnabled); + bridge.getHistoryWriter().startEvent("TwoHitBattleships: " + userEnabled); bridge.addChange( ChangeFactory.attachmentPropertyChange( battleShipAttachment, userEnabled ? 2 : 1, "hitPoints")); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/RocketsFireHelper.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/RocketsFireHelper.java index 6de5834002e..ea15a38b66a 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/RocketsFireHelper.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/RocketsFireHelper.java @@ -490,8 +490,8 @@ private void fireRocket( cost *= Properties.getPuMultiplier(data.getProperties()); getRemote(bridge) .reportMessage( - "Rocket attack in " + attackedTerritory.getName() + " costs:" + cost, - "Rocket attack in " + attackedTerritory.getName() + " costs:" + cost); + "Rocket attack in " + attackedTerritory.getName() + " costs: " + cost, + "Rocket attack in " + attackedTerritory.getName() + " costs: " + cost); // Trying to remove more PUs than the victim has is A Bad Thing[tm] final int availForRemoval = attacked.getResources().getQuantity(pus); if (cost > availForRemoval) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TechnologyDelegate.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TechnologyDelegate.java index 907b2d240dc..6b9c9d51cea 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TechnologyDelegate.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TechnologyDelegate.java @@ -402,7 +402,7 @@ private Collection getTechAdvances(final int initialHits) { } bridge .getHistoryWriter() - .startEvent("Rolls to resolve tech hits:" + MyFormatter.asDice(random)); + .startEvent("Rolls to resolve tech hits: " + MyFormatter.asDice(random)); return ImmutableList.copyOf(newAdvances); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TransportTracker.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TransportTracker.java index 1939406fc9f..d525671351d 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TransportTracker.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/TransportTracker.java @@ -35,7 +35,7 @@ public class TransportTracker { private static void assertTransport(final Unit u) { if (u.getUnitAttachment().getTransportCapacity() == -1) { - throw new IllegalStateException("Not a transport:" + u); + throw new IllegalStateException("Not a transport: " + u); } } @@ -99,7 +99,7 @@ static Change unloadTransportChange( assertTransport(transport); if (!transport.getTransporting().contains(unit)) { throw new IllegalStateException( - "Not being carried, unit:" + unit + " transport:" + transport); + "Not being carried, unit: " + unit + " transport: " + transport); } final List newUnloaded = new ArrayList<>(transport.getUnloaded()); newUnloaded.add(unit); @@ -166,7 +166,8 @@ static Change loadTransportChange(final Unit transport, final Unit unit) { change.add(ChangeFactory.unitPropertyChange(unit, transport, Unit.TRANSPORTED_BY)); final Collection newCarrying = new ArrayList<>(transport.getTransporting()); if (newCarrying.contains(unit)) { - throw new IllegalStateException("Already carrying, transport:" + transport + " unt:" + unit); + throw new IllegalStateException( + "Already carrying, transport: " + transport + " unt: " + unit); } newCarrying.add(unit); change.add(ChangeFactory.unitPropertyChange(unit, Boolean.TRUE, Unit.LOADED_THIS_TURN)); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/UndoableMove.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/UndoableMove.java index a79bf387f72..d621f1de1b7 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/UndoableMove.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/UndoableMove.java @@ -198,7 +198,7 @@ public boolean wasTransportLoaded(final Unit transport) { @Override public String toString() { - return "UndoableMove index;" + index + " description:" + description; + return "UndoableMove index;" + index + " description: " + description; } @Override diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AirBattle.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AirBattle.java index 960efc21277..2fcb4e49ddc 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AirBattle.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/AirBattle.java @@ -294,7 +294,7 @@ public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { // this should always be the base of the stack // when we execute the loop, it will populate the stack with the battle steps if (!AirBattle.this.stack.isEmpty()) { - throw new IllegalStateException("Stack not empty:" + AirBattle.this.stack); + throw new IllegalStateException("Stack not empty: " + AirBattle.this.stack); } AirBattle.this.stack.push(loop); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/MustFightBattle.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/MustFightBattle.java index 4834b8244f7..7e02ad80faa 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/MustFightBattle.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/MustFightBattle.java @@ -1327,7 +1327,7 @@ public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { // this should always be the base of the stack // when we execute the loop, it will populate the stack with the battle steps if (!MustFightBattle.this.stack.isEmpty()) { - throw new IllegalStateException("Stack not empty:" + MustFightBattle.this.stack); + throw new IllegalStateException("Stack not empty: " + MustFightBattle.this.stack); } MustFightBattle.this.stack.push(loop); } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/MoveValidationResult.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/MoveValidationResult.java index 500cab3ac3c..8a2242d0e15 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/MoveValidationResult.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/MoveValidationResult.java @@ -146,6 +146,6 @@ public int compareTo(final MoveValidationResult other) { @Override public String toString() { - return "Move Validation Results, error:" + error + " isValid():" + isMoveValid(); + return "Move Validation Results, error: " + error + " isValid(): " + isMoveValid(); } } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlaceableUnits.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlaceableUnits.java index 470dc638973..cee824d18ee 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlaceableUnits.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlaceableUnits.java @@ -43,6 +43,6 @@ public boolean isError() { @Override public String toString() { - return "ProductionResponseMessage units:" + units; + return "ProductionResponseMessage units: " + units; } } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlacementDescription.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlacementDescription.java index 2a940711cc4..7af525d6fb5 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlacementDescription.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/data/PlacementDescription.java @@ -19,6 +19,6 @@ public PlacementDescription(final Collection units, final Territory territ @Override public String toString() { - return "Placement message territory:" + territory + " units:" + getUnits(); + return "Placement message territory: " + territory + " units: " + getUnits(); } } diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/move/validation/MoveValidator.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/move/validation/MoveValidator.java index 26a152298a5..a2823797b1e 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/move/validation/MoveValidator.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/move/validation/MoveValidator.java @@ -201,11 +201,11 @@ private MoveValidationResult validateFirst( } // this should never happen if (new HashSet<>(units).size() != units.size()) { - result.setError("Not all units unique, units:" + units + " unique:" + new HashSet<>(units)); + result.setError("Not all units unique, units: " + units + " unique: " + new HashSet<>(units)); return result; } if (!data.getMap().isValidRoute(route)) { - result.setError("Invalid route:" + route); + result.setError("Invalid route: " + route); return result; } if (validateMovementRestrictedByTerritory(route, player, result).hasError()) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/image/ImageFactory.java b/game-app/game-core/src/main/java/games/strategy/triplea/image/ImageFactory.java index ecf73096dba..5d8eb25e3c6 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/image/ImageFactory.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/image/ImageFactory.java @@ -48,7 +48,7 @@ public void setResourceLoader(final ResourceLoader loader) { */ protected Image getImageOrThrow(final String... keys) { return getImage(keys) - .orElseThrow(() -> new IllegalStateException("Image Not Found:" + keys[0])); + .orElseThrow(() -> new IllegalStateException("Image Not Found: " + keys[0])); } /** diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/odds/calculator/BattleCalculatorPanel.java b/game-app/game-core/src/main/java/games/strategy/triplea/odds/calculator/BattleCalculatorPanel.java index 2d76a2b69a0..78d5b69a65c 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/odds/calculator/BattleCalculatorPanel.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/odds/calculator/BattleCalculatorPanel.java @@ -562,7 +562,7 @@ private void updateStats() { try { final Territory location = findPotentialBattleSite(); if (location == null) { - throw new IllegalStateException("No territory found that is land:" + isLandBattle()); + throw new IllegalStateException("No territory found that is land: " + isLandBattle()); } final List defending = defendingUnitsPanel.getUnits(); final List attacking = attackingUnitsPanel.getUnits(); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/BattleStepsPanel.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/BattleStepsPanel.java index 96a9acbb864..5f3628afc92 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/BattleStepsPanel.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/BattleStepsPanel.java @@ -80,7 +80,7 @@ private boolean doneWalkingSteps() { } // we cant find it, something is wrong if (!targetStep.equals(LAST_STEP) && listModel.lastIndexOf(targetStep) == -1) { - log.error("Step not found:" + targetStep + " in:" + listModel); + log.error("Step not found: " + targetStep + " in: " + listModel); clearTargetStep(); return true; } @@ -152,7 +152,7 @@ public void setStep(final String step) { if (listModel.indexOf(step) != -1) { targetStep = step; } else { - log.warn("Could not find step name:" + step); + log.warn("Could not find step name: " + step); } } goToTarget(); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/BottomBar.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/BottomBar.java index 97b96feedc9..2509cba9583 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/BottomBar.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/BottomBar.java @@ -252,7 +252,7 @@ public void gameDataChanged() { public void setStepInfo( int roundNumber, String stepName, @Nullable GamePlayer player, boolean isRemotePlayer) { - roundLabel.setText("Round:" + roundNumber + " "); + roundLabel.setText("Round: " + roundNumber + " "); stepLabel.setText(stepName); if (player != null) { setCurrentPlayer(player, isRemotePlayer); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/ObjectiveDummyDelegateBridge.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/ObjectiveDummyDelegateBridge.java index a31657304e9..704138e8416 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/ObjectiveDummyDelegateBridge.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/ObjectiveDummyDelegateBridge.java @@ -79,7 +79,7 @@ public int[] getRandom( final DiceType diceType, final String annotation) { if (count <= 0) { - throw new IllegalStateException("count must be > o, annotation:" + annotation); + throw new IllegalStateException("count must be > o, annotation: " + annotation); } final int[] numbers = new int[count]; for (int i = 0; i < count; i++) { diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/mapdata/MapData.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/mapdata/MapData.java index 956d15322ab..d194540a45e 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/mapdata/MapData.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/mapdata/MapData.java @@ -679,7 +679,7 @@ public Rectangle getBoundingRect(final String name) { final List polys = this.polys.get(name); if (polys == null) { throw new IllegalStateException( - "No polygons found for:" + name + " All territories:" + this.polys.keySet()); + "No polygons found for: " + name + " All territories: " + this.polys.keySet()); } final Iterator polyIter = polys.iterator(); final Rectangle bounds = polyIter.next().getBounds(); diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/TileManager.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/TileManager.java index 92a8d63655e..e111fcb3cb5 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/TileManager.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/TileManager.java @@ -309,7 +309,7 @@ private void drawUnits( final Set drawing) { final Iterator placementPoints = mapData.getPlacementPoints(territory).iterator(); if (!placementPoints.hasNext()) { - throw new IllegalStateException("No where to place units:" + territory.getName()); + throw new IllegalStateException("No where to place units: " + territory.getName()); } Point lastPlace = null; diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/UnitsDrawer.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/UnitsDrawer.java index 063cae581cb..34da11c4f76 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/UnitsDrawer.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/screen/UnitsDrawer.java @@ -107,7 +107,7 @@ public void draw( } final UnitType type = data.getUnitTypeList().getUnitType(unitType); if (type == null) { - throw new IllegalStateException("Type not found:" + unitType); + throw new IllegalStateException("Type not found: " + unitType); } final GamePlayer owner = data.getPlayerList().getPlayerId(playerName); final boolean damagedImage = damaged > 0 || bombingUnitDamage > 0; diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitOwner.java b/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitOwner.java index 5b2f9a0f6f6..3ec28bef016 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitOwner.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/util/UnitOwner.java @@ -39,6 +39,6 @@ public int hashCode() { @Override public String toString() { - return "Unit owner:" + owner.getName() + " type:" + type.getName(); + return "Unit owner: " + owner.getName() + " type: " + type.getName(); } } diff --git a/game-app/game-core/src/main/java/org/triplea/util/PointFileReaderWriter.java b/game-app/game-core/src/main/java/org/triplea/util/PointFileReaderWriter.java index 3411876626f..278a2b1f6ba 100644 --- a/game-app/game-core/src/main/java/org/triplea/util/PointFileReaderWriter.java +++ b/game-app/game-core/src/main/java/org/triplea/util/PointFileReaderWriter.java @@ -222,7 +222,7 @@ private static void readMultiplePolygons( final String line, final Map> mapping) { final String name = line.substring(0, line.indexOf('<')).trim(); if (mapping.containsKey(name)) { - throw new IllegalArgumentException("name found twice:" + name); + throw new IllegalArgumentException("name found twice: " + name); } final List polygons = new ArrayList<>(); final Matcher polyMatcher = polygonPattern.matcher(line); @@ -248,7 +248,7 @@ private static Tuple> readMultiple( final String line, final Map> mapping) { final String name = line.substring(0, line.indexOf("(")).trim(); if (mapping.containsKey(name)) { - throw new IllegalArgumentException("name found twice:" + name); + throw new IllegalArgumentException("name found twice: " + name); } final Matcher matcher = pointPattern.matcher(line); final List points = new ArrayList<>(); diff --git a/game-app/game-core/src/main/java/tools/image/AutoPlacementFinder.java b/game-app/game-core/src/main/java/tools/image/AutoPlacementFinder.java index 042651b74f9..f16be6a34be 100644 --- a/game-app/game-core/src/main/java/tools/image/AutoPlacementFinder.java +++ b/game-app/game-core/src/main/java/tools/image/AutoPlacementFinder.java @@ -279,7 +279,7 @@ private void calculate() { } try { PointFileReaderWriter.writeOneToMany(fileName, placements); - textOptionPane.appendNewLine("Data written to :" + fileName.normalize().toAbsolutePath()); + textOptionPane.appendNewLine("Data written to: " + fileName.normalize().toAbsolutePath()); } catch (final IOException e) { log.error("Failed to write points file: " + fileName, e); textOptionPane.dispose(); @@ -357,7 +357,7 @@ private List getPlacementsStartingAtMiddle( step--; } // For Debugging - // textOptionPane.appendNewLine("x:" + x + " y:" + y); + // textOptionPane.appendNewLine("x: " + x + " y: " + y); if (placementPoints.size() > 50) { break; } diff --git a/game-app/game-core/src/main/java/tools/image/CenterPicker.java b/game-app/game-core/src/main/java/tools/image/CenterPicker.java index 0049920cc06..46fbd94f35a 100644 --- a/game-app/game-core/src/main/java/tools/image/CenterPicker.java +++ b/game-app/game-core/src/main/java/tools/image/CenterPicker.java @@ -160,7 +160,7 @@ private final class CenterPickerFrame extends JFrame { new MouseMotionAdapter() { @Override public void mouseMoved(final MouseEvent e) { - locationLabel.setText("x:" + e.getX() + " y:" + e.getY()); + locationLabel.setText("x: " + e.getX() + " y: " + e.getY()); } }); // Add a mouse listener to monitor for right mouse button being clicked. @@ -237,7 +237,7 @@ private void saveCenters() { } try { PointFileReaderWriter.writeOneToOne(fileName, centers); - log.info("Data written to :" + fileName.normalize().toAbsolutePath()); + log.info("Data written to: " + fileName.normalize().toAbsolutePath()); } catch (final IOException e) { log.error("Failed to save centers: " + fileName, e); } diff --git a/game-app/game-core/src/main/java/tools/image/DecorationPlacer.java b/game-app/game-core/src/main/java/tools/image/DecorationPlacer.java index f29be65c646..31748083696 100644 --- a/game-app/game-core/src/main/java/tools/image/DecorationPlacer.java +++ b/game-app/game-core/src/main/java/tools/image/DecorationPlacer.java @@ -498,7 +498,7 @@ private void saveImagePoints() { } try { PointFileReaderWriter.writeOneToMany(fileName, currentPoints); - log.info("Data written to :" + fileName.normalize().toAbsolutePath()); + log.info("Data written to: " + fileName.normalize().toAbsolutePath()); } catch (final IOException e) { log.error("Failed to save points: " + fileName, e); } diff --git a/game-app/game-core/src/main/java/tools/image/PolygonGrabber.java b/game-app/game-core/src/main/java/tools/image/PolygonGrabber.java index 56d4ffc8c6c..5fc0b1eccf5 100644 --- a/game-app/game-core/src/main/java/tools/image/PolygonGrabber.java +++ b/game-app/game-core/src/main/java/tools/image/PolygonGrabber.java @@ -182,7 +182,7 @@ private final class PolygonGrabberFrame extends JFrame { new MouseMotionAdapter() { @Override public void mouseMoved(final MouseEvent e) { - location.setText("x:" + e.getX() + " y:" + e.getY()); + location.setText("x: " + e.getX() + " y: " + e.getY()); } }); /* @@ -247,7 +247,7 @@ public void mouseClicked(final MouseEvent e) { g.drawImage(bufferedImage, 0, 0, null); for (final String territoryName : centers.keySet()) { final Point center = centers.get(territoryName); - log.info("Detecting Polygon for:" + territoryName); + log.info("Detecting Polygon for: " + territoryName); final @Nullable Polygon p = findPolygon(center.x, center.y); // test if the poly contains the center point (this often fails when there is an // island right above (because findPolygon will grab the island instead) @@ -434,7 +434,7 @@ private void savePolygons() { } try { PointFileReaderWriter.writeOneToManyPolygons(polyName, polygons); - log.info("Data written to :" + polyName.normalize().toAbsolutePath()); + log.info("Data written to: " + polyName.normalize().toAbsolutePath()); } catch (final IOException e) { log.error("Failed to save polygons: " + polyName, e); } @@ -559,7 +559,7 @@ private boolean inBounds(final int x, final int y, final BufferedImage image) { */ private void move(final Point p, final int direction) { if (direction < 0 || direction > 7) { - throw new IllegalArgumentException("Not a direction :" + direction); + throw new IllegalArgumentException("Not a direction : " + direction); } if (direction == 1 || direction == 2 || direction == 3) { p.x++; diff --git a/game-app/game-core/src/main/java/tools/map/making/ConnectionFinder.java b/game-app/game-core/src/main/java/tools/map/making/ConnectionFinder.java index ec7cb3d53a0..d953a36958c 100644 --- a/game-app/game-core/src/main/java/tools/map/making/ConnectionFinder.java +++ b/game-app/game-core/src/main/java/tools/map/making/ConnectionFinder.java @@ -235,7 +235,7 @@ private void runInternal() { } out.write(String.valueOf(connectionsString).getBytes(StandardCharsets.UTF_8)); } - log.info("Data written to :" + fileName.normalize().toAbsolutePath()); + log.info("Data written to: " + fileName.normalize().toAbsolutePath()); } } catch (final Exception e) { log.error("Failed to write connections", e); diff --git a/game-app/game-core/src/main/java/tools/map/making/MapPropertiesMaker.java b/game-app/game-core/src/main/java/tools/map/making/MapPropertiesMaker.java index 40551135dac..f804c2332dc 100644 --- a/game-app/game-core/src/main/java/tools/map/making/MapPropertiesMaker.java +++ b/game-app/game-core/src/main/java/tools/map/making/MapPropertiesMaker.java @@ -506,7 +506,7 @@ private void saveProperties() { Writer out = new OutputStreamWriter(sink, StandardCharsets.UTF_8)) { out.write(stringToWrite); } - log.info("Data written to :" + fileName.normalize().toAbsolutePath()); + log.info("Data written to: " + fileName.normalize().toAbsolutePath()); log.info(stringToWrite); } catch (final Exception e) { log.error("Failed to save map properties", e); diff --git a/game-app/game-core/src/main/java/tools/map/making/PlacementPicker.java b/game-app/game-core/src/main/java/tools/map/making/PlacementPicker.java index b097b36161e..bf4048f5f54 100644 --- a/game-app/game-core/src/main/java/tools/map/making/PlacementPicker.java +++ b/game-app/game-core/src/main/java/tools/map/making/PlacementPicker.java @@ -342,7 +342,7 @@ private final class PlacementPickerFrame extends JFrame { new MouseMotionAdapter() { @Override public void mouseMoved(final MouseEvent e) { - locationLabel.setText("x:" + e.getX() + " y:" + e.getY()); + locationLabel.setText("x: " + e.getX() + " y: " + e.getY()); currentSquare = new Point(e.getPoint()); repaint(); } @@ -535,7 +535,7 @@ private void savePlacements() { } try { PointFileReaderWriter.writeOneToManyPlacements(fileName, placements); - log.info("Data written to :" + fileName.normalize().toAbsolutePath()); + log.info("Data written to: " + fileName.normalize().toAbsolutePath()); } catch (final IOException e) { log.error("Failed to write placements: " + fileName, e); } @@ -587,7 +587,7 @@ private void mouseEvent(final Point point, final boolean ctrlDown, final boolean if (currentPlacements != null) { placements.put(currentCountry, Tuple.of(currentPlacements, currentOverflowToLeft)); currentPlacements = new ArrayList<>(); - log.info("done:" + currentCountry); + log.info("done: " + currentCountry); } } else { if (currentPlacements != null && !currentPlacements.isEmpty()) { diff --git a/game-app/game-core/src/test/java/games/strategy/engine/data/changefactory/ObjectPropertyChangeMatcher.java b/game-app/game-core/src/test/java/games/strategy/engine/data/changefactory/ObjectPropertyChangeMatcher.java index 98206e8c733..ae2278be763 100644 --- a/game-app/game-core/src/test/java/games/strategy/engine/data/changefactory/ObjectPropertyChangeMatcher.java +++ b/game-app/game-core/src/test/java/games/strategy/engine/data/changefactory/ObjectPropertyChangeMatcher.java @@ -35,9 +35,9 @@ && equalTo(objectPropertyChange.getNewValue()).matches(newValue) @Override public void describeTo(final Description description) { - description.appendText("property:" + property); - description.appendText(" newValue:" + newValue); - description.appendText(" oldValue:" + oldValue); + description.appendText("property: " + property); + description.appendText(" newValue: " + newValue); + description.appendText(" oldValue: " + oldValue); } public static ChangeMatcher propertyChange( diff --git a/game-app/game-core/src/test/java/games/strategy/triplea/delegate/GameDataTestUtil.java b/game-app/game-core/src/test/java/games/strategy/triplea/delegate/GameDataTestUtil.java index 74476d7fbb6..ee128ac8125 100644 --- a/game-app/game-core/src/test/java/games/strategy/triplea/delegate/GameDataTestUtil.java +++ b/game-app/game-core/src/test/java/games/strategy/triplea/delegate/GameDataTestUtil.java @@ -142,7 +142,7 @@ public static GamePlayer chinese(final GameState data) { * @return A Territory matching the given name if present, otherwise throwing an Exception. */ public static Territory territory(final String name, final GameState data) { - return checkNotNull(data.getMap().getTerritory(name), "No territory:" + name); + return checkNotNull(data.getMap().getTerritory(name), "No territory: " + name); } /** Returns an armor UnitType object for the specified GameData object. */ @@ -409,7 +409,7 @@ public static void load(final Collection units, final Route route) { final String error = moveDelegate.performMove(new MoveDescription(units, route, unitsToTransports)); if (error != null) { - throw new IllegalStateException("Illegal move:" + error); + throw new IllegalStateException("Illegal move: " + error); } } @@ -418,7 +418,7 @@ public static void move(final Collection units, final Route route) { final String error = moveDelegate(route.getStart().getData()).performMove(new MoveDescription(units, route)); if (error != null) { - throw new IllegalStateException("Illegal move:" + error); + throw new IllegalStateException("Illegal move: " + error); } } @@ -436,14 +436,14 @@ public static int getIndex(final List steps, final Class type) { for (final IExecutable e : steps) { if (type.isInstance(e)) { if (indexOfType != -1) { - throw new IllegalStateException("More than one instance:" + steps); + throw new IllegalStateException("More than one instance: " + steps); } indexOfType = index; } index++; } if (indexOfType == -1) { - throw new IllegalStateException("No instance:" + steps); + throw new IllegalStateException("No instance: " + steps); } return indexOfType; } diff --git a/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedLaunchAction.java b/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedLaunchAction.java index eff5ac37683..37471b66c7a 100644 --- a/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedLaunchAction.java +++ b/game-app/game-headed/src/main/java/games/strategy/engine/framework/startup/mc/HeadedLaunchAction.java @@ -156,7 +156,7 @@ public Optional getFallbackConnection(Runnable cancelActi return null; } final String name = options.getName(); - log.debug("Server playing as:" + name); + log.debug("Server playing as: " + name); ClientSetting.playerName.setValue(name); ClientSetting.flush(); final int port = options.getPort(); diff --git a/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/ui/LobbyGameTableModel.java b/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/ui/LobbyGameTableModel.java index 0d1ce0ae0a4..4a6cc8e2ec2 100644 --- a/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/ui/LobbyGameTableModel.java +++ b/game-app/game-headed/src/main/java/games/strategy/engine/lobby/client/ui/LobbyGameTableModel.java @@ -173,7 +173,7 @@ public Object getValueAt(final int rowIndex, final int columnIndex) { case UUID: return gameList.get(rowIndex).getGameId(); default: - throw new IllegalStateException("Unknown column:" + column); + throw new IllegalStateException("Unknown column: " + column); } } diff --git a/game-app/game-headed/src/main/java/games/strategy/triplea/TripleAPlayer.java b/game-app/game-headed/src/main/java/games/strategy/triplea/TripleAPlayer.java index ced9cfa8f39..618c4b31789 100644 --- a/game-app/game-headed/src/main/java/games/strategy/triplea/TripleAPlayer.java +++ b/game-app/game-headed/src/main/java/games/strategy/triplea/TripleAPlayer.java @@ -189,7 +189,7 @@ private void startImpl(final String name) { } disableEditModeMenu(); if (badStep) { - throw new IllegalArgumentException("Unrecognized step name:" + name); + throw new IllegalArgumentException("Unrecognized step name: " + name); } } diff --git a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/BattlePanel.java b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/BattlePanel.java index 331aadc19ea..a037b9da836 100644 --- a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/BattlePanel.java +++ b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/BattlePanel.java @@ -193,7 +193,10 @@ private boolean ensureBattleIsDisplayed(final UUID battleId) { // something is wrong, we shouldn't have to wait this long if (count > 200) { log.error( - "battle not displayed, looking for:" + battleId + " showing:" + currentBattleDisplayed); + "battle not displayed, looking for: " + + battleId + + " showing: " + + currentBattleDisplayed); return false; } displayed = currentBattleDisplayed; diff --git a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/TechPanel.java b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/TechPanel.java index 7e683dc2114..2e36efdfa58 100644 --- a/game-app/game-headed/src/main/java/games/strategy/triplea/ui/TechPanel.java +++ b/game-app/game-headed/src/main/java/games/strategy/triplea/ui/TechPanel.java @@ -370,7 +370,7 @@ private static final class TechRollPanel extends JPanel { } private void setLabel(final int pus) { - left.setText("Left to spend:" + pus); + left.setText("Left to spend: " + pus); } int getValue() { @@ -663,12 +663,12 @@ private void setWidgetActivation() { } private void setLabel(final int cost) { - left.setText("Left to Spend: " + (totalPus - cost)); - totalCost.setText("Total Cost: " + cost); + left.setText("Left to Spend: " + (totalPus - cost)); + totalCost.setText("Total Cost: " + cost); } private void setTokens(final int tokens) { - right.setText("Current token count: " + tokens); + right.setText("Current token count: " + tokens); } private ScrollableTextFieldListener setWidgetAction() { 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 bd6db502f43..f9ea81229e9 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 @@ -1014,7 +1014,7 @@ private Route getRouteForced( final Territory start, final Territory end, final Collection selectedUnits) { if (forced == null || forced.isEmpty()) { throw new IllegalStateException( - "No forced territories:" + forced + " end:" + end + " start:" + start); + "No forced territories: " + forced + " end: " + end + " start: " + start); } Territory last = getFirstSelectedTerritory(); diff --git a/game-app/game-relay-server/src/main/java/org/triplea/game/server/GameRelayServer.java b/game-app/game-relay-server/src/main/java/org/triplea/game/server/GameRelayServer.java index b864d4c19b2..d2f07215c67 100644 --- a/game-app/game-relay-server/src/main/java/org/triplea/game/server/GameRelayServer.java +++ b/game-app/game-relay-server/src/main/java/org/triplea/game/server/GameRelayServer.java @@ -16,7 +16,7 @@ public class GameRelayServer { private final int port; public static URI createLocalhostConnectionUri(final int port) { - return URI.create("ws://localhost:" + port); + return URI.create("ws://localhost: " + port); } /**