Buggy code:
public final class DownloadExecutor implements Runnable { private static final Logger log = LoggerFactory . getLogger ( DownloadExecutor . class ) ; private FtpClient client ; private String remoteBackupFileName ; private BackupOps backupOps ; private DownloadExecutor . DownloadListener downloadListener ; private URI endpoint ; private boolean fromRemoteServer = false ; private boolean isGeo = false ; private volatile boolean isCanceled = false ; public DownloadExecutor ( SchedulerConfig cfg , String backupZipFileName , BackupOps backupOps ) { } public DownloadExecutor ( String backupFileName , BackupOps backupOps , URI endpoint ) { } private void registerListener ( ) { } class DownloadListener implements NodeListener { private Thread downloadingThread ; public DownloadListener ( Thread t ) { } @ Override public String getPath ( ) { } @ Override public void nodeChanged ( ) { } private void onRestoreStatusChange ( ) { } @ Override public void connectionStateChanged ( State state ) { } } private void updateDownloadedSize ( long size ) { } @ Override public void run ( ) { } private void pullFromInternalNode ( ) throws Exception { } private void pullFileFromNode ( URI endpoint , String filename ) throws IOException { } private void deleteDownloadedBackup ( ) { } private void pullBackupFilesFromRemoteServer ( ) throws IOException , InterruptedException { } private void postDownload ( ) { BackupRestoreStatus restoreStatus = backupOps . queryBackupRestoreStatus ( remoteBackupFileName , false ) ; DownloadExecutor . log . info ( "In<seq2seq4repair_space>postDownload<seq2seq4repair_space>status={}" , restoreStatus ) ; try { File downloadedDir = backupOps . getDownloadDirectory ( remoteBackupFileName ) ; backupOps . checkBackup ( downloadedDir ) ; List < String > filenames = backupOps . getBackupFileNames ( downloadedDir ) ; backupOps . setBackupFileNames ( remoteBackupFileName , filenames ) ; Map < String , Long > downloadSize = backupOps . getDownloadSize ( remoteBackupFileName ) ; BackupRestoreStatus s = backupOps . queryBackupRestoreStatus ( remoteBackupFileName , false ) ; String localHostName = InetAddress . getLocalHost ( ) . getHostName ( ) ; long size = FileUtils . sizeOfDirectory ( downloadedDir ) ; downloadSize . put ( localHostName , size ) ; s . setSizeToDownload ( downloadSize ) ; <START_BUG> Map < String , Long > downloadedSize = s . getDownoadedSize ( ) ; <END_BUG> s . setDownloadedSize ( localHostName , size ) ; DownloadExecutor . log . info ( "Adjusted<seq2seq4repair_space>whole<seq2seq4repair_space>size={}<seq2seq4repair_space>downloadedSize={}" , downloadSize , downloadedSize ) ; backupOps . persistBackupRestoreStatus ( s , false , true ) ; notifyOtherNodes ( remoteBackupFileName ) ; } catch ( Exception e ) { DownloadExecutor . log . error ( "Invalid<seq2seq4repair_space>backup<seq2seq4repair_space>e=" , e ) ; Status s = Status . DOWNLOAD_FAILED ; backupOps . setRestoreStatus ( remoteBackupFileName , DOWNLOAD_FAILED , e . getMessage ( ) , false ) ; return ; } updateRestoreStatus ( ) ; } private void updateRestoreStatus ( ) { } private void notifyOtherNodes ( String backupName ) { } private boolean isMyBackupFile ( String filename ) throws UnknownHostException { } private void pullBackupFileFromRemoteServer ( File downloadDir , String backupFileName , BufferedInputStream in , byte [ ] buffer ) throws IOException { } private void downloadBackupFile ( File downloadDir , String backupFileName , BufferedInputStream in , byte [ ] buffer ) throws IOException { } private ZipInputStream getDownloadStream ( ) throws IOException { } }

Fix:
Map < String , Long > downloadedSize = s . getDownloadedSize ( ) ;