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 { final String message = ( ( "Attempting<seq2seq4repair_space>to<seq2seq4repair_space>rename<seq2seq4repair_space>dir:<seq2seq4repair_space>" + fromDir ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toDir ; getLogger ( ) . debug ( message ) ; renameFile ( fromDir , toDir , isFiltering ( ) , isForceOverwrite ( ) ) ; } catch ( final IOException ioe ) { final 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 ) ) { getLogger ( ) . debug ( ( "Skipping<seq2seq4repair_space>self-move<seq2seq4repair_space>of<seq2seq4repair_space>" + fromFile ) ) ; continue ; } boolean moved = false ; File f = new File ( fromFile ) ; if ( f . exists ( ) ) { File d = new File ( toFile ) ; try { final String message = ( ( "Attempting<seq2seq4repair_space>to<seq2seq4repair_space>rename:<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ; getLogger ( ) . debug ( message ) ; moved = renameFile ( f , d , isFiltering ( ) , isForceOverwrite ( ) ) ; } catch ( IOException ioe ) { final 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 { getLogger ( ) . debug ( ( ( ( "Moving<seq2seq4repair_space>" + fromFile ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + toFile ) ) ; final FilterSetCollection executionFilters = buildFilterSet ( ) ; if ( isForceOverwrite ( ) ) { FileUtil . forceDelete ( d ) ; } FileUtils . copyFile ( f , d , executionFilters ) ; 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 ( ) ) ) { getLogger ( ) . error ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( d . getAbsolutePath ( ) ) ) ) ; } 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 ) { Iterator e = getFilesets ( ) . iterator ( ) ; while ( e . hasNext ( ) ) { FileSet fs = ( ( FileSet ) ( e . next ( ) ) ) ; <START_BUG> File dir = fs . getDir ( getProject ( ) ) ; <END_BUG> 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:
File dir = fs . getDir ( ) ;