Commit 2574b50e authored by Alexander Sommer's avatar Alexander Sommer
Browse files

Remove redundant String initializer

parent 6ee54947
......@@ -44,7 +44,7 @@ public class CaseCreator {
Vector<String> countries = new Vector<>();
for (int i = 0; i < nCountries; i++) {
String country = new String();
String country;
do {
country = randomString("abcdefghijklmnobqrstuvwxyz", 10);
} while (countries.contains(country));
......@@ -55,7 +55,7 @@ public class CaseCreator {
} while (countries.contains(country));
countries.add(country);
String id = new String();
String id;
do {
id = randomString("123456789", 3);
} while (ids.contains(id));
......@@ -70,7 +70,7 @@ public class CaseCreator {
Vector<String> sports = new Vector<>();
for (int i = 0; i < nSports; i++) {
String country = new String();
String country;
do {
country = randomString("abcdefghijklmnobqrstuvwxyz", 6);
} while (sports.contains(country));
......@@ -90,7 +90,7 @@ public class CaseCreator {
for (int s = 0; s < nSports; s++) {
athletes.add(new Vector<>());
for (int a = 0; a < nAthletes; a++) {
String id = new String();
String id;
do {
id = randomString("0123456789", 4);
} while (ids.contains(id) || id.equals("0000"));
......@@ -108,7 +108,7 @@ public class CaseCreator {
int indexAthlete = 2 * random.nextInt(nAthletes);
int medal = random.nextInt(3);
String medalString = new String();
String medalString = "";
if (medal == 0) medalString = "0;1;0";
if (medal == 1) medalString = "1;0;0";
if (medal == 2) medalString = "0;0;1";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment