Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors fixed #3

Merged
merged 4 commits into from
Apr 26, 2024
Merged

Errors fixed #3

merged 4 commits into from
Apr 26, 2024

Conversation

Peter200204
Copy link
Owner

I solved all three errors in 3 commits. Please review it to be sure.

@Peter200204 Peter200204 requested a review from davidstvn April 26, 2024 09:19
@Peter200204 Peter200204 self-assigned this Apr 26, 2024
Copy link
Collaborator

@davidstvn davidstvn left a comment

Choose a reason for hiding this comment

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

Mindent jonak talaltam.

@@ -14,6 +14,7 @@ public class TorpedoStore {

private int torpedoCount = 0;

private Random generator = new Random();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ez a random nem jelent kriptografiai kockazatot, mert csak jatektechnikai vonatkozasai vannak, nincs koze szemelyes adatokhoz.

@@ -30,18 +31,18 @@ public TorpedoStore(int numberOfTorpedos){

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

Choose a reason for hiding this comment

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

Ez az elvart viselkedes megfelelo.

double r = generator.nextDouble();

if (r >= FAILURE_RATE) {
// successful firing
this.torpedoCount =- numberOfTorpedos;
this.torpedoCount -= numberOfTorpedos;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Megfelelo javitas, ez az elvart viselkedes.

@davidstvn
Copy link
Collaborator

A valtoztatasok megfeleloek, a random nem tartalmaz security risket.

Copy link
Collaborator

@davidstvn davidstvn left a comment

Choose a reason for hiding this comment

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

Ez nem okoz gondot, a komment megfelelo.

Copy link

sonarcloud bot commented Apr 26, 2024

@Peter200204 Peter200204 merged commit 9609372 into main Apr 26, 2024
3 checks passed
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