From 1b08bc24923d021efc3364a9dc5026c7af52017b Mon Sep 17 00:00:00 2001 From: asvitkine Date: Sun, 9 Jul 2023 22:04:04 -0400 Subject: [PATCH] Improve error message for production panel customization. (#11753) * Improve error message for production panel customization. * Use a stream instead. --- .../games/strategy/triplea/ui/TabbedProductionPanel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ac5552ddbb5..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,8 +145,12 @@ private void checkLists(final List>> ruleLists) { } } if (!rulesCopy.isEmpty()) { + 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"); + "production_tabs: must include all player production rules/units; missing: " + missing); } }