Buggy code:
public class Move extends Copy { public Move ( ) { } protected void deleteDir ( File d ) throws TaskException { } protected void doFileOperations ( ) throws TaskException { if ( ( getCompleteDirMap ( ) . size ( ) ) > 0 ) { Enumeration e = getCompleteDirMap ( ) . keys ( ) ; while ( e . hasMoreElements ( ) ) { File fromDir = ( ( File ) ( e . nextElement ( ) ) ) ; File toDir = ( ( File ) ( getCompleteDirMap ( ) . get ( fromDir ) ) ) ; try { log ( ( ( ( "Attempting<seq2seq4repair_space>to<seq2seq4repair_space>rename<seq2seq4repair_space>dir:<seq2seq4repair_space>" + fromDir ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toDir ) , getVerbosity ( ) ) ; renameFile ( fromDir , toDir , isFiltering ( ) , isForceOverwrite ( ) ) ; } catch ( IOException ioe ) { String msg = ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>rename<seq2seq4repair_space>dir<seq2seq4repair_space>" + fromDir ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toDir ) + "<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg , ioe ) ; } } } if ( ( getFileCopyMap ( ) . size ( ) ) > 0 ) { getLogger ( ) . info ( ( ( ( "Moving<seq2seq4repair_space>" + ( getFileCopyMap ( ) . size ( ) ) ) + "<seq2seq4repair_space>files<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( getDestDir ( ) . getAbsolutePath ( ) ) ) ) ; Enumeration e = getFileCopyMap ( ) . keys ( ) ; while ( e . hasMoreElements ( ) ) { String fromFile = ( ( String ) ( e . nextElement ( ) ) ) ; String toFile = ( ( String ) ( getFileCopyMap ( ) . get ( fromFile ) ) ) ; if ( fromFile . equals ( toFile ) ) { log ( ( "Skipping<seq2seq4repair_space>self-move<seq2seq4repair_space>of<seq2seq4repair_space>" + fromFile ) , getVerbosity ( ) ) ; continue ; } boolean moved = false ; File f = new File ( fromFile ) ; if ( f . exists ( ) ) { File d = new File ( toFile ) ; try { log ( ( ( ( "Attempting<seq2seq4repair_space>to<seq2seq4repair_space>rename:<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) , getVerbosity ( ) ) ; moved = renameFile ( f , d , isFiltering ( ) , isForceOverwrite ( ) ) ; } catch ( IOException ioe ) { String msg = ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>rename<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) + "<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg , ioe ) ; } if ( ! moved ) { try { log ( ( ( ( "Moving<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) , getVerbosity ( ) ) ; FilterSetCollection executionFilters = new FilterSetCollection ( ) ; if ( isFiltering ( ) ) { executionFilters . addFilterSet ( project . getGlobalFilterSet ( ) ) ; } for ( Enumeration filterEnum = getFilterSets ( ) . elements ( ) ; filterEnum . hasMoreElements ( ) ; ) { executionFilters . addFilterSet ( ( ( FilterSet ) ( filterEnum . nextElement ( ) ) ) ) ; } if ( isForceOverwrite ( ) ) { FileUtil . forceDelete ( d ) ; } <START_BUG> FileUtils . newFileUtils ( ) . copyFile ( f , d , executionFilters ) ; <END_BUG> f = new File ( fromFile ) ; if ( ! ( f . delete ( ) ) ) { throw new TaskException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>file<seq2seq4repair_space>" + ( f . getAbsolutePath ( ) ) ) ) ; } } catch ( IOException ioe ) { String msg = ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>copy<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) + "<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new TaskException ( msg , ioe ) ; } } } } } if ( isIncludeEmpty ( ) ) { Enumeration e = getDirCopyMap ( ) . elements ( ) ; int count = 0 ; while ( e . hasMoreElements ( ) ) { File d = new File ( ( ( String ) ( e . nextElement ( ) ) ) ) ; if ( ! ( d . exists ( ) ) ) { if ( ! ( d . mkdirs ( ) ) ) { log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( d . getAbsolutePath ( ) ) ) , MSG_ERR ) ; } else { count ++ ; } } } if ( count > 0 ) { getLogger ( ) . info ( ( ( ( "Moved<seq2seq4repair_space>" + count ) + "<seq2seq4repair_space>empty<seq2seq4repair_space>directories<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( getDestDir ( ) . getAbsolutePath ( ) ) ) ) ; } } if ( ( getFilesets ( ) . size ( ) ) > 0 ) { Enumeration e = getFilesets ( ) . elements ( ) ; while ( e . hasMoreElements ( ) ) { FileSet fs = ( ( FileSet ) ( e . nextElement ( ) ) ) ; File dir = fs . getDir ( project ) ; if ( okToDelete ( dir ) ) { deleteDir ( dir ) ; } } } } protected boolean okToDelete ( File d ) { } protected boolean renameFile ( File sourceFile , File destFile , boolean filtering , boolean overwrite ) throws IOException , TaskException { } }

Fix:
FileUtils . copyFile ( f , d , executionFilters ) ;