Buggy code:
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 ) { } public void setSkipFailedTransfers ( boolean skipFailedTransfers ) { } public void setIgnoreNoncriticalErrors ( boolean ignoreNoncriticalErrors ) { } private void configurationHasBeenSet ( ) { } public void setSystemTypeKey ( FTP . FTPSystemType systemKey ) { } public void setDefaultDateFormatConfig ( String defaultDateFormat ) { } public void setRecentDateFormatConfig ( String recentDateFormat ) { } public void setServerLanguageCodeConfig ( FTP . LanguageCode serverLanguageCode ) { } public void setServerTimeZoneConfig ( String serverTimeZoneId ) { } public void setShortMonthNamesConfig ( String shortMonthNames ) { } public void setRetriesAllowed ( String retriesAllowed ) { } String getSystemTypeKey ( ) { } String getDefaultDateFormatConfig ( ) { } String getRecentDateFormatConfig ( ) { } String getServerLanguageCodeConfig ( ) { } String getServerTimeZoneConfig ( ) { } String getShortMonthNamesConfig ( ) { } FTP . Granularity getTimestampGranularity ( ) { } public void setTimestampGranularity ( FTP . Granularity timestampGranularity ) { } public void setSiteCommand ( String siteCommand ) { } public void setInitialSiteCommand ( String initialCommand ) { } public void setEnableRemoteVerification ( boolean b ) { } protected void checkAttributes ( ) throws BuildException { } protected void executeRetryable ( RetryHandler h , Retryable r , String descr ) throws IOException { } protected int transferFiles ( final 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 { } private long getTimeDiff ( FTPClient ftp ) { } private File findFileName ( FTPClient ftp ) { } 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 { checkAttributes ( ) ; FTPClient ftp = null ; try { log ( ( "Opening<seq2seq4repair_space>FTP<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>" + ( server ) ) , MSG_VERBOSE ) ; ftp = new FTPClient ( ) ; if ( this . isConfigurationSet ) { ftp = FTPConfigurator . configure ( ftp , this ) ; } ftp . setRemoteVerificationEnabled ( enableRemoteVerification ) ; ftp . connect ( server , port ) ; if ( ! ( FTPReply . isPositiveCompletion ( ftp . getReplyCode ( ) ) ) ) { throw new BuildException ( ( "FTP<seq2seq4repair_space>connection<seq2seq4repair_space>failed:<seq2seq4repair_space>" + ( ftp . getReplyString ( ) ) ) ) ; } log ( "connected" , MSG_VERBOSE ) ; log ( "logging<seq2seq4repair_space>in<seq2seq4repair_space>to<seq2seq4repair_space>FTP<seq2seq4repair_space>server" , MSG_VERBOSE ) ; if ( ( ( ( this . account ) != null ) && ( ! ( ftp . login ( userid , password , account ) ) ) ) || ( ( ( this . account ) == null ) && ( ! ( ftp . login ( userid , password ) ) ) ) ) { throw new BuildException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>login<seq2seq4repair_space>to<seq2seq4repair_space>FTP<seq2seq4repair_space>server" ) ; } log ( "login<seq2seq4repair_space>succeeded" , MSG_VERBOSE ) ; if ( binary ) { <START_BUG> ftp . setFileType ( IMAGE_FILE_TYPE ) ; <END_BUG> if ( ! ( FTPReply . isPositiveCompletion ( ftp . getReplyCode ( ) ) ) ) { throw new BuildException ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>transfer<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( ftp . getReplyString ( ) ) ) ) ; } } else { ftp . setFileType ( ASCII_FILE_TYPE ) ; if ( ! ( FTPReply . isPositiveCompletion ( ftp . getReplyCode ( ) ) ) ) { throw new BuildException ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>transfer<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( ftp . getReplyString ( ) ) ) ) ; } } if ( passive ) { log ( "entering<seq2seq4repair_space>passive<seq2seq4repair_space>mode" , MSG_VERBOSE ) ; ftp . enterLocalPassiveMode ( ) ; if ( ! ( FTPReply . isPositiveCompletion ( ftp . getReplyCode ( ) ) ) ) { throw new BuildException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>enter<seq2seq4repair_space>into<seq2seq4repair_space>passive<seq2seq4repair_space>" + "mode:<seq2seq4repair_space>" ) + ( ftp . getReplyString ( ) ) ) ) ; } } if ( ( this . initialSiteCommand ) != null ) { RetryHandler h = new RetryHandler ( this . retriesAllowed , this ) ; final FTPClient lftp = ftp ; executeRetryable ( h , new Retryable ( ) { public void execute ( ) throws IOException { doSiteCommand ( lftp , FTP . this . initialSiteCommand ) ; } } , ( "initial<seq2seq4repair_space>site<seq2seq4repair_space>command:<seq2seq4repair_space>" + ( this . initialSiteCommand ) ) ) ; } if ( ( umask ) != null ) { RetryHandler h = new RetryHandler ( this . retriesAllowed , this ) ; final FTPClient lftp = ftp ; executeRetryable ( h , new Retryable ( ) { public void execute ( ) throws IOException { doSiteCommand ( lftp , ( "umask<seq2seq4repair_space>" + ( umask ) ) ) ; } } , ( "umask<seq2seq4repair_space>" + ( umask ) ) ) ; } if ( ( action ) == ( FTP . MK_DIR ) ) { RetryHandler h = new RetryHandler ( this . retriesAllowed , this ) ; final FTPClient lftp = ftp ;

Fix:
ftp . setFileType ( BINARY_FILE_TYPE ) ;