-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correction #1
base: master
Are you sure you want to change the base?
Correction #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maitrisé. Mécanisme des exceptions bien compris. Quelques optimisations seraient possibles pour simplifier le code et éviter des duplications.
try { | ||
return Double.parseDouble(monDouble); | ||
} catch (NumberFormatException e) { | ||
if (index == 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je te conseille de mettre les {}
même s'il n'y a qu'une instruction
try { | ||
return Integer.parseInt(monInteger); | ||
} catch (NumberFormatException e) { | ||
if (index == 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis pas fan de cette méthode avec des if pour traiter les différents cas, car si tu rajoutes un Integer dans ta ligne, tes index seront potentiellement différents...
private Integer StringToInteger(String valeur, String, propriete) throws BatchException {
try {
return Integer.parseInt(valeur);
} catch (NumberFormatException e) {
throw new BatchException("La propriété " + propriete + " incorrecte : "+valeur+" => "+ligne);
}
}
* @param ligne | ||
* @throws BatchException | ||
*/ | ||
private void checkManager(String ligne) throws BatchException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK pour ça, une méthode plus simple consiste à maintenir une liste de String contenant les matricules des managers contenus dans le fichier en ajoutant chaque matricule du manager au fur et à mesure de la lecture du fichier
(en cours)