From 361fd0939cf536d45c91d985a1396be58f2c0c81 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 1 Jun 2026 15:25:01 +0200 Subject: [PATCH] refactor(app): drop dead newSession param, unused import, restore main javadoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unused `saves` parameter from `newSession(GameIO, SaveService)` → signature is now `newSession(GameIO)`, call site updated accordingly - Remove unused `import thb.jeanluc.adventure.menu.MenuAction` (switch uses unqualified constants; import was dead, compile confirmed clean) - Restore `/** Standard JVM entry point. @param args ignored */` Javadoc on `main` and restore full log message "Fatal error during game startup" Co-Authored-By: Claude Sonnet 4.6 --- .../src/main/java/thb/jeanluc/adventure/App.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java index e20b232..8444308 100644 --- a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java +++ b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java @@ -26,7 +26,6 @@ import thb.jeanluc.adventure.io.GameIO; import thb.jeanluc.adventure.io.text.Banner; import thb.jeanluc.adventure.loader.WorldLoader; import thb.jeanluc.adventure.menu.MainMenu; -import thb.jeanluc.adventure.menu.MenuAction; import thb.jeanluc.adventure.menu.SettingsMenu; import thb.jeanluc.adventure.save.SaveException; import thb.jeanluc.adventure.save.SaveService; @@ -48,12 +47,13 @@ public final class App { private App() { } + /** Standard JVM entry point. @param args ignored */ public static void main(String[] args) { GameIO io = new ConsoleIO(); try { run(io); } catch (RuntimeException e) { - log.error("Fatal error", e); + log.error("Fatal error during game startup", e); io.write("Fatal error: " + e.getMessage()); System.exit(1); } @@ -70,7 +70,7 @@ public final class App { boolean running = true; while (running) { switch (MainMenu.show(io)) { - case NEW_GAME -> play(io, saves, newSession(io, saves)); + case NEW_GAME -> play(io, saves, newSession(io)); case LOAD -> { SaveSlotInfo slot = MainMenu.pickSlot(io, saves); if (slot != null) { @@ -89,7 +89,7 @@ public final class App { } /** Loads a fresh world and binds it to a newly named session. */ - private static GameSession newSession(GameIO io, SaveService saves) { + private static GameSession newSession(GameIO io) { WorldLoader.LoadResult loaded = new WorldLoader().load(); String name = MainMenu.promptName(io, "Manor"); return new GameSession(loaded.world(), loaded.player(), name);