From 8ca41c5ab41a775116a9062f36cb970faa250503 Mon Sep 17 00:00:00 2001 From: Julian Kropff Date: Sun, 26 Apr 2026 16:51:43 +0200 Subject: [PATCH] Fix: Checkstyle --- .../CasinoBrowserController.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/CasinoBrowserController.java b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/CasinoBrowserController.java index e945d45..6a360a3 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/CasinoBrowserController.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/casono/client/ui/gameui/gameuicomponents/CasinoBrowserController.java @@ -192,12 +192,14 @@ public class CasinoBrowserController { WebView webView = new WebView(); WebEngine engine = webView.getEngine(); - engine.locationProperty().addListener((obs, oldUrl, newUrl) -> { - if (isDownloadUrl(newUrl)) { - LOGGER.warn("Download navigation blocked: " + newUrl); - engine.getLoadWorker().cancel(); - } - }); + engine.locationProperty() + .addListener( + (obs, oldUrl, newUrl) -> { + if (isDownloadUrl(newUrl)) { + LOGGER.warn("Download navigation blocked: " + newUrl); + engine.getLoadWorker().cancel(); + } + }); engine.setJavaScriptEnabled(false); @@ -749,7 +751,9 @@ public class CasinoBrowserController { * @return true if the URL is likely a download link, false otherwise */ private static boolean isDownloadUrl(String url) { - if (url == null) return false; + if (url == null) { + return false; + } return url.matches(".*\\.(exe|zip|dmg|msi|apk|jar|pdf)(\\?.*)?$"); }