Program: 20861
Project: 20861
Buggy source:
/** 
 * Lädt eine LinkListe
 * @param file Die Datei, aus der die Links gelesen werden
 * @return Ein neuer ArrayList mit den DownloadLinks
 * @throws Exception
 */
@SuppressWarnings("String_Node_Str") private ArrayList<FilePackage> loadDownloadLinks() throws Exception {
  final Object obj=JDUtilities.getDatabaseConnector().getLinks();
  if (obj != null && obj instanceof ArrayList && (((ArrayList)obj).size() == 0 || ((ArrayList)obj).size() > 0 && ((ArrayList)obj).get(0) instanceof FilePackage)) {
    final ArrayList<FilePackage> packages=(ArrayList<FilePackage>)obj;
    final Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    Iterator<DownloadLink> it;
    FilePackage fp;
    while (iterator.hasNext()) {
      fp=iterator.next();
      if (fp.getDownloadLinkList().size() == 0) {
        iterator.remove();
        continue;
      }
      it=fp.getDownloadLinkList().iterator();
      while (it.hasNext()) {
        localLink=it.next();
        localLink.getLinkStatus().resetStatus(LinkStatus.ERROR_ALREADYEXISTS,LinkStatus.ERROR_FILE_NOT_FOUND,LinkStatus.FINISHED,LinkStatus.ERROR_FATAL);
        if (localLink.getLinkStatus().isFinished() && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION,3) == 1) {
          it.remove();
          if (fp.getDownloadLinkList().size() == 0) {
            iterator.remove();
            continue;
          }
        }
 else {
          try {
            pluginForHost=JDUtilities.getNewPluginForHostInstance(localLink.getHost());
          }
 catch (          Exception e) {
            JDLogger.exception(e);
          }
          try {
            if (localLink.getContainer() != null) {
              pluginForContainer=JDUtilities.getPluginForContainer(localLink.getContainer(),localLink.getContainerFile());
              if (pluginForContainer == null) {
                localLink.setEnabled(false);
              }
            }
          }
 catch (          NullPointerException e) {
            JDLogger.exception(e);
          }
          if (pluginForHost != null) {
            localLink.setLoadedPlugin(pluginForHost);
          }
          if (pluginForContainer != null) {
            localLink.setLoadedPluginForContainer(pluginForContainer);
          }
          if (pluginForHost == null) {
            logger.severe("String_Node_Str" + localLink.getHost() + "String_Node_Str"+ localLink.getName());
          }
        }
      }
      fp.resetUpdateTimer();
    }
    return packages;
  }
  throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Lädt eine LinkListe
 * @param file Die Datei, aus der die Links gelesen werden
 * @return Ein neuer ArrayList mit den DownloadLinks
 * @throws Exception
 */
@SuppressWarnings("String_Node_Str") private ArrayList<FilePackage> loadDownloadLinks() throws Exception {
  final Object obj=JDUtilities.getDatabaseConnector().getLinks();
  if (obj != null && obj instanceof ArrayList && (((ArrayList)obj).size() == 0 || ((ArrayList)obj).size() > 0 && ((ArrayList)obj).get(0) instanceof FilePackage)) {
    final ArrayList<FilePackage> packages=(ArrayList<FilePackage>)obj;
    final Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    Iterator<DownloadLink> it;
    FilePackage fp;
    while (iterator.hasNext()) {
      fp=iterator.next();
      if (fp.getDownloadLinkList().size() == 0) {
        iterator.remove();
        continue;
      }
      it=fp.getDownloadLinkList().iterator();
      while (it.hasNext()) {
        localLink=it.next();
        localLink.getLinkStatus().resetStatus(LinkStatus.ERROR_ALREADYEXISTS,LinkStatus.ERROR_FILE_NOT_FOUND,LinkStatus.FINISHED,LinkStatus.ERROR_FATAL);
        if (localLink.getLinkStatus().isFinished() && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION,3) == 1) {
          it.remove();
          if (fp.getDownloadLinkList().size() == 0) {
            iterator.remove();
            continue;
          }
        }
 else {
          try {
            pluginForHost=null;
            pluginForHost=JDUtilities.getNewPluginForHostInstance(localLink.getHost());
          }
 catch (          Exception e) {
            JDLogger.exception(e);
          }
          try {
            if (localLink.getContainer() != null) {
              pluginForContainer=JDUtilities.getPluginForContainer(localLink.getContainer(),localLink.getContainerFile());
              if (pluginForContainer == null) {
                localLink.setEnabled(false);
              }
            }
          }
 catch (          NullPointerException e) {
            JDLogger.exception(e);
          }
          if (pluginForHost != null) {
            localLink.setLoadedPlugin(pluginForHost);
          }
          if (pluginForContainer != null) {
            localLink.setLoadedPluginForContainer(pluginForContainer);
          }
          if (pluginForHost == null) {
            logger.severe("String_Node_Str" + localLink.getHost() + "String_Node_Str"+ localLink.getName());
          }
        }
      }
      fp.resetUpdateTimer();
    }
    return packages;
  }
  throw new Exception("String_Node_Str");
}