Program: 82699
Project: 82699
Buggy source:
/** 
 * Resolve dependencies of a module described by a module descriptor.
 */
public ResolveReport resolve(ModuleDescriptor md,ResolveOptions options) throws ParseException, IOException {
  DependencyResolver oldDictator=getDictatorResolver();
  if (options.isUseCacheOnly()) {
    setDictatorResolver(new CacheResolver(settings));
  }
  try {
    CacheManager cacheManager=options.getCache();
    if (cacheManager == null) {
      cacheManager=IvyContext.getContext().getCacheManager();
      options.setCache(cacheManager);
    }
 else {
      IvyContext.getContext().setCacheManager(cacheManager);
    }
    String[] confs=options.getConfs(md);
    options.setConfs(confs);
    if (options.getResolveId() == null) {
      options.setResolveId(ResolveOptions.getDefaultResolveId(md));
    }
    eventManager.fireIvyEvent(new StartResolveEvent(md,confs));
    long start=System.currentTimeMillis();
    Message.info("String_Node_Str" + md.getResolvedModuleRevisionId() + (options.isTransitive() ? "String_Node_Str" : "String_Node_Str"));
    Message.info("String_Node_Str" + Arrays.asList(confs));
    Message.verbose("String_Node_Str" + options.isValidate());
    ResolveReport report=new ResolveReport(md,options.getResolveId());
    IvyNode[] dependencies=getDependencies(md,options,report);
    report.setDependencies(Arrays.asList(dependencies),options.getArtifactFilter());
    File ivyFileInCache=cacheManager.getResolvedIvyFileInCache(md.getResolvedModuleRevisionId());
    md.toIvyFile(ivyFileInCache);
    File ivyPropertiesInCache=cacheManager.getResolvedIvyPropertiesInCache(md.getResolvedModuleRevisionId());
    Properties props=new Properties();
    if (dependencies.length > 0) {
      IvyNode root=dependencies[0].getRoot();
      for (int i=0; i < dependencies.length; i++) {
        if (!dependencies[i].hasProblem()) {
          DependencyDescriptor dd=dependencies[i].getDependencyDescriptor(root);
          if (dd != null) {
            ModuleRevisionId depResolvedId=dependencies[i].getResolvedId();
            ModuleDescriptor depDescriptor=dependencies[i].getDescriptor();
            ModuleRevisionId depRevisionId=dd.getDependencyRevisionId();
            if (depResolvedId == null) {
              throw new NullPointerException("String_Node_Str" + dependencies[i].toString());
            }
            if (depRevisionId == null) {
              throw new NullPointerException("String_Node_Str" + "String_Node_Str" + dd.toString());
            }
            String rev=depResolvedId.getRevision();
            String status=depDescriptor == null ? "String_Node_Str" : depDescriptor.getStatus();
            props.put(depRevisionId.encodeToString(),rev + "String_Node_Str" + status);
          }
        }
      }
    }
    FileOutputStream out=new FileOutputStream(ivyPropertiesInCache);
    props.store(out,md.getResolvedModuleRevisionId() + "String_Node_Str");
    out.close();
    Message.verbose("String_Node_Str" + ivyFileInCache);
    report.setResolveTime(System.currentTimeMillis() - start);
    if (options.isDownload()) {
      Message.verbose("String_Node_Str");
      downloadArtifacts(report,cacheManager,options.isUseOrigin(),options.getArtifactFilter());
    }
    if (options.isOutputReport()) {
      outputReport(report,cacheManager.getResolutionCacheRoot());
    }
    eventManager.fireIvyEvent(new EndResolveEvent(md,confs,report));
    return report;
  }
 catch (  RuntimeException ex) {
    Message.error(ex.getMessage());
    Message.sumupProblems();
    throw ex;
  }
 finally {
    setDictatorResolver(oldDictator);
  }
}

Fixed version (ground truth):
/** 
 * Resolve dependencies of a module described by a module descriptor.
 */
public ResolveReport resolve(ModuleDescriptor md,ResolveOptions options) throws ParseException, IOException {
  DependencyResolver oldDictator=getDictatorResolver();
  if (options.isUseCacheOnly()) {
    setDictatorResolver(new CacheResolver(settings));
  }
  try {
    CacheManager cacheManager=options.getCache();
    if (cacheManager == null) {
      cacheManager=IvyContext.getContext().getCacheManager();
      options.setCache(cacheManager);
    }
 else {
      IvyContext.getContext().setCacheManager(cacheManager);
    }
    String[] confs=options.getConfs(md);
    options.setConfs(confs);
    if (options.getResolveId() == null) {
      options.setResolveId(ResolveOptions.getDefaultResolveId(md));
    }
    eventManager.fireIvyEvent(new StartResolveEvent(md,confs));
    long start=System.currentTimeMillis();
    Message.info("String_Node_Str" + md.getResolvedModuleRevisionId() + (options.isTransitive() ? "String_Node_Str" : "String_Node_Str"));
    Message.info("String_Node_Str" + Arrays.asList(confs));
    Message.verbose("String_Node_Str" + options.isValidate());
    ResolveReport report=new ResolveReport(md,options.getResolveId());
    IvyNode[] dependencies=getDependencies(md,options,report);
    report.setDependencies(Arrays.asList(dependencies),options.getArtifactFilter());
    File ivyFileInCache=cacheManager.getResolvedIvyFileInCache(md.getResolvedModuleRevisionId());
    md.toIvyFile(ivyFileInCache);
    File ivyPropertiesInCache=cacheManager.getResolvedIvyPropertiesInCache(md.getResolvedModuleRevisionId());
    Properties props=new Properties();
    if (dependencies.length > 0) {
      IvyNode root=dependencies[0].getRoot();
      for (int i=0; i < dependencies.length; i++) {
        if (!dependencies[i].hasProblem()) {
          DependencyDescriptor dd=dependencies[i].getDependencyDescriptor(root);
          if (dd != null) {
            ModuleRevisionId depResolvedId=dependencies[i].getResolvedId();
            ModuleDescriptor depDescriptor=dependencies[i].getDescriptor();
            ModuleRevisionId depRevisionId=dd.getDependencyRevisionId();
            if (depResolvedId == null) {
              throw new NullPointerException("String_Node_Str" + dependencies[i].toString());
            }
            if (depRevisionId == null) {
              throw new NullPointerException("String_Node_Str" + "String_Node_Str" + dd.toString());
            }
            String rev=depResolvedId.getRevision();
            String status=depDescriptor == null ? "String_Node_Str" : depDescriptor.getStatus();
            props.put(depRevisionId.encodeToString(),rev + "String_Node_Str" + status);
          }
        }
      }
    }
    FileOutputStream out=new FileOutputStream(ivyPropertiesInCache);
    props.store(out,md.getResolvedModuleRevisionId() + "String_Node_Str");
    out.close();
    Message.verbose("String_Node_Str" + ivyFileInCache);
    report.setResolveTime(System.currentTimeMillis() - start);
    if (options.isDownload()) {
      Message.verbose("String_Node_Str");
      downloadArtifacts(report,cacheManager,options.isUseOrigin(),options.getArtifactFilter());
    }
    if (options.isOutputReport()) {
      outputReport(report,cacheManager);
    }
    Message.verbose("String_Node_Str" + report.getResolveTime() + "String_Node_Str"+ report.getDownloadTime()+ "String_Node_Str");
    Message.sumupProblems();
    eventManager.fireIvyEvent(new EndResolveEvent(md,confs,report));
    return report;
  }
 catch (  RuntimeException ex) {
    Message.error(ex.getMessage());
    Message.sumupProblems();
    throw ex;
  }
 finally {
    setDictatorResolver(oldDictator);
  }
}