Buggy code:
public class ContextMenu { public ContextMenu ( ) { } public static void showContextMenu ( Pane c , ScreensController ctrl ) { final String APP_NAME = ScreensFramework . APP_NAME ; MenuBar mainMenu = new MenuBar ( ) ; c . getChildren ( ) . add ( mainMenu ) ; mainMenu . prefWidthProperty ( ) . bind ( c . widthProperty ( ) ) ; mainMenu . prefHeightProperty ( ) . bind ( c . heightProperty ( ) ) ; Boolean notManager = true ; if ( Context . getInstance ( ) . getUserType ( ) . equals ( managerSistema ) ) { notManager = false ; Menu gestisci = new Menu ( "Gestisci<seq2seq4repair_space>Filiali" ) ; mainMenu . getMenus ( ) . addAll ( gestisci ) ; MenuItem gestisciManager = new MenuItem ( "Gestisci<seq2seq4repair_space>Manager" ) ; gestisci . getItems ( ) . addAll ( gestisciManager ) ; gestisciManager . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( insertManagerID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . insertManagerTitle ) ) ) ; } } ) ; } else if ( Context . getInstance ( ) . getUserType ( ) . equals ( managerFiliale ) ) { Menu gestisci = new Menu ( "Gestisci<seq2seq4repair_space>Filiale" ) ; mainMenu . getMenus ( ) . addAll ( gestisci ) ; MenuItem gestisciAuto = new MenuItem ( "Gestisci<seq2seq4repair_space>Auto" ) ; MenuItem gestisciDipendente = new MenuItem ( "Gestisci<seq2seq4repair_space>Dipendenti" ) ; MenuItem gestisciContratto = new MenuItem ( "Gestisci<seq2seq4repair_space>Contratti" ) ; <START_BUG> MenuItem inserimentoContratto = new MenuItem ( "Inseimento<seq2seq4repair_space>Contratto" ) ; <END_BUG> gestisci . getItems ( ) . addAll ( gestisciAuto , gestisciDipendente , gestisciContratto , inserimentoContratto ) ; gestisciAuto . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( manageAutoID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . manageAutoTitle ) ) ) ; } } ) ; gestisciContratto . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( gestioneContrattoID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . gestioneContrattoTitle ) ) ) ; } } ) ; gestisciDipendente . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( gestioneDipendentiID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . gestioneDipendentiTitle ) ) ) ; } } ) ; inserimentoContratto . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( InserimentoContrattoID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . InserimentoContrattoTitle ) ) ) ; } } ) ; } else if ( Context . getInstance ( ) . getUserType ( ) . equals ( dipendenteFiliale ) ) { Menu gestisci = new Menu ( "Gestisci" ) ; mainMenu . getMenus ( ) . addAll ( gestisci ) ; MenuItem inserimentoContratto = new MenuItem ( "Inserimento<seq2seq4repair_space>Contratto" ) ; gestisci . getItems ( ) . addAll ( inserimentoContratto ) ; inserimentoContratto . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( InserimentoContrattoID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . InserimentoContrattoTitle ) ) ) ; } } ) ; } Menu account = new Menu ( "Account" ) ; mainMenu . getMenus ( ) . addAll ( account ) ; MenuItem disconnetti = new MenuItem ( "Disconnetti" ) ; disconnetti . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( loginID ) ; PRIMARY_STAGE . setTitle ( APP_NAME ) ; ctrl . resetScreens ( ) ; } } ) ; if ( notManager ) { MenuItem editProfile = new MenuItem ( "Dati<seq2seq4repair_space>Personali" ) ; account . getItems ( ) . addAll ( editProfile , disconnetti ) ; editProfile . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent event ) { ctrl . setScreen ( gestioneProfiloID ) ; PRIMARY_STAGE . setTitle ( ( ( APP_NAME + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ScreensFramework . gestioneProfiloTitle ) ) ) ; } } ) ; } else { account . getItems ( ) . addAll ( disconnetti ) ; } } }

Fix:
MenuItem inserimentoContratto = new MenuItem ( "Inserimento<seq2seq4repair_space>Contratto" ) ;