Program: 28633
Project: 28633
Buggy source:
private InputStream renderXml(String contextPath,CacheEntry cacheEntry,InputStream xsltInputStream,ProxyDirContext proxyDirContext) throws IOException, ServletException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(contextPath);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(cacheEntry.name);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(!cacheEntry.name.equals("String_Node_Str"));
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  try {
    Enumeration<NameClassPair> enumeration=proxyDirContext.list(cacheEntry.name);
    if (sortedBy.equals(SortedBy.LAST_MODIFIED)) {
      ArrayList<NameClassPair> list=Collections.list(enumeration);
      Comparator<NameClassPair> c=new LastModifiedComparator(proxyDirContext,cacheEntry.name);
      Collections.sort(list,c);
      enumeration=Collections.enumeration(list);
    }
 else     if (sortedBy.equals(SortedBy.SIZE)) {
      ArrayList<NameClassPair> list=Collections.list(enumeration);
      Comparator<NameClassPair> c=new SizeComparator(proxyDirContext,cacheEntry.name);
      Collections.sort(list,c);
      enumeration=Collections.enumeration(list);
    }
    String rewrittenContextPath=rewriteUrl(contextPath);
    while (enumeration.hasMoreElements()) {
      NameClassPair ncPair=enumeration.nextElement();
      String resourceName=ncPair.getName();
      String trimmed=resourceName;
      if (trimmed.equalsIgnoreCase("String_Node_Str") || trimmed.equalsIgnoreCase("String_Node_Str") || trimmed.equalsIgnoreCase(localXsltFile))       continue;
      CacheEntry childCacheEntry=proxyDirContext.lookupCache(cacheEntry.name + resourceName);
      if (!childCacheEntry.exists) {
        continue;
      }
      sb.append("String_Node_Str");
      sb.append("String_Node_Str").append((childCacheEntry.context != null) ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str");
      sb.append("String_Node_Str").append(rewrittenContextPath).append(rewriteUrl(cacheEntry.name + resourceName)).append((childCacheEntry.context != null) ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str");
      if (childCacheEntry.resource != null) {
        sb.append("String_Node_Str").append(renderSize(childCacheEntry.attributes.getContentLength())).append("String_Node_Str");
      }
      sb.append("String_Node_Str").append(childCacheEntry.attributes.getLastModifiedHttp()).append("String_Node_Str");
      sb.append("String_Node_Str");
      sb.append(RequestUtil.filter(trimmed));
      if (childCacheEntry.context != null)       sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
 catch (  NamingException e) {
    throw new ServletException("String_Node_Str",e);
  }
  sb.append("String_Node_Str");
  String readme=getReadme(cacheEntry.context);
  if (readme != null) {
    sb.append("String_Node_Str");
    sb.append(readme);
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  try {
    TransformerFactory tFactory=TransformerFactory.newInstance();
    Source xmlSource=new StreamSource(new StringReader(sb.toString()));
    Source xslSource=new StreamSource(xsltInputStream);
    Transformer transformer=tFactory.newTransformer(xslSource);
    ByteArrayOutputStream stream=new ByteArrayOutputStream();
    OutputStreamWriter osWriter=new OutputStreamWriter(stream,"String_Node_Str");
    StreamResult out=new StreamResult(osWriter);
    transformer.transform(xmlSource,out);
    osWriter.flush();
    return (new ByteArrayInputStream(stream.toByteArray()));
  }
 catch (  Exception e) {
    log("String_Node_Str" + e.getMessage());
    return renderHtml(contextPath,cacheEntry);
  }
}

Fixed version (ground truth):
private InputStream renderXml(String contextPath,CacheEntry cacheEntry,InputStream xsltInputStream,ProxyDirContext proxyDirContext) throws IOException, ServletException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(contextPath);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(cacheEntry.name);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str").append(!cacheEntry.name.equals("String_Node_Str"));
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  try {
    Enumeration<NameClassPair> enumeration=proxyDirContext.list(cacheEntry.name);
    if (sortedBy.equals(SortedBy.LAST_MODIFIED)) {
      ArrayList<NameClassPair> list=Collections.list(enumeration);
      Comparator<NameClassPair> c=new LastModifiedComparator(proxyDirContext,cacheEntry.name);
      Collections.sort(list,c);
      enumeration=Collections.enumeration(list);
    }
 else     if (sortedBy.equals(SortedBy.SIZE)) {
      ArrayList<NameClassPair> list=Collections.list(enumeration);
      Comparator<NameClassPair> c=new SizeComparator(proxyDirContext,cacheEntry.name);
      Collections.sort(list,c);
      enumeration=Collections.enumeration(list);
    }
    String rewrittenContextPath=rewriteUrl(contextPath);
    HtmlEntityEncoder htmlEntityEncoder=new HtmlEntityEncoder();
    while (enumeration.hasMoreElements()) {
      NameClassPair ncPair=enumeration.nextElement();
      String resourceName=ncPair.getName();
      String trimmed=resourceName;
      if (trimmed.equalsIgnoreCase("String_Node_Str") || trimmed.equalsIgnoreCase("String_Node_Str") || trimmed.equalsIgnoreCase(localXsltFile))       continue;
      CacheEntry childCacheEntry=proxyDirContext.lookupCache(cacheEntry.name + resourceName);
      if (!childCacheEntry.exists) {
        continue;
      }
      sb.append("String_Node_Str");
      sb.append("String_Node_Str").append((childCacheEntry.context != null) ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str");
      sb.append("String_Node_Str").append(rewrittenContextPath).append(rewriteUrl(cacheEntry.name + resourceName)).append((childCacheEntry.context != null) ? "String_Node_Str" : "String_Node_Str").append("String_Node_Str");
      if (childCacheEntry.resource != null) {
        sb.append("String_Node_Str").append(renderSize(childCacheEntry.attributes.getContentLength())).append("String_Node_Str");
      }
      sb.append("String_Node_Str").append(childCacheEntry.attributes.getLastModifiedHttp()).append("String_Node_Str");
      sb.append("String_Node_Str");
      sb.append(htmlEntityEncoder.encode(trimmed));
      if (childCacheEntry.context != null)       sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
 catch (  NamingException e) {
    throw new ServletException("String_Node_Str",e);
  }
  sb.append("String_Node_Str");
  String readme=getReadme(cacheEntry.context);
  if (readme != null) {
    sb.append("String_Node_Str");
    sb.append(readme);
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  try {
    TransformerFactory tFactory=TransformerFactory.newInstance();
    Source xmlSource=new StreamSource(new StringReader(sb.toString()));
    Source xslSource=new StreamSource(xsltInputStream);
    Transformer transformer=tFactory.newTransformer(xslSource);
    ByteArrayOutputStream stream=new ByteArrayOutputStream();
    OutputStreamWriter osWriter=new OutputStreamWriter(stream,"String_Node_Str");
    StreamResult out=new StreamResult(osWriter);
    transformer.transform(xmlSource,out);
    osWriter.flush();
    return (new ByteArrayInputStream(stream.toByteArray()));
  }
 catch (  Exception e) {
    log("String_Node_Str" + e.getMessage());
    return renderHtml(contextPath,cacheEntry);
  }
}