Program: 151489
Project: 151489
Buggy source:
@Override public File[] resolveResources(final AddonId addonId){
  RepositorySystem system=container.getRepositorySystem();
  Settings settings=container.getSettings();
  DefaultRepositorySystemSession session=container.setupRepoSession(system,settings);
  final String mavenCoords=toMavenCoords(addonId);
  Artifact queryArtifact=new DefaultArtifact(mavenCoords);
  session.setDependencyTraverser(new DependencyTraverser(){
    @Override public boolean traverseDependency(    Dependency dependency){
      Artifact artifact=dependency.getArtifact();
      boolean isForgeAddon="String_Node_Str".equals(artifact.getClassifier());
      if (!isForgeAddon && dependency.isOptional()) {
        return false;
      }
      boolean shouldRecurse=!"String_Node_Str".equals(dependency.getScope());
      return shouldRecurse;
    }
    @Override public DependencyTraverser deriveChildTraverser(    DependencyCollectionContext context){
      return this;
    }
  }
);
  session.setDependencySelector(new AddonDependencySelector());
  Dependency dependency=new Dependency(queryArtifact,null);
  CollectRequest collectRequest=new CollectRequest(dependency,container.getEnabledRepositoriesFromProfile(settings));
  DependencyResult result;
  try {
    result=system.resolveDependencies(session,new DependencyRequest(collectRequest,null));
  }
 catch (  DependencyResolutionException e) {
    throw new RuntimeException(e);
  }
  Set<File> files=new HashSet<File>();
  List<ArtifactResult> artifactResults=result.getArtifactResults();
  for (  ArtifactResult artifactResult : artifactResults) {
    Artifact artifact=artifactResult.getArtifact();
    if (FORGE_ADDON_CLASSIFIER.equals(artifact.getClassifier()) && !mavenCoords.equals(artifact.toString())) {
      continue;
    }
    files.add(artifact.getFile());
  }
  return files.toArray(new File[files.size()]);
}

Fixed version (ground truth):
@Override public File[] resolveResources(final AddonId addonId){
  RepositorySystem system=container.getRepositorySystem();
  Settings settings=container.getSettings();
  DefaultRepositorySystemSession session=container.setupRepoSession(system,settings);
  final String mavenCoords=toMavenCoords(addonId);
  Artifact queryArtifact=new DefaultArtifact(mavenCoords);
  session.setDependencyTraverser(new DependencyTraverser(){
    @Override public boolean traverseDependency(    Dependency dependency){
      Artifact artifact=dependency.getArtifact();
      boolean isForgeAddon="String_Node_Str".equals(artifact.getClassifier());
      if (!isForgeAddon && dependency.isOptional()) {
        return false;
      }
      boolean shouldRecurse=!"String_Node_Str".equals(dependency.getScope());
      return shouldRecurse;
    }
    @Override public DependencyTraverser deriveChildTraverser(    DependencyCollectionContext context){
      return this;
    }
  }
);
  session.setDependencySelector(new AddonDependencySelector());
  Dependency dependency=new Dependency(queryArtifact,null);
  List<RemoteRepository> repositories=MavenRepositories.getRemoteRepositories(container,settings);
  CollectRequest collectRequest=new CollectRequest(dependency,repositories);
  DependencyResult result;
  try {
    result=system.resolveDependencies(session,new DependencyRequest(collectRequest,null));
  }
 catch (  DependencyResolutionException e) {
    throw new RuntimeException(e);
  }
  Set<File> files=new HashSet<File>();
  List<ArtifactResult> artifactResults=result.getArtifactResults();
  for (  ArtifactResult artifactResult : artifactResults) {
    Artifact artifact=artifactResult.getArtifact();
    if (FORGE_ADDON_CLASSIFIER.equals(artifact.getClassifier()) && !mavenCoords.equals(artifact.toString())) {
      continue;
    }
    files.add(artifact.getFile());
  }
  return files.toArray(new File[files.size()]);
}