Program: 83350
Project: 83350
Buggy source:
private void doGetPublicFile(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,String partialPath,String moduleName) throws IOException {
  String msg="String_Node_Str" + partialPath + "String_Node_Str"+ moduleName+ "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  if (autoGenerateResources(request,response,logger,partialPath,moduleName)) {
    return;
  }
  URL foundResource;
  try {
    ModuleDef moduleDef=getModuleDef(logger,moduleName);
    foundResource=moduleDef.findPublicFile(partialPath);
    if (foundResource == null) {
      File moduleDir=new File(getOutputDir(),moduleName);
      File requestedFile=new File(moduleDir,partialPath);
      if (requestedFile.exists()) {
        try {
          foundResource=requestedFile.toURL();
        }
 catch (        MalformedURLException e) {
        }
      }
      if (foundResource == null) {
        msg="String_Node_Str" + partialPath;
        logger.log(TreeLogger.WARN,msg,null);
        throw new UnableToCompleteException();
      }
    }
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + partialPath + "String_Node_Str"+ moduleName+ "String_Node_Str");
    return;
  }
  String path=foundResource.toExternalForm();
  String mimeType=null;
  try {
    mimeType=getServletContext().getMimeType(path);
  }
 catch (  UnsupportedOperationException e) {
  }
  if (mimeType == null) {
    mimeType=guessMimeType(path);
    msg="String_Node_Str" + mimeType + "String_Node_Str";
    logger.log(TreeLogger.TRACE,msg,null);
  }
  boolean infinitelyCacheable=isInfinitelyCacheable(path);
  InputStream is=null;
  try {
    URLConnection conn=foundResource.openConnection();
    long lastModified=conn.getLastModified();
    if (isNotModified(request,lastModified)) {
      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
      if (infinitelyCacheable) {
        response.setHeader(HttpHeaders.CACHE_CONTROL,HttpHeaders.CACHE_CONTROL_MAXAGE_FOREVER);
      }
      return;
    }
    response.setStatus(HttpServletResponse.SC_OK);
    long now=new Date().getTime();
    response.setHeader(HttpHeaders.DATE,HttpHeaders.toInternetDateFormat(now));
    response.setContentType(mimeType);
    String lastModifiedStr=HttpHeaders.toInternetDateFormat(lastModified);
    response.setHeader(HttpHeaders.LAST_MODIFIED,lastModifiedStr);
    String maxAgeStr;
    if (infinitelyCacheable) {
      maxAgeStr=HttpHeaders.CACHE_CONTROL_MAXAGE_FOREVER;
    }
 else {
      maxAgeStr=HttpHeaders.CACHE_CONTROL_MAXAGE_EXPIRED;
    }
    response.setHeader(HttpHeaders.CACHE_CONTROL,maxAgeStr);
    int contentLength=conn.getContentLength();
    if (contentLength >= 0) {
      response.setHeader(HttpHeaders.CONTENT_LENGTH,Integer.toString(contentLength));
    }
    is=foundResource.openStream();
    streamOut(is,response.getOutputStream(),1024 * 8);
  }
  finally {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException swallowed) {
      }
    }
  }
}

Fixed version (ground truth):
private void doGetPublicFile(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,String partialPath,String moduleName) throws IOException {
  String msg="String_Node_Str" + partialPath + "String_Node_Str"+ moduleName+ "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  if (autoGenerateResources(request,response,logger,partialPath,moduleName)) {
    return;
  }
  URL foundResource;
  try {
    ModuleDef moduleDef=getModuleDef(logger,moduleName);
    foundResource=moduleDef.findPublicFile(partialPath);
    if (foundResource == null) {
      File moduleDir=new File(getOutputDir(),moduleName);
      File requestedFile=new File(moduleDir,partialPath);
      if (requestedFile.exists()) {
        try {
          foundResource=requestedFile.toURL();
        }
 catch (        MalformedURLException e) {
        }
      }
      if (foundResource == null) {
        msg="String_Node_Str" + partialPath;
        logger.log(TreeLogger.WARN,msg,null);
        throw new UnableToCompleteException();
      }
    }
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + partialPath + "String_Node_Str"+ moduleName+ "String_Node_Str");
    return;
  }
  String path=foundResource.toExternalForm();
  String mimeType=null;
  try {
    mimeType=getServletContext().getMimeType(path);
  }
 catch (  UnsupportedOperationException e) {
  }
  if (mimeType == null) {
    mimeType=guessMimeType(path);
    msg="String_Node_Str" + mimeType + "String_Node_Str";
    logger.log(TreeLogger.TRACE,msg,null);
  }
  maybeIssueXhtmlWarning(logger,mimeType,partialPath);
  boolean infinitelyCacheable=isInfinitelyCacheable(path);
  InputStream is=null;
  try {
    URLConnection conn=foundResource.openConnection();
    long lastModified=conn.getLastModified();
    if (isNotModified(request,lastModified)) {
      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
      if (infinitelyCacheable) {
        response.setHeader(HttpHeaders.CACHE_CONTROL,HttpHeaders.CACHE_CONTROL_MAXAGE_FOREVER);
      }
      return;
    }
    response.setStatus(HttpServletResponse.SC_OK);
    long now=new Date().getTime();
    response.setHeader(HttpHeaders.DATE,HttpHeaders.toInternetDateFormat(now));
    response.setContentType(mimeType);
    String lastModifiedStr=HttpHeaders.toInternetDateFormat(lastModified);
    response.setHeader(HttpHeaders.LAST_MODIFIED,lastModifiedStr);
    String maxAgeStr;
    if (infinitelyCacheable) {
      maxAgeStr=HttpHeaders.CACHE_CONTROL_MAXAGE_FOREVER;
    }
 else {
      maxAgeStr=HttpHeaders.CACHE_CONTROL_MAXAGE_EXPIRED;
    }
    response.setHeader(HttpHeaders.CACHE_CONTROL,maxAgeStr);
    int contentLength=conn.getContentLength();
    if (contentLength >= 0) {
      response.setHeader(HttpHeaders.CONTENT_LENGTH,Integer.toString(contentLength));
    }
    is=foundResource.openStream();
    streamOut(is,response.getOutputStream(),1024 * 8);
  }
  finally {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException swallowed) {
      }
    }
  }
}