Fix string validity check

This commit is contained in:
Louis Calas
2019-10-10 09:30:35 +02:00
parent cb5cb37bf0
commit 71e626c054
5 changed files with 78 additions and 55 deletions

View File

@@ -36,7 +36,7 @@ public class GenerateCSV {
int nb = Character.getNumericValue(s.charAt(i));
if (nb <= 0 || nb >= 9) {
if (nb < 0 || nb > 9) {
logger.fatal("Student id's characters are not recognized");
return false;
@@ -72,12 +72,12 @@ public class GenerateCSV {
// Si etudiant HashMap est null, pas ecrit
if (etud != null) {
//if (this.isValid(etud)) {
if (this.isValid(etud)) {
writer.write(etud + ";" + etudiants.get(etud) + System.getProperty("line.separator"));
//}
// else {
// logger.debug("Invalid id not added to csv");
// }
}
else {
logger.debug("Invalid id not added to csv");
}
} else {