Buggy code:
public class ExternalEditor { String Cmd ; public ExternalEditor ( ) { } public ExternalEditor ( String EditorCommand ) { } public boolean startExternalEditor ( AbstractEditorController EditCtrl ) throws IOException { MimeHeader myHeader = new MimeHeader ( "text" , "plain" ) ; File tmpFile = TempFileStore . createTempFileWithSuffix ( "extern_edit" ) ; FileWriter FO ; FileReader FI ; try { FO = new FileWriter ( tmpFile ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>needed<seq2seq4repair_space>" + "for<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } try { String M = EditCtrl . getViewText ( ) ; if ( M != null ) { FO . write ( M ) ; } FO . close ( ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>needed<seq2seq4repair_space>" + "for<seq2seq4repair_space>external<seq2seq4repair_space>editor:\n" ) + ( ex . getMessage ( ) ) ) ) ; return false ; } Font OldFont = EditCtrl . getViewFont ( ) ; Font font = FontProperties . getTextFont ( ) ; font = font . deriveFont ( 30 ) ; EditCtrl . setViewFont ( font ) ; EditCtrl . setViewText ( MailResourceLoader . getString ( "menu" , "composer" , "extern_editor_using_msg" ) ) ; <START_BUG> Association association = new AssociationService ( ) . getFileExtensionAssociation ( "txt" ) ; <END_BUG> Action action = association . getActionByVerb ( "edit" ) ; Process child = Runtime . getRuntime ( ) . exec ( ( ( ( action . getCommand ( ) ) + "<seq2seq4repair_space>" ) + ( tmpFile . toString ( ) ) ) ) ; if ( child == null ) { return false ; } try { child . waitFor ( ) ; } catch ( InterruptedException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>External<seq2seq4repair_space>editor<seq2seq4repair_space>exited<seq2seq4repair_space>" + "abnormally." ) ) ; return false ; } EditCtrl . setViewFont ( OldFont ) ; try { FI = new FileReader ( tmpFile ) ; } catch ( FileNotFoundException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>used<seq2seq4repair_space>" + "by<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } char [ ] buf = new char [ 1000 ] ; int i ; String message = "" ; try { while ( ( i = FI . read ( buf ) ) >= 0 ) { message += new String ( buf , 0 , i ) ; } FI . close ( ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( null , ( "Error:<seq2seq4repair_space>Cannot<seq2seq4repair_space>read<seq2seq4repair_space>from<seq2seq4repair_space>temp<seq2seq4repair_space>file<seq2seq4repair_space>used<seq2seq4repair_space>" + "by<seq2seq4repair_space>external<seq2seq4repair_space>editor." ) ) ; return false ; } EditCtrl . setViewText ( message ) ; return true ; } }

Fix:
Association association = new AssociationService ( ) . getMimeTypeAssociation ( "text//plain" ) ;