Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Correction #1

wants to merge 4 commits into from

Conversation

pjvilloud
Copy link

(en cours)

Copy link
Author

@pjvilloud pjvilloud left a 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)
Copy link
Author

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)
Copy link
Author

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 {
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants