From 604def2e2c334e1c607c087ce5a96d97facc0cc1 Mon Sep 17 00:00:00 2001 From: Luc Dreibholz <2210544@stud.hs-mannheim.de> Date: Tue, 10 Jan 2023 12:35:51 +0100 Subject: [PATCH] changes generation of random ID --- src/de/hsmannheim/informatik/name/domain/RobotFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/hsmannheim/informatik/name/domain/RobotFactory.java b/src/de/hsmannheim/informatik/name/domain/RobotFactory.java index b163968..cb50e68 100644 --- a/src/de/hsmannheim/informatik/name/domain/RobotFactory.java +++ b/src/de/hsmannheim/informatik/name/domain/RobotFactory.java @@ -49,8 +49,7 @@ public class RobotFactory { case R2D2 -> { int serialNumberR2D2; do { - String temp = String.format("%05d", r.nextInt(10000)); - serialNumberR2D2 = Integer.parseInt(temp); + serialNumberR2D2 = r.nextInt(10000); if (serialNumbersR2D2.size() == 10000) { return null; }