Duplicated code for check if lobby exists #121

Closed
opened 2026-04-22 12:32:14 +02:00 by lars.winzer · 2 comments
lars.winzer commented 2026-04-22 12:32:14 +02:00 (Migrated from git.scicore.unibas.ch)

Bug Report

Environment

  • Branch & Commit: main - 028c3adb0d
  • Operating system: Not applicable
  • How was execution started (Gradle task / IDE debug / IDE run): Not applicable
  • Java version: 25
  • Gradle version: 9.3.1

Summary

The check for if the lobby exists

Expected Behavior

A pre-execution check should be used.

Actual Behavior

The code is duplicated across multiple CommandHandler in the following files:

Steps to Reproduce

Not applicable

Stack Trace / Error Message

Not applicable

Possible Cause / Notes

Not applicable

Checklist

  • I reproduced the problem using the steps above
  • I searched documentation for relevant information
  • I added relevant labels
## Bug Report <!--The reccommended type is: Issue--> ### Environment - **Branch & Commit:** main - 028c3adb0d9bc6292fa5f6aba155704b303fc46e - **Operating system:** Not applicable - **How was execution started (Gradle task / IDE debug / IDE run):** Not applicable - **Java version:** `25` - **Gradle version**: `9.3.1` ### Summary The check for if the lobby exists ### Expected Behavior A pre-execution check should be used. ### Actual Behavior The code is duplicated across multiple `CommandHandler` in the following files: * [PlayerBetHandler](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/blob/main/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/game/bet/PlayerBetHandler.java#L77-88) * [PlayerCallHandler](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/blob/main/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/game/call/PlayerCallHandler.java#L65-76) * [PlayerFoldHandler](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/blob/main/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/game/fold/PlayerFoldHandler.java#L65-76) * [PlayerRaiseHandler](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/blob/main/src/main/java/ch/unibas/dmi/dbis/cs108/casono/server/app/commands/game/raise/PlayerRaiseHandler.java#L79-90) ### Steps to Reproduce Not applicable ### Stack Trace / Error Message ``` Not applicable ``` ### Possible Cause / Notes Not applicable ### Checklist - [x] I reproduced the problem using the steps above - [x] I searched documentation for relevant information - [x] I added relevant labels
lars.winzer commented 2026-04-22 12:32:14 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @jona.walpert

assigned to @jona.walpert
jona.walpert (Migrated from git.scicore.unibas.ch) closed this issue 2026-04-24 13:28:14 +02:00
jona.walpert commented 2026-04-24 13:28:15 +02:00 (Migrated from git.scicore.unibas.ch)

Closed with !146

Closed with [!146](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/merge_requests/146)
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#121