Jean-Francois Leveque

Élimination des multiples de l'ajout dans la liste des utilisateurs.

......@@ -62,8 +62,12 @@ public class ProcessingRunner implements ApplicationRunner {
try {
in = new FileReader(dataDir+sampleFilename);
Iterable<CSVRecord> records = CSVFormat.TDF.withFirstRecordAsHeader().parse(in);
Long tmpLong;
for (CSVRecord record : records) {
userIds.add(Long.parseLong(record.get("userId")));
tmpLong = Long.parseLong(record.get("userId"));
if (! userIds.contains(tmpLong)) {
userIds.add(tmpLong);
}
}
} catch (FileNotFoundException e) {
throw new ProcessingException("sample file not found " + dataDir + sampleFilename, e);
......@@ -71,6 +75,7 @@ public class ProcessingRunner implements ApplicationRunner {
throw new ProcessingException("Can't read user ids from sample file " + dataDir + sampleFilename, e);
}
logger.trace("Nombre d'utilisateurs : {}", userIds.size());
return userIds;
}
......