Program: 89463
Project: 89463
Buggy source:
@Override public void run(ProgressMonitor monitor) throws ApplicationException {
  try {
    float proWert=100.0f / wertpapiere.length;
    float babysteps=proWert / 5;
    BaseFetcher base;
    for (int i=0; i < wertpapiere.length; i++) {
      if (abort) {
        return;
      }
      GenericObjectSQL wertpapier=wertpapiere[i];
      String wpid=wertpapier.getAttribute("String_Node_Str").toString();
      String searchterm=null;
      if (!wertpapier.isEmpty("String_Node_Str")) {
        searchterm=wertpapier.getAttribute("String_Node_Str").toString();
      }
 else       if (!wertpapier.isEmpty("String_Node_Str")) {
        searchterm=wertpapier.getAttribute("String_Node_Str").toString();
      }
      String anbietername=getAnbieterName(wpid);
      monitor.setPercentComplete((int)(proWert * i));
      monitor.setStatusText("String_Node_Str" + searchterm);
      Logger.info("String_Node_Str" + searchterm);
      if (anbietername == null || forceNewSettings) {
        KursAktualisierenAnbieterAuswahlDialog dialog1=new KursAktualisierenAnbieterAuswahlDialog(KursAktualisierenDialog.POSITION_CENTER,wertpapier.getAttribute("String_Node_Str").toString());
        base=(BaseFetcher)dialog1.open();
        Boolean saveSettings=dialog1.getSpeichernSetting();
        if (saveSettings) {
          doSaveAnbieter(wertpapier.getAttribute("String_Node_Str").toString(),base.getName());
        }
        Date d=new Date();
        base.prepare(searchterm,2000,1,1,d.getYear() + 1900,d.getMonth() + 1,d.getDate());
        while (base.hasMoreConfig()) {
          if (abort) {
            return;
          }
          List<Config> cfg=base.getConfigs();
          monitor.setPercentComplete((int)(monitor.getPercentComplete() + babysteps));
          monitor.setStatusText(cfg.toString());
          KursAktualisierenDialog dialog=new KursAktualisierenDialog(KursAktualisierenDialog.POSITION_CENTER,cfg);
          dialog.open();
          base.process(cfg);
          if (saveSettings) {
            Logger.debug("String_Node_Str" + cfg);
            doSaveSettings(wertpapier.getAttribute("String_Node_Str").toString(),cfg);
          }
        }
      }
 else {
        Logger.debug("String_Node_Str" + anbietername);
        base=null;
        for (        BaseFetcher x : Factory.getHistoryFetcher()) {
          if (anbietername.equals(x.getName())) {
            base=x;
            break;
          }
        }
        if (base == null) {
          Logger.debug("String_Node_Str");
          doCleanSaveSettings(wpid);
          throw new ApplicationException("String_Node_Str");
        }
        Date d=new Date();
        base.prepare(searchterm,2000,1,1,d.getYear() + 1900,d.getMonth() + 1,d.getDate());
        PreparedStatement getCfg=SQLUtils.getPreparedSQL("String_Node_Str");
        getCfg.setString(1,wpid);
        while (base.hasMoreConfig()) {
          if (abort) {
            return;
          }
          List<Config> cfgs=base.getConfigs();
          monitor.setPercentComplete((int)(monitor.getPercentComplete() + babysteps));
          monitor.setStatusText(cfgs.toString());
          for (          Config cfg : cfgs) {
            getCfg.setString(2,cfg.getBeschreibung());
            String ret=(String)SQLUtils.getObject(getCfg);
            Logger.debug("String_Node_Str" + cfg.getBeschreibung() + "String_Node_Str"+ ret);
            if (ret == null) {
              doCleanSaveSettings(wpid);
              Logger.debug("String_Node_Str");
              throw new ApplicationException("String_Node_Str");
            }
            ConfigTuple selected=null;
            for (            ConfigTuple opts : cfg.getOptions()) {
              if (ret.equals(opts.getDescription().toString())) {
                selected=opts;
                break;
              }
            }
            if (selected == null) {
              doCleanSaveSettings(wpid);
              Logger.debug("String_Node_Str");
              throw new ApplicationException("String_Node_Str");
            }
            cfg.addSelectedOptions(selected);
          }
          base.process(cfgs);
        }
      }
      monitor.setPercentComplete((int)(monitor.getPercentComplete() + babysteps));
      monitor.setStatusText("String_Node_Str");
      saveStockData(wertpapier,base);
      monitor.setStatusText("String_Node_Str" + searchterm);
      Application.getMessagingFactory().sendMessage(new KursUpdatesMsg(wpid));
    }
  }
 catch (  ApplicationException e) {
    monitor.setStatus(ProgressMonitor.STATUS_ERROR);
    monitor.setStatusText(e.getMessage());
    e.printStackTrace();
    throw e;
  }
catch (  Exception e) {
    monitor.setStatus(ProgressMonitor.STATUS_ERROR);
    monitor.setStatusText(e.getMessage());
    e.printStackTrace();
    throw new ApplicationException("String_Node_Str",e);
  }
  monitor.setStatusText("String_Node_Str");
  monitor.setStatus(ProgressMonitor.STATUS_DONE);
  monitor.setPercentComplete(101);
}

Fixed version (ground truth):
@Override public void run(ProgressMonitor monitor) throws ApplicationException {
  try {
    float proWert=100.0f / wertpapiere.length;
    float babysteps=proWert / 5;
    for (int i=0; i < wertpapiere.length; i++) {
      if (abort) {
        return;
      }
      GenericObjectSQL wertpapier=wertpapiere[i];
      String wpid=wertpapier.getAttribute("String_Node_Str").toString();
      String searchterm=getSearchTerm(wertpapier);
      String anbietername=getAnbieterName(wpid);
      monitor.setPercentComplete((int)(proWert * i));
      monitor.setStatusText("String_Node_Str" + searchterm);
      Logger.info("String_Node_Str" + searchterm);
      BaseFetcher base;
      boolean manualWay=(anbietername == null || forceNewSettings);
      if (manualWay) {
        base=updateStock(monitor,babysteps,wertpapier,searchterm);
      }
 else {
        base=updateStockAutomatic(anbietername,monitor,babysteps,wertpapier,searchterm,wpid);
      }
      monitor.setPercentComplete((int)(monitor.getPercentComplete() + babysteps));
      monitor.setStatusText("String_Node_Str");
      saveStockData(wertpapier,base);
      monitor.setStatusText("String_Node_Str" + searchterm);
      Application.getMessagingFactory().sendMessage(new KursUpdatesMsg(wpid));
    }
  }
 catch (  ApplicationException e) {
    monitor.setStatus(ProgressMonitor.STATUS_ERROR);
    monitor.setStatusText(e.getMessage());
    e.printStackTrace();
    throw e;
  }
catch (  Exception e) {
    monitor.setStatus(ProgressMonitor.STATUS_ERROR);
    monitor.setStatusText(e.getMessage());
    e.printStackTrace();
    throw new ApplicationException("String_Node_Str",e);
  }
  monitor.setStatusText("String_Node_Str");
  monitor.setStatus(ProgressMonitor.STATUS_DONE);
  monitor.setPercentComplete(101);
}