Buggy code:
public class Copy extends Task { private File m_file ; private File m_destFile ; private File m_destDir ; private Vector m_filesets = new Vector ( ) ; private boolean m_filtering ; private boolean m_preserveLastModified ; private boolean m_forceOverwrite ; private boolean m_flatten ; private int m_verbosity = Project . MSG_VERBOSE ; private boolean m_includeEmpty = true ; private Hashtable m_fileCopyMap = new Hashtable ( ) ; private Hashtable m_dirCopyMap = new Hashtable ( ) ; private Hashtable m_completeDirMap = new Hashtable ( ) ; private Mapper m_mapperElement ; private Vector m_filterSets = new Vector ( ) ; public void setFile ( final File file ) { } public void setFiltering ( final boolean filtering ) { } public void setFlatten ( final boolean flatten ) { } public void setIncludeEmptyDirs ( final boolean includeEmpty ) { } public void setOverwrite ( final boolean overwrite ) { } public void setPreserveLastModified ( final boolean preserve ) { } public void setTodir ( final File destDir ) { } public void setTofile ( final File destFile ) { } public void setVerbose ( final boolean verbose ) { } public void addFileset ( final FileSet set ) { } public FilterSet createFilterSet ( ) { } public Mapper createMapper ( ) throws TaskException { } public void execute ( ) throws TaskException { } protected Vector getFilterSets ( ) { } protected void buildMap ( final File fromDir , final File toDir , final String [ ] names , final FileNameMapper mapper , final Hashtable map ) throws TaskException { } private String [ ] buildFilenameList ( final String [ ] names , final FileNameMapper mapper , final File fromDir , final File toDir ) throws TaskException { } protected void doFileOperations ( ) throws TaskException { if ( ( m_fileCopyMap . size ( ) ) > 0 ) { getLogger ( ) . info ( ( ( ( ( ( "Copying<seq2seq4repair_space>" + ( m_fileCopyMap . size ( ) ) ) + "<seq2seq4repair_space>file" ) + ( ( m_fileCopyMap . size ( ) ) == 1 ? "" : "s" ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( m_destDir . getAbsolutePath ( ) ) ) ) ; Enumeration e = m_fileCopyMap . keys ( ) ; while ( e . hasMoreElements ( ) ) { String fromFile = ( ( String ) ( e . nextElement ( ) ) ) ; String toFile = ( ( String ) ( m_fileCopyMap . get ( fromFile ) ) ) ; if ( fromFile . equals ( toFile ) ) { getLogger ( ) . info ( ( "Skipping<seq2seq4repair_space>self-copy<seq2seq4repair_space>of<seq2seq4repair_space>" + fromFile ) ) ; continue ; } try { getLogger ( ) . info ( ( ( ( "Copying<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) ) ; final FilterSetCollection executionFilters = buildFilterSet ( ) ; final File src = new File ( fromFile ) ; final File dest = new File ( toFile ) ; if ( m_forceOverwrite ) { FileUtil . forceDelete ( dest ) ; } <START_BUG> FileUtils . newFileUtils ( ) . copyFile ( src , dest , executionFilters ) ; <END_BUG> if ( m_preserveLastModified ) { dest . setLastModified ( src . lastModified ( ) ) ; } } catch ( final IOException ioe ) { final 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 ( m_includeEmpty ) { Enumeration e = m_dirCopyMap . 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 ( ( ( ( ( ( "Copied<seq2seq4repair_space>" + count ) + "<seq2seq4repair_space>empty<seq2seq4repair_space>director" ) + ( count == 1 ? "y" : "ies" ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( m_destDir . getAbsolutePath ( ) ) ) ) ; } } } private FilterSetCollection buildFilterSet ( ) { } protected void scan ( File fromDir , File toDir , String [ ] files , String [ ] dirs ) throws TaskException { } protected void validateAttributes ( ) throws TaskException { } protected Vector getFilesets ( ) { } protected boolean isFiltering ( ) { } protected boolean isForceOverwrite ( ) { } protected int getVerbosity ( ) { } protected boolean isIncludeEmpty ( ) { } protected Hashtable getFileCopyMap ( ) { } protected Hashtable getDirCopyMap ( ) { } protected Hashtable getCompleteDirMap ( ) { } protected File getDestDir ( ) { } protected void setForceOverwrite ( final boolean forceOverwrite ) { } }

Fix:
FileUtils . copyFile ( src , dest , executionFilters ) ;