Program: 82731
Project: 82731
Buggy source:
private void genStyled(File cache,String organisation,String module,String[] confs,String style,String ext) throws IOException {
  File out;
  if (todir != null) {
    out=todir;
  }
 else {
    out=new File("String_Node_Str");
  }
  XSLTProcess xslt=new XSLTProcess();
  xslt.setTaskName(getTaskName());
  xslt.setProject(getProject());
  xslt.init();
  xslt.setDestdir(out);
  xslt.setBasedir(cache);
  xslt.setStyle(style);
  XSLTProcess.Param param=xslt.createParam();
  param.setName("String_Node_Str");
  param.setExpression(conf);
  param=xslt.createParam();
  param.setName("String_Node_Str");
  param.setExpression(xslext);
  for (Iterator it=params.iterator(); it.hasNext(); ) {
    param=(XSLTProcess.Param)it.next();
    XSLTProcess.Param realParam=xslt.createParam();
    realParam.setName(param.getName());
    realParam.setExpression(param.getExpression());
  }
  CacheManager cacheMgr=getIvyInstance().getCacheManager(cache);
  for (int i=0; i < confs.length; i++) {
    File reportFile=cacheMgr.getConfigurationResolveReportInCache(resolveId,confs[i]);
    File outFile=new File(out,IvyPatternHelper.substitute(outputpattern,organisation,module,"String_Node_Str","String_Node_Str","String_Node_Str",ext,confs[i]));
    xslt.setIn(reportFile);
    xslt.setOut(outFile);
    xslt.execute();
  }
}

Fixed version (ground truth):
private void genStyled(File cache,String organisation,String module,String[] confs,File style,String ext) throws IOException {
  CacheManager cacheMgr=getIvyInstance().getCacheManager(cache);
  File out;
  if (todir != null) {
    out=todir;
  }
 else {
    out=new File("String_Node_Str");
  }
  InputStream xsltStream=null;
  try {
    xsltStream=new BufferedInputStream(new FileInputStream(style));
    Source xsltSource=new StreamSource(xsltStream,JAXPUtils.getSystemId(style));
    TransformerFactory tFactory=TransformerFactory.newInstance();
    Transformer transformer=tFactory.newTransformer(xsltSource);
    transformer.setParameter("String_Node_Str",conf);
    transformer.setParameter("String_Node_Str",xslext);
    for (Iterator it=params.iterator(); it.hasNext(); ) {
      XSLTProcess.Param param=(XSLTProcess.Param)it.next();
      transformer.setParameter(param.getName(),param.getExpression());
    }
    for (int i=0; i < confs.length; i++) {
      File reportFile=cacheMgr.getConfigurationResolveReportInCache(resolveId,confs[i]);
      File outFile=new File(out,IvyPatternHelper.substitute(outputpattern,organisation,module,"String_Node_Str","String_Node_Str","String_Node_Str",ext,confs[i]));
      log("String_Node_Str" + reportFile + "String_Node_Str"+ outFile);
      File outFileDir=outFile.getParentFile();
      if (!outFileDir.exists()) {
        if (!outFileDir.mkdirs()) {
          throw new BuildException("String_Node_Str" + outFileDir.getAbsolutePath());
        }
      }
      InputStream inStream=null;
      OutputStream outStream=null;
      try {
        inStream=new BufferedInputStream(new FileInputStream(reportFile));
        outStream=new BufferedOutputStream(new FileOutputStream(outFile));
        StreamResult res=new StreamResult(outStream);
        Source src=new StreamSource(inStream,JAXPUtils.getSystemId(style));
        transformer.transform(src,res);
      }
 catch (      TransformerException e) {
        throw new BuildException(e);
      }
 finally {
        if (inStream != null) {
          try {
            inStream.close();
          }
 catch (          IOException e) {
          }
        }
        if (outStream != null) {
          try {
            outStream.close();
          }
 catch (          IOException e) {
          }
        }
      }
    }
  }
 catch (  TransformerConfigurationException e) {
    throw new BuildException(e);
  }
 finally {
    if (xsltStream != null) {
      try {
        xsltStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}