Buggy code:
public DrUtil getDrUtil ( ) { } public void setDrUtil ( DrUtil drUtil ) { } private void checkOnStandby ( ) { } BackupOps ( ) { } public void setServiceUrl ( String serviceUrl ) { } void setHosts ( Map < String , String > hosts ) { } private String normalizeDualInetAddress ( DualInetAddress host ) { } private CoordinatorClientInetAddressMap getInetAddressLookupMap ( ) { } public Map < String , String > getHosts ( ) { } private synchronized Map < String , String > initHosts ( ) { } @ SuppressWarnings ( "findbugs:IS2_INCONSISTENT_SYNC" ) private Map < String , String > getHostsWithDualInetAddrs ( ) { } private synchronized Map < String , String > initDualAddrHosts ( ) { } public int getQuorumSize ( ) { } public void setPorts ( List < Integer > ports ) { } public void setCoordinatorClient ( CoordinatorClient coordinatorClient ) { } public List < String > getVdcList ( ) { } public void setVdcList ( List < String > vdcList ) { } public File getBackupDir ( ) { } public void setBackupDir ( File backupDir ) { } public File getDownloadDirectory ( String remoteBackupFilename ) { } public Map < String , Long > getInternalDownloadSize ( String backupName ) { } public void createBackup ( String backupTag ) { } public void createBackup ( String backupTag , boolean force ) { } public void checkBackup ( File backupFolder ) throws Exception { } public List < URI > getOtherNodes ( ) throws URISyntaxException , UnknownHostException { } public URI getMyURI ( ) throws URISyntaxException , UnknownHostException { } public List < String > getBackupFileNames ( File backupFolder ) throws URISyntaxException , UnknownHostException { } private String toHostName ( String nodeName ) { } private boolean belongToNode ( File file , String nodeName ) { } private File [ ] getBackupFiles ( File backupFolder ) { } private void checkBackup ( File propertyInfoFile , boolean isGeo ) throws Exception { } public boolean shouldHaveBackupData ( ) { } public void addRestoreListener ( NodeListener listener ) throws Exception { } public void removeRestoreListener ( NodeListener listener ) throws Exception { } public BackupRestoreStatus queryBackupRestoreStatus ( String backupName , boolean isLocal ) { } public String getBackupConfigKind ( boolean isLocal ) { } public String getBackupConfigPrefix ( ) { } public void clearCurrentBackupInfo ( ) { } public void persistCurrentBackupInfo ( String backupName , boolean isLocal ) { } public String getCurrentBackupName ( ) { } private Map < String , String > getCurrentBackupInfo ( ) { } public void setDownloadSize ( String backupName , Map < String , Long > size ) { } public void setBackupFileNames ( String backupName , List < String > filenames ) { } public void setRestoreStatus ( String backupName , BackupRestoreStatus . Status s , String details , boolean increaseCompleteNumber ) { } public void updateDownloadSize ( String backupName , long size ) { } public void updateRestoreStatus ( String backupName , BackupRestoreStatus . Status status , String details , Map < String , Long > downloadSize , long increasedSize , boolean increaseCompletedNodeNumber , List < String > backupfileNames , boolean doLog ) { } public void persistBackupRestoreStatus ( BackupRestoreStatus status , boolean isLocal , boolean doLog ) { } public synchronized void setGeoFlag ( String backupName , boolean isLocal ) { } private void checkMD5 ( File file ) { } public boolean isGeoBackup ( String backupFileName ) { } public void cancelDownload ( ) { Map < String , String > map = getCurrentBackupInfo ( ) ; BackupOps . log . info ( "To<seq2seq4repair_space>cancel<seq2seq4repair_space>current<seq2seq4repair_space>download<seq2seq4repair_space>{}" , map ) ; String backupName = map . get ( CURRENT_DOWNLOADING_BACKUP_NAME_KEY ) ; boolean isLocal = Boolean . parseBoolean ( map . get ( CURRENT_DOWNLOADING_BACKUP_ISLOCAL_KEY ) ) ; if ( backupName . isEmpty ( ) ) { BackupOps . log . info ( "No<seq2seq4repair_space>backup<seq2seq4repair_space>is<seq2seq4repair_space>downloading,<seq2seq4repair_space>so<seq2seq4repair_space>ignore<seq2seq4repair_space>cancel" ) ; return ; } BackupRestoreStatus s = queryBackupRestoreStatus ( backupName , isLocal ) ; if ( ! ( s . getStatus ( ) . canBeCanceled ( ) ) ) { BackupOps . log . info ( "The<seq2seq4repair_space>current<seq2seq4repair_space>backup<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>canceled<seq2seq4repair_space>because<seq2seq4repair_space>its<seq2seq4repair_space>status<seq2seq4repair_space>is<seq2seq4repair_space>{}" , s ) ; return ; } if ( ! isLocal ) { <START_BUG> setRestoreStatus ( backupName , DOWNLOAD_CANCELLED , "Download<seq2seq4repair_space>canceled" , false ) ; <END_BUG> BackupOps . log . info ( "Persist<seq2seq4repair_space>the<seq2seq4repair_space>cancel<seq2seq4repair_space>flag<seq2seq4repair_space>into<seq2seq4repair_space>ZK" ) ; } } public File getBackupDir ( String backupName , boolean isLocal ) { } class CreateBackupCallable extends BackupCallable < Void > { @ Override public Void sendRequest ( ) throws Exception { } } private void createBackupWithoutLock ( String backupTag , boolean force ) { } private boolean checkCreateResult ( String backupTag , List < String > errorList , boolean force ) { } public static synchronized String createBackupName ( ) { } private void validateBackupName ( String backupTag ) { } private boolean isValidLinuxFileName ( String fileName ) { } private void createBackupFromNode ( String backupTag , String host , int port ) throws IOException { } private boolean ignoreError ( Throwable error ) { } private void persistBackupInfo ( String backupTag ) { } private String getCurrentVersion ( ) throws Exception { } private void precheckForCreation ( String backupTag ) { } private int getCurrentManualBackupNumber ( ) { } private int getMaxManualBackupNumber ( ) { } public static boolean isScheduledBackupTag ( String tag ) { } public void deleteBackup ( String backupTag ) { } class DeleteBackupCallable extends BackupCallable < Void > { @ Override public Void sendRequest ( ) throws Exception { } } private void deleteBackupWithoutLock ( final String backupTag , final boolean ignore ) { } private void deleteBackupFromNode ( String backupTag , String host , int port ) { } public boolean isDownloadInProgress ( ) { } public boolean isDownloadComplete ( String backupName ) { } private String getMyDownloadingZKPath ( ) { } public void registerDownloader ( ) throws Exception { } public void unregisterDownloader ( ) throws Exception { } private String getDownloadOwnerPath ( ) { }

Fix:
setRestoreStatus ( backupName , DOWNLOAD_CANCELLED , null , false ) ;