Program: 21696
Project: 21696
Buggy source:
@Override public void run(){
  LOG.debug("String_Node_Str");
  int delayUntilNextDownload=5;
  TimeUnit timeUnit=TimeUnit.SECONDS;
  final SortedSet<String> availableFilenames=device.getAvailableFilenames();
  if (availableFilenames == null) {
    LOG.debug("String_Node_Str");
    delayUntilNextDownload=1;
    timeUnit=TimeUnit.MINUTES;
  }
 else   if (availableFilenames.isEmpty()) {
    LOG.debug("String_Node_Str");
    delayUntilNextDownload=1;
    timeUnit=TimeUnit.MINUTES;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + availableFilenames.size() + "String_Node_Str");
    }
    for (    final String filename : availableFilenames) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + filename + "String_Node_Str");
      }
      final DataFileStatus fileStatus=dataFileManager.getDataFileStatusOfAnyMatchingFile(filename);
      if (fileStatus == null) {
        if (!downloadFileFromDevice(filename)) {
          delayUntilNextDownload=1;
          timeUnit=TimeUnit.MINUTES;
        }
      }
 else {
switch (fileStatus) {
case WRITING:
          if (LOG.isDebugEnabled()) {
            LOG.debug("String_Node_Str" + filename + "String_Node_Str");
          }
        break;
case DOWNLOADED:
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + filename + "String_Node_Str");
      }
    break;
case UPLOADING:
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + filename + "String_Node_Str");
  }
break;
case UPLOADED:
if (LOG.isDebugEnabled()) {
LOG.debug("String_Node_Str" + filename + "String_Node_Str");
}
eraseFileFromDevice(filename);
break;
case CORRUPT_DATA:
if (LOG.isInfoEnabled()) {
LOG.info("String_Node_Str" + filename + "String_Node_Str");
}
eraseFileFromDevice(filename);
break;
case INCORRECT_CHECKSUM:
if (LOG.isInfoEnabled()) {
LOG.debug("String_Node_Str" + filename + "String_Node_Str");
}
break;
default :
LOG.error("String_Node_Str" + fileStatus + "String_Node_Str");
}
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("String_Node_Str" + delayUntilNextDownload + "String_Node_Str"+ timeUnit+ "String_Node_Str");
}
scheduleNextFileDownload(delayUntilNextDownload,timeUnit);
}

Fixed version (ground truth):
@Override public void run(){
  LOG.debug("String_Node_Str");
  int delayUntilNextDownload=5;
  TimeUnit timeUnit=TimeUnit.SECONDS;
  final SortedSet<String> availableFilenames=device.getAvailableFilenames();
  if (availableFilenames == null) {
    LOG.debug("String_Node_Str");
    delayUntilNextDownload=1;
    timeUnit=TimeUnit.MINUTES;
  }
 else   if (availableFilenames.isEmpty()) {
    LOG.debug("String_Node_Str");
    delayUntilNextDownload=1;
    timeUnit=TimeUnit.MINUTES;
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + availableFilenames.size() + "String_Node_Str");
    }
    for (    final String filename : availableFilenames) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + filename + "String_Node_Str");
      }
      final DataFileManager.ActionToPerformOnDeviceDataFile actionToPerformOnDeviceDataFile=dataFileManager.getActionToPerformOnDeviceDataFile(filename);
switch (actionToPerformOnDeviceDataFile) {
case NO_ACTION:
        if (LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str" + filename + "String_Node_Str");
        }
      break;
case DELETE_FROM_DEVICE:
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + filename + "String_Node_Str");
    }
  deleteFileFromDevice(filename);
break;
case DOWNLOAD_FROM_DEVICE:
if (!downloadFileFromDevice(filename)) {
delayUntilNextDownload=1;
timeUnit=TimeUnit.MINUTES;
}
break;
default :
LOG.error("String_Node_Str" + actionToPerformOnDeviceDataFile + "String_Node_Str");
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("String_Node_Str" + delayUntilNextDownload + "String_Node_Str"+ timeUnit+ "String_Node_Str");
}
scheduleNextFileDownload(delayUntilNextDownload,timeUnit);
}