Buggy code:
public class VirtualFolder extends AbstractMessageFolder { protected int nextUid ; protected HeaderList headerList ; public VirtualFolder ( FolderItem item , String path ) { } public VirtualFolder ( String name , String type , String path ) { } protected Object generateNextUid ( ) { } public void setNextUid ( int next ) { } public JDialog showFilterDialog ( AbstractMailFrameController frameController ) { } public boolean exists ( Object uid ) throws Exception { } public IHeaderList getHeaderList ( ) throws Exception { } public void addSearchToHistory ( ) throws Exception { VirtualFolder searchFolder = ( ( VirtualFolder ) ( FolderTreeModel . getInstance ( ) . getFolder ( 106 ) ) ) ; if ( ! ( searchFolder . equals ( this ) ) ) { return ; } if ( ( searchFolder . getChildCount ( ) ) >= 10 ) { AbstractMessageFolder child = ( ( AbstractMessageFolder ) ( searchFolder . getChildAt ( 0 ) ) ) ; <START_BUG> child . removeFromParent ( ) ; <END_BUG> } String name = "search<seq2seq4repair_space>result" ; VirtualFolder newFolder = null ; try { newFolder = ( ( VirtualFolder ) ( FolderFactory . getInstance ( ) . createChild ( searchFolder , name , "VirtualFolder" ) ) ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; return ; } if ( newFolder == null ) { return ; } int uid = getConfiguration ( ) . getInteger ( "property" , "source_uid" ) ; boolean includes = getConfiguration ( ) . getBoolean ( "property" , "include_subfolders" ) ; IFolderItem newFolderItem = newFolder . getConfiguration ( ) ; newFolderItem . set ( "property" , "source_uid" , uid ) ; newFolderItem . set ( "property" , "include_subfolders" , includes ) ; newFolderItem . getElement ( "filter" ) . removeFromParent ( ) ; newFolderItem . getRoot ( ) . addElement ( ( ( XmlElement ) ( getConfiguration ( ) . getElement ( "filter" ) . clone ( ) ) ) ) ; MailFilterCriteria newc = new MailFilterCriteria ( new Filter ( getConfiguration ( ) . getElement ( "filter" ) ) . getFilterRule ( ) . get ( 0 ) ) ; StringBuffer buf = new StringBuffer ( ) ; if ( newc . getTypeString ( ) . equalsIgnoreCase ( "flags" ) ) { System . out . println ( "flags<seq2seq4repair_space>found" ) ; buf . append ( newc . getTypeString ( ) ) ; buf . append ( "<seq2seq4repair_space>(" ) ; buf . append ( newc . getCriteriaString ( ) ) ; buf . append ( "<seq2seq4repair_space>" ) ; buf . append ( newc . getPatternString ( ) ) ; buf . append ( ")" ) ; } else if ( newc . getTypeString ( ) . equalsIgnoreCase ( "custom<seq2seq4repair_space>headerfield" ) ) { buf . append ( newc . getHeaderfieldString ( ) ) ; buf . append ( "<seq2seq4repair_space>(" ) ; buf . append ( newc . getCriteriaString ( ) ) ; buf . append ( "<seq2seq4repair_space>" ) ; buf . append ( newc . getPatternString ( ) ) ; buf . append ( ")" ) ; } else { buf . append ( newc . getTypeString ( ) ) ; buf . append ( "<seq2seq4repair_space>(" ) ; buf . append ( newc . getCriteriaString ( ) ) ; buf . append ( "<seq2seq4repair_space>" ) ; buf . append ( newc . getPatternString ( ) ) ; buf . append ( ")" ) ; } newFolder . setName ( buf . toString ( ) ) ; FolderTreeModel . getInstance ( ) . nodeStructureChanged ( searchFolder ) ; FolderTreeModel . getInstance ( ) . nodeChanged ( newFolder ) ; } protected void applySearch ( ) throws Exception { } protected void applySearch ( AbstractMessageFolder parent , Filter filter ) throws Exception { } public DefaultSearchEngine getSearchEngine ( ) { } public Filter getFilter ( ) { } public void add ( ColumbaHeader header , AbstractMessageFolder f , Object uid ) throws Exception { } public void markMessage ( Object [ ] uids , int variant ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public VirtualHeader getVirtualHeader ( Object virtualUid ) { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids ) throws Exception { } public Object [ ] searchMessages ( Filter filter ) throws Exception { } public String getDefaultChild ( ) { } public static XmlElement getDefaultProperties ( ) { } public boolean tryToGetLock ( Object locker ) { } public void releaseLock ( Object locker ) { } public Object [ ] getUids ( ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } public Object getAttribute ( Object uid , String key ) throws Exception { } public Flags getFlags ( Object uid ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public boolean supportsAddMessage ( ) { } public boolean supportsAddFolder ( IMailFolder newFolder ) { } public void innerCopy ( IMailbox destFolder , Object [ ] uids ) { } public void setAttribute ( Object uid , String key , Object value ) throws Exception { } public Attributes getAttributes ( Object uid ) throws Exception { } public Object addMessage ( InputStream in , Attributes attributes , Flags flags ) throws Exception { } public IHeaderListStorage getHeaderListStorage ( ) { } public boolean supportsMove ( ) { } public Header getAllHeaderFields ( Object uid ) throws Exception { } }

Fix:
child . removeFolder ( ) ;