Skip to content

Bugfix - #1

Open
WingerATB wants to merge 4 commits into
mainfrom
bugfix
Open

WingerATB wants to merge 4 commits into
mainfrom
bugfix

Conversation

@WingerATB

Copy link
Copy Markdown
Owner

A SonarQube által jelzett három hiba javítása a TorpedoStore.java fájlban: az IllegalArgumentException most már eldobásra kerül, a hibás =- operátort -= operátorra cseréltem, így a torpedók száma helyesen csökken, a Random objektumot pedig mezőként újrahasználom ahelyett, hogy minden fire() hívásnál új jönne létre.

@WingerATB WingerATB self-assigned this Oct 21, 2026

public boolean fire(int numberOfTorpedos){
if(numberOfTorpedos < 1 || numberOfTorpedos > this.torpedoCount){
new IllegalArgumentException("numberOfTorpedos");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sadfgasdgasdg

boolean success = false;

// simulate random overheating of the launcher bay which prevents firing
Random generator = new Random();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fdgdfgdfgsdg

@github-actions

Copy link
Copy Markdown

PgUBEQABLjI2Sh0CRAAOFA==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants