Program: 96461
Project: 96461
Buggy source:
private Set<IBundle> addOutgoingPackageDependencies(Set<BundleDependency> dependencies,IBundle bundle,int degree,Set<IBundle> processedBundles){
  if (processedBundles.contains(bundle)) {
    return Collections.emptySet();
  }
  processedBundles.add(bundle);
  Set<IBundle> dependentBundles=new HashSet<IBundle>();
  if (outgoingDependencyDegree >= degree) {
    for (    IPackageImport pe : bundle.getPackageImports()) {
      IBundle dependantBundle=this.bundles.get(Long.valueOf(pe.getSupplierId()));
      if (dependantBundle == null) {
        continue;
      }
      Set<BundleDependency> bundleDependencies=null;
      if (dependenciesByBundle.containsKey(bundle)) {
        bundleDependencies=dependenciesByBundle.get(bundle);
      }
 else {
        bundleDependencies=new HashSet<BundleDependency>();
        dependenciesByBundle.put(bundle,bundleDependencies);
      }
      PackageBundleDependency bundleDependency=null;
      for (      BundleDependency dep : bundleDependencies) {
        if (dep.getExportingBundle().equals(dependantBundle) && dep instanceof PackageBundleDependency) {
          bundleDependency=(PackageBundleDependency)dep;
          break;
        }
      }
      if (bundleDependency == null) {
        bundleDependency=new PackageBundleDependency(dependantBundle,bundle);
        bundleDependencies.add(bundleDependency);
        dependencies.add(bundleDependency);
      }
      contentResult.addOutgoingDependency(degree,dependantBundle);
      bundleDependency.addPackageImport(pe);
      dependentBundles.add(dependantBundle);
    }
  }
  if (outgoingDependencyDegree > degree) {
    return dependentBundles;
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
private Set<IBundle> addOutgoingPackageDependencies(Set<BundleDependency> dependencies,IBundle bundle,int degree,Set<IBundle> processedBundles){
  if (processedBundles.contains(bundle)) {
    return Collections.emptySet();
  }
  processedBundles.add(bundle);
  Set<IBundle> dependentBundles=new HashSet<IBundle>();
  if (outgoingDependencyDegree >= degree) {
    for (    IPackageImport pe : bundle.getPackageImports()) {
      IBundle dependantBundle=this.bundles.get(Long.valueOf(pe.getSupplierId()));
      if (dependantBundle == null) {
        continue;
      }
      Set<BundleDependency> bundleDependencies=null;
      if (dependenciesByBundle.containsKey(bundle)) {
        bundleDependencies=dependenciesByBundle.get(bundle);
      }
 else {
        bundleDependencies=new HashSet<BundleDependency>();
        dependenciesByBundle.put(bundle,bundleDependencies);
      }
      PackageBundleDependency bundleDependency=null;
      for (      BundleDependency dep : bundleDependencies) {
        if (dep.getExportingBundle().equals(dependantBundle) && dep instanceof PackageBundleDependency) {
          bundleDependency=(PackageBundleDependency)dep;
          break;
        }
      }
      if (bundleDependency == null) {
        bundleDependency=new PackageBundleDependency(dependantBundle,bundle);
        bundleDependencies.add(bundleDependency);
        dependencies.add(bundleDependency);
      }
      contentResult.addOutgoingDependency(Integer.valueOf(degree),dependantBundle);
      bundleDependency.addPackageImport(pe);
      dependentBundles.add(dependantBundle);
    }
  }
  if (outgoingDependencyDegree > degree) {
    return dependentBundles;
  }
  return Collections.emptySet();
}