Program: 96462
Project: 96462
Buggy source:
private Set<IBundle> addIncomingPackageDependencies(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 (incomingDependencyDegree >= degree) {
    String id=bundle.getId();
    for (    IBundle dependantBundle : this.bundles.values()) {
      for (      IPackageImport packageImport : dependantBundle.getPackageImports()) {
        if (packageImport.getSupplierId().equals(id)) {
          Set<BundleDependency> bundleDependencies=null;
          if (dependenciesByBundle.containsKey(dependantBundle)) {
            bundleDependencies=dependenciesByBundle.get(dependantBundle);
          }
 else {
            bundleDependencies=new HashSet<BundleDependency>();
            dependenciesByBundle.put(dependantBundle,bundleDependencies);
          }
          PackageBundleDependency bundleDependency=null;
          for (          BundleDependency dep : bundleDependencies) {
            if (dep.getExportingBundle().equals(bundle) && dep instanceof PackageBundleDependency) {
              bundleDependency=(PackageBundleDependency)dep;
              break;
            }
          }
          if (bundleDependency == null) {
            bundleDependency=new PackageBundleDependency(bundle,dependantBundle);
            bundleDependencies.add(bundleDependency);
            dependencies.add(bundleDependency);
          }
          contentResult.addIncomingDependency(degree,dependantBundle);
          bundleDependency.addPackageImport(packageImport);
          dependentBundles.add(dependantBundle);
        }
      }
    }
  }
  if (incomingDependencyDegree > degree) {
    return dependentBundles;
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
private Set<IBundle> addIncomingPackageDependencies(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 (incomingDependencyDegree >= degree) {
    String id=bundle.getId();
    for (    IBundle dependantBundle : this.bundles.values()) {
      for (      IPackageImport packageImport : dependantBundle.getPackageImports()) {
        if (packageImport.getSupplierId().equals(id)) {
          Set<BundleDependency> bundleDependencies=null;
          if (dependenciesByBundle.containsKey(dependantBundle)) {
            bundleDependencies=dependenciesByBundle.get(dependantBundle);
          }
 else {
            bundleDependencies=new HashSet<BundleDependency>();
            dependenciesByBundle.put(dependantBundle,bundleDependencies);
          }
          PackageBundleDependency bundleDependency=null;
          for (          BundleDependency dep : bundleDependencies) {
            if (dep.getExportingBundle().equals(bundle) && dep instanceof PackageBundleDependency) {
              bundleDependency=(PackageBundleDependency)dep;
              break;
            }
          }
          if (bundleDependency == null) {
            bundleDependency=new PackageBundleDependency(bundle,dependantBundle);
            bundleDependencies.add(bundleDependency);
            dependencies.add(bundleDependency);
          }
          contentResult.addIncomingDependency(Integer.valueOf(degree),dependantBundle);
          bundleDependency.addPackageImport(packageImport);
          dependentBundles.add(dependantBundle);
        }
      }
    }
  }
  if (incomingDependencyDegree > degree) {
    return dependentBundles;
  }
  return Collections.emptySet();
}