From ee99fbcdfec48d3b622d0e36150ad901025b333c Mon Sep 17 00:00:00 2001 From: asvitkine Date: Sun, 9 Jul 2023 21:18:31 -0400 Subject: [PATCH] Use a stream instead. --- .../games/strategy/triplea/ui/TabbedProductionPanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ui/TabbedProductionPanel.java b/game-app/game-core/src/main/java/games/strategy/triplea/ui/TabbedProductionPanel.java index 3f9d78faa05..ad0a9cdfd32 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ui/TabbedProductionPanel.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ui/TabbedProductionPanel.java @@ -145,10 +145,10 @@ private void checkLists(final List>> ruleLists) { } } if (!rulesCopy.isEmpty()) { - String missing = ""; - for (Rule rule : rulesCopy) { - missing += rule.getProductionRule().getName() + ", "; - } + final String missing = + rulesCopy.stream() + .map(rule -> rule.getProductionRule().getName()) + .collect(Collectors.joining(", ")); throw new IllegalStateException( "production_tabs: must include all player production rules/units; missing: " + missing); }