Buggy code:
private boolean newerOnly = false ; private int action = FTP . SEND_FILES ; private Vector filesets = new Vector ( ) ; private Vector dirCache = new Vector ( ) ; private int transferred = 0 ; private String remoteFileSep = "//" ; private int port = 21 ; private boolean skipFailedTransfers = false ; private int skipped = 0 ; private boolean ignoreNoncriticalErrors = false ; private boolean preserveLastModified = false ; private String chmod = null ; private String umask = null ; private FileUtils fileUtils = FileUtils . newFileUtils ( ) ; protected static final String [ ] ACTION_STRS = new String [ ] { "sending" , "getting" , "deleting" , "listing" , "making<seq2seq4repair_space>directory" , "chmod" , "removing" } ; protected static final String [ ] COMPLETED_ACTION_STRS = new String [ ] { "sent" , "retrieved" , "deleted" , "listed" , "created<seq2seq4repair_space>directory" , "mode<seq2seq4repair_space>changed" , "removed" } ; protected static final String [ ] ACTION_TARGET_STRS = new String [ ] { "files" , "files" , "files" , "files" , "directory" , "files" , "directories" } ; protected class FTPDirectoryScanner extends DirectoryScanner { protected FTPClient ftp = null ; public FTPDirectoryScanner ( FTPClient ftp ) { } public void scan ( ) { } protected void scandir ( String dir , String vpath , boolean fast ) { } } public void setRemotedir ( String dir ) { } public void setServer ( String server ) { } public void setPort ( int port ) { } public void setUserid ( String userid ) { } public void setPassword ( String password ) { } public void setBinary ( boolean binary ) { } public void setPassive ( boolean passive ) { } public void setVerbose ( boolean verbose ) { } public void setNewer ( boolean newer ) { } public void setPreserveLastModified ( boolean preserveLastModified ) { } public void setDepends ( boolean depends ) { } public void setSeparator ( String separator ) { } public void setChmod ( String theMode ) { } public void setUmask ( String theUmask ) { } public void addFileset ( FileSet set ) { } public void setAction ( String action ) throws BuildException { } public void setAction ( FTP . Action action ) throws BuildException { } public void setListing ( File listing ) throws BuildException { } public void setSkipFailedTransfers ( boolean skipFailedTransfers ) { } public void setIgnoreNoncriticalErrors ( boolean ignoreNoncriticalErrors ) { } protected void checkConfiguration ( ) throws BuildException { } protected int transferFiles ( FTPClient ftp , FileSet fs ) throws IOException , BuildException { } protected void transferFiles ( FTPClient ftp ) throws IOException , BuildException { } protected String resolveFile ( String file ) { } protected void createParents ( FTPClient ftp , String filename ) throws IOException , BuildException { File dir = new File ( filename ) ; if ( dirCache . contains ( dir ) ) { return ; } Vector parents = new Vector ( ) ; String dirname ; while ( ( dirname = dir . getParent ( ) ) != null ) { File checkDir = new File ( dirname ) ; if ( dirCache . contains ( checkDir ) ) { break ; } dir = checkDir ; parents . addElement ( dir ) ; } int i = ( parents . size ( ) ) - 1 ; if ( i >= 0 ) { String cwd = ftp . printWorkingDirectory ( ) ; String parent = dir . getParent ( ) ; if ( parent != null ) { <START_BUG> if ( ! ( ftp . changeWorkingDirectory ( parent ) ) ) { <END_BUG> throw new BuildException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>change<seq2seq4repair_space>to<seq2seq4repair_space>" + "directory:<seq2seq4repair_space>" ) + ( ftp . getReplyString ( ) ) ) ) ; } } while ( i >= 0 ) { dir = ( ( File ) ( parents . elementAt ( ( i -- ) ) ) ) ; if ( ! ( ftp . changeWorkingDirectory ( dir . getName ( ) ) ) ) { log ( ( "creating<seq2seq4repair_space>remote<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( resolveFile ( dir . getPath ( ) ) ) ) , MSG_VERBOSE ) ; if ( ! ( ftp . makeDirectory ( dir . getName ( ) ) ) ) { handleMkDirFailure ( ftp ) ; } if ( ! ( ftp . changeWorkingDirectory ( dir . getName ( ) ) ) ) { throw new BuildException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>change<seq2seq4repair_space>to<seq2seq4repair_space>" + "directory:<seq2seq4repair_space>" ) + ( ftp . getReplyString ( ) ) ) ) ; } } dirCache . addElement ( dir ) ; } ftp . changeWorkingDirectory ( cwd ) ; } } protected boolean isUpToDate ( FTPClient ftp , File localFile , String remoteFile ) throws IOException , BuildException { } protected void doSiteCommand ( FTPClient ftp , String TheCMD ) throws IOException , BuildException { } protected void sendFile ( FTPClient ftp , String dir , String filename ) throws IOException , BuildException { } protected void delFile ( FTPClient ftp , String filename ) throws IOException , BuildException { } protected void rmDir ( FTPClient ftp , String dirname ) throws IOException , BuildException { } protected void getFile ( FTPClient ftp , String dir , String filename ) throws IOException , BuildException { } protected void listFile ( FTPClient ftp , BufferedWriter bw , String filename ) throws IOException , BuildException { } protected void makeRemoteDir ( FTPClient ftp , String dir ) throws IOException , BuildException { } private void handleMkDirFailure ( FTPClient ftp ) throws BuildException { } public void execute ( ) throws BuildException { } public static class Action extends EnumeratedAttribute { private static final String [ ] validActions = new String [ ] { "send" , "put" , "recv" , "get" , "del" , "delete" , "list" , "mkdir" , "chmod" , "rmdir" } ; public String [ ] getValues ( ) { } public int getAction ( ) { } } }

Fix:
if ( ! ( ftp . changeWorkingDirectory ( resolveFile ( parent ) ) ) ) {