Program: 151493
Project: 151493
Buggy source:
@Override public org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query){
  try {
    RepositorySystem system=container.getRepositorySystem();
    Settings settings=container.getSettings();
    MavenRepositorySystemSession session=container.setupRepoSession(system,settings);
    session.setTransferListener(new LogTransferListener());
    session.setDependencyTraverser(new DependencyTraverser(){
      @Override public boolean traverseDependency(      org.sonatype.aether.graph.Dependency dependency){
        if (query.getScopeType() != null)         return query.getScopeType().equals(dependency.getScope());
 else         return !"String_Node_Str".equals(dependency.getScope());
      }
      @Override public DependencyTraverser deriveChildTraverser(      DependencyCollectionContext context){
        return this;
      }
    }
);
    session.setDependencySelector(new ScopeDependencySelector("String_Node_Str"));
    final CoordinateBuilder coord=CoordinateBuilder.create(query.getCoordinate());
    Artifact queryArtifact=coordinateToMavenArtifact(coord);
    List<RemoteRepository> remoteRepos=getRemoteRepositories(query,settings);
    CollectRequest collectRequest=new CollectRequest(new org.sonatype.aether.graph.Dependency(queryArtifact,null),remoteRepos);
    DependencyRequest dr=new DependencyRequest(collectRequest,null);
    DependencyResult result=system.resolveDependencies(session,dr);
    DependencyNodeBuilder hierarchy=MavenConvertUtils.toDependencyNode(factory,null,result.getRoot());
    return hierarchy;
  }
 catch (  Exception e) {
    throw new DependencyException("String_Node_Str" + query.getCoordinate() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query){
  try {
    RepositorySystem system=container.getRepositorySystem();
    Settings settings=container.getSettings();
    MavenRepositorySystemSession session=container.setupRepoSession(system,settings);
    session.setTransferListener(new LogTransferListener());
    session.setDependencyTraverser(new DependencyTraverser(){
      @Override public boolean traverseDependency(      org.sonatype.aether.graph.Dependency dependency){
        if (query.getScopeType() != null)         return query.getScopeType().equals(dependency.getScope());
 else         return !"String_Node_Str".equals(dependency.getScope());
      }
      @Override public DependencyTraverser deriveChildTraverser(      DependencyCollectionContext context){
        return this;
      }
    }
);
    session.setDependencySelector(new ScopeDependencySelector("String_Node_Str"));
    final CoordinateBuilder coord=CoordinateBuilder.create(query.getCoordinate());
    Artifact queryArtifact=MavenConvertUtils.coordinateToMavenArtifact(coord);
    List<RemoteRepository> remoteRepos=MavenRepositories.getRemoteRepositories(container,settings,query);
    CollectRequest collectRequest=new CollectRequest(new org.sonatype.aether.graph.Dependency(queryArtifact,null),remoteRepos);
    DependencyRequest dr=new DependencyRequest(collectRequest,null);
    DependencyResult result=system.resolveDependencies(session,dr);
    DependencyNodeBuilder hierarchy=MavenConvertUtils.toDependencyNode(factory,null,result.getRoot());
    return hierarchy;
  }
 catch (  Exception e) {
    throw new DependencyException("String_Node_Str" + query.getCoordinate() + "String_Node_Str",e);
  }
}