Program: 21081
Project: 21081
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 {
  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)) {
    ArrayList<FilePackage> packages=(ArrayList<FilePackage>)obj;
    Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    String tmp2=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();
        if (!localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
          tmp2=localLink.getLinkStatus().getErrorMessage();
          localLink.getLinkStatus().reset();
          localLink.getLinkStatus().setErrorMessage(tmp2);
        }
        if (localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED) && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION) == 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());
          }
        }
      }
    }
    return packages;
  }
 else   if (obj != null && obj instanceof Vector && (((Vector)obj).size() == 0 || ((Vector)obj).size() > 0 && ((Vector)obj).get(0) instanceof FilePackage)) {
    Vector<FilePackage> packages=(Vector<FilePackage>)obj;
    ArrayList<FilePackage> convert=new ArrayList<FilePackage>();
    Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    String tmp1=null;
    String tmp2=null;
    Iterator<DownloadLink> it;
    FilePackage fp;
    while (iterator.hasNext()) {
      fp=iterator.next();
      if (fp.getDownloadLinkList() == null) {
        fp.convert();
      }
      convert.add(fp);
      if (fp.getDownloadLinkList().size() == 0) {
        convert.remove(fp);
        continue;
      }
      it=fp.getDownloadLinkList().iterator();
      while (it.hasNext()) {
        localLink=it.next();
        if (!localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
          tmp1=localLink.getLinkStatus().getStatusText();
          tmp2=localLink.getLinkStatus().getErrorMessage();
          localLink.getLinkStatus().reset();
          localLink.getLinkStatus().setErrorMessage(tmp2);
          localLink.getLinkStatus().setStatusText(tmp1);
        }
        if (localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED) && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION) == 1) {
          it.remove();
          if (fp.getDownloadLinkList().size() == 0) {
            convert.remove(fp);
            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());
          }
        }
      }
    }
    return convert;
  }
  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 {
  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)) {
    ArrayList<FilePackage> packages=(ArrayList<FilePackage>)obj;
    Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    String tmp2=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();
        if (!localLink.getLinkStatus().isFinished()) {
          tmp2=localLink.getLinkStatus().getErrorMessage();
          localLink.getLinkStatus().reset();
          localLink.getLinkStatus().setErrorMessage(tmp2);
        }
        if (localLink.getLinkStatus().isFinished() && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION) == 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());
          }
        }
      }
    }
    return packages;
  }
 else   if (obj != null && obj instanceof Vector && (((Vector)obj).size() == 0 || ((Vector)obj).size() > 0 && ((Vector)obj).get(0) instanceof FilePackage)) {
    Vector<FilePackage> packages=(Vector<FilePackage>)obj;
    ArrayList<FilePackage> convert=new ArrayList<FilePackage>();
    Iterator<FilePackage> iterator=packages.iterator();
    DownloadLink localLink;
    PluginForHost pluginForHost=null;
    PluginsC pluginForContainer=null;
    String tmp1=null;
    String tmp2=null;
    Iterator<DownloadLink> it;
    FilePackage fp;
    while (iterator.hasNext()) {
      fp=iterator.next();
      if (fp.getDownloadLinkList() == null) {
        fp.convert();
      }
      convert.add(fp);
      if (fp.getDownloadLinkList().size() == 0) {
        convert.remove(fp);
        continue;
      }
      it=fp.getDownloadLinkList().iterator();
      while (it.hasNext()) {
        localLink=it.next();
        if (!localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
          tmp1=localLink.getLinkStatus().getStatusText();
          tmp2=localLink.getLinkStatus().getErrorMessage();
          localLink.getLinkStatus().reset();
          localLink.getLinkStatus().setErrorMessage(tmp2);
          localLink.getLinkStatus().setStatusText(tmp1);
        }
        if (localLink.getLinkStatus().hasStatus(LinkStatus.FINISHED) && JDUtilities.getConfiguration().getIntegerProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION) == 1) {
          it.remove();
          if (fp.getDownloadLinkList().size() == 0) {
            convert.remove(fp);
            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());
          }
        }
      }
    }
    return convert;
  }
  throw new Exception("String_Node_Str");
}