File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/ldbc/snb/datagen/generator/generators Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,14 @@ private Person generatePerson() {
151
151
base = base .replaceAll ("\\ p{InCombiningDiacriticalMarks}+" , "" );
152
152
base = base .replaceAll (" " , "." );
153
153
base = base .replaceAll ("[.]+" , "." );
154
- for ( int i = 0 ; i < numEmails ; i ++ ) {
154
+ while ( person . getEmails (). size () < numEmails ) {
155
155
String email = base + "" + person .getAccountId () + "@" +
156
156
Dictionaries .emails .getRandomEmail (randomFarm .get (RandomGeneratorFarm .Aspect .TOP_EMAIL ),
157
157
randomFarm .get (RandomGeneratorFarm .Aspect .EMAIL ));
158
- person .getEmails ().add (email );
158
+ // avoid duplicates
159
+ if (!person .getEmails ().contains (email )) {
160
+ person .getEmails ().add (email );
161
+ }
159
162
}
160
163
161
164
// Set class year
You can’t perform that action at this time.
0 commit comments