From 9bdd5384ec884e2956f4ec554de6f00e02414b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 3 Apr 2024 12:11:32 -0300 Subject: [PATCH] Wait for the CPD GUI to be closed - Fixes #4913 --- .../pmd/cli/commands/internal/CpdGuiCommand.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java index f6da7bc988..6310b58e91 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java @@ -15,6 +15,13 @@ public class CpdGuiCommand implements Runnable { @Override public void run() { new GUI(); + + // wait for the process to be killed by the GUI + try { + Thread.currentThread().join(); + } catch (InterruptedException ignored) { + // noop + } } }