Skip to content

Commit 3acbfd4

Browse files
committed
chore: Fix deploader freezing on macos
1 parent e80f565 commit 3acbfd4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/com/falsepattern/lib/internal/impl/dependencies/DependencyLoaderImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import lombok.RequiredArgsConstructor;
3838
import lombok.SneakyThrows;
3939
import lombok.val;
40+
import org.apache.commons.lang3.SystemUtils;
4041
import org.apache.logging.log4j.LogManager;
4142
import org.apache.logging.log4j.Logger;
4243
import org.jetbrains.annotations.NotNull;
@@ -603,12 +604,13 @@ private static void executeArtifactLoading() {
603604
LOG.info("-----------------------------------------------------------");
604605
LOG.info("FalsePatternLib is downloading dependencies. Please wait...");
605606
LOG.info("-----------------------------------------------------------");
606-
JFrame theFrame;
607+
JFrame theFrame = null;
607608
val progresses = new HashMap<DependencyLoadTask, JProgressBar>();
608-
{
609-
JFrame jFrame = null;
609+
if (SystemUtils.IS_OS_MAC) {
610+
LOG.info("MacOS detected, not creating progress window (your OS is buggy)");
611+
} else {
610612
try {
611-
jFrame = new JFrame("Dependency Download");
613+
val jFrame = new JFrame("Dependency Download");
612614
val constraints = new GridBagConstraints();
613615
jFrame.getContentPane().setLayout(new GridBagLayout());
614616
constraints.gridy = 0;
@@ -629,9 +631,9 @@ private static void executeArtifactLoading() {
629631
jFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
630632
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
631633
jFrame.setLocation(dim.width/2-jFrame.getSize().width/2, dim.height/2-jFrame.getSize().height/2);
634+
theFrame = jFrame;
632635
} catch (Exception ignored) {
633636
}
634-
theFrame = jFrame;
635637
}
636638
if (theFrame != null) {
637639
for (val task : artifactMap.values()) {

0 commit comments

Comments
 (0)