<commit_before>package fr.menuObjet;

import java.util.*;

public class ListObjet {
    public static void main(String[] args){
        MenuItem menuListe = new MenuListe();
        MenuItem menuAdd = new MenuAdd();
        MenuItem menuRemove = new MenuRemove();

        List<MenuItem> menuItemList = new ArrayList<MenuItem>();
        menuItemList.add(menuListe);
        menuItemList.add(menuAdd);
        menuItemList.add(menuRemove);
        
        System.out.println("Veuillez faire un choix");
        
        for (MenuItem item : menuItemList) 
        	item.printItem();
        
        Scanner sc = new Scanner(System.in);
        int choix = sc.nextInt(); sc.nextLine();
        
        for (MenuItem item : menuItemList) {
        	if (item.compareTo(choix))
        		item.action();
        }
        sc.close();
    }
}
<commit_msg>amélioration du code<commit_after>package fr.menuObjet;

import java.util.*;

public class ListObjet {
    public static void main(String[] args){
        MenuItem menuListe = new MenuListe();
        MenuItem menuAdd = new MenuAdd();
        MenuItem menuRemove = new MenuRemove();
        int choix;
        boolean choixValide = false;
        Scanner sc = new Scanner(System.in);
        List<MenuItem> menuItemList = new ArrayList<MenuItem>();
        
        menuItemList.add(menuListe);
        menuItemList.add(menuAdd);
        menuItemList.add(menuRemove);
        
        
        while (!choixValide) {

            System.out.println("Veuillez faire un choix");
            
	        for (MenuItem item : menuItemList) 
	        	item.printItem();
	        
	        choix = sc.nextInt(); sc.nextLine();
	        
	        for (MenuItem item : menuItemList) {
	        	if (item.compareTo(choix)){
	        		item.action();
	        		choixValide = true;
	        	}
	        }
        }
        sc.close();
    }
}

{'fraction_non_alphanumeric': 0.10727562400424855, 'fraction_numerical': 0.0, 'mean_word_length': 1.9074074074074074, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7584088', 'n_tokens_mistral': 562, 'n_tokens_neox': 540, 'n_words': 122}