Program: 161618
Project: 161618
Buggy source:
private void download(Intent intent){
  boolean successful=true;
  String action=intent.getStringExtra(Const.ACTION_EXTRA);
  boolean force=intent.getBooleanExtra(Const.FORCE_DOWNLOAD,false);
  boolean launch=intent.getBooleanExtra(Const.APP_LAUNCHES,false);
  if (action == null) {
    return;
  }
  if (NetUtils.isConnected(this) && (launch || !NetUtils.isConnectedMobileData(this))) {
    Log.i(getClass().getSimpleName(),"String_Node_Str" + action + "String_Node_Str");
    try {
      if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
        try {
          downloadNews(force);
        }
 catch (        Exception e) {
          Utils.log(e);
          successful=false;
        }
        try {
          downloadCafeterias(force);
        }
 catch (        Exception e) {
          Utils.log(e);
          successful=false;
        }
        try {
          importLocationsDefaults();
        }
 catch (        Exception e) {
          Utils.log(e);
          successful=false;
        }
        boolean isSetup=Utils.getInternalSettingBool(this,Const.EVERYTHING_SETUP,false);
        if (!isSetup) {
          CacheManager cm=new CacheManager(this);
          cm.syncCalendar();
          if (successful)           Utils.setInternalSetting(this,Const.EVERYTHING_SETUP,true);
        }
      }
 else       if ((action.equals(Const.NEWS))) {
        downloadNews(force);
      }
 else       if ((action.equals(Const.CAFETERIAS))) {
        downloadCafeterias(force);
      }
    }
 catch (    TimeoutException e) {
      Utils.log(e);
      broadcastWarning(getResources().getString(R.string.exception_timeout));
      successful=false;
    }
catch (    IOException e) {
      Utils.log(e);
      broadcastError(getResources().getString(R.string.exception_sdcard));
      successful=false;
    }
catch (    Exception e) {
      Utils.log(e,"String_Node_Str" + action + "String_Node_Str");
      broadcastError(getResources().getString(R.string.exception_unknown));
      successful=false;
    }
  }
  if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
    if (successful) {
      SharedPreferences prefs=getSharedPreferences(Const.INTERNAL_PREFS,0);
      prefs.edit().putLong(LAST_UPDATE,System.currentTimeMillis()).apply();
    }
    CardManager.update(this);
    successful=true;
  }
  if (successful) {
    broadcastDownloadCompleted();
  }
  if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
    startService(new Intent(this,FillCacheService.class));
  }
}

Fixed version (ground truth):
private void download(Intent intent){
  boolean successful=true;
  String action=intent.getStringExtra(Const.ACTION_EXTRA);
  boolean force=intent.getBooleanExtra(Const.FORCE_DOWNLOAD,false);
  boolean launch=intent.getBooleanExtra(Const.APP_LAUNCHES,false);
  if (action == null) {
    return;
  }
  if (NetUtils.isConnected(this) && (launch || !NetUtils.isConnectedMobileData(this))) {
    Log.i(getClass().getSimpleName(),"String_Node_Str" + action + "String_Node_Str");
    try {
      if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
        try {
          downloadNews(force);
        }
 catch (        Exception e) {
          Utils.log(e);
          successful=false;
        }
        try {
          downloadCafeterias(force);
        }
 catch (        Exception e) {
          Utils.log(e);
          successful=false;
        }
        boolean isSetup=Utils.getInternalSettingBool(this,Const.EVERYTHING_SETUP,false);
        if (!isSetup) {
          CacheManager cm=new CacheManager(this);
          cm.syncCalendar();
          if (successful)           Utils.setInternalSetting(this,Const.EVERYTHING_SETUP,true);
        }
      }
 else       if ((action.equals(Const.NEWS))) {
        downloadNews(force);
      }
 else       if ((action.equals(Const.CAFETERIAS))) {
        downloadCafeterias(force);
      }
    }
 catch (    TimeoutException e) {
      Utils.log(e);
      broadcastWarning(getResources().getString(R.string.exception_timeout));
      successful=false;
    }
catch (    IOException e) {
      Utils.log(e);
      broadcastError(getResources().getString(R.string.exception_sdcard));
      successful=false;
    }
catch (    Exception e) {
      Utils.log(e,"String_Node_Str" + action + "String_Node_Str");
      broadcastError(getResources().getString(R.string.exception_unknown));
      successful=false;
    }
  }
 else {
    successful=false;
  }
  if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
    try {
      importLocationsDefaults();
    }
 catch (    Exception e) {
      Utils.log(e);
      successful=false;
    }
    if (successful) {
      SharedPreferences prefs=getSharedPreferences(Const.INTERNAL_PREFS,0);
      prefs.edit().putLong(LAST_UPDATE,System.currentTimeMillis()).apply();
    }
    CardManager.update(this);
    successful=true;
  }
  if (successful) {
    broadcastDownloadCompleted();
  }
  if ((action.equals(Const.DOWNLOAD_ALL_FROM_EXTERNAL))) {
    startService(new Intent(this,FillCacheService.class));
  }
}