Program: 52539
Project: 52539
Buggy source:
/** 
 * process input from basic info page
 * @param context
 * @param request
 * @param response
 * @param collection
 * @throws SQLException
 * @throws ServletException
 * @throws IOException
 * @throws AuthorizeException
 */
private void processBasicInfo(Context context,HttpServletRequest request,HttpServletResponse response) throws SQLException, ServletException, IOException, AuthorizeException {
  FileUploadRequest wrapper=new FileUploadRequest(request);
  Collection collection=Collection.find(context,UIUtil.getIntParameter(wrapper,"String_Node_Str"));
  if (collection == null) {
    log.warn(LogManager.getHeader(context,"String_Node_Str",UIUtil.getRequestLogInfo(wrapper)));
    JSPManager.showIntegrityError(request,response);
    return;
  }
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  String license=wrapper.getParameter("String_Node_Str");
  if (license != null) {
    collection.setLicense(null);
  }
  File temp=wrapper.getFile("String_Node_Str");
  if (temp != null) {
    InputStream is=new BufferedInputStream(new FileInputStream(temp));
    Bitstream logoBS=collection.setLogo(is);
    String noPath=wrapper.getFilesystemName("String_Node_Str");
    while (noPath.indexOf('/') > -1) {
      noPath=noPath.substring(noPath.indexOf('/') + 1);
    }
    while (noPath.indexOf('\\') > -1) {
      noPath=noPath.substring(noPath.indexOf('\\') + 1);
    }
    logoBS.setName(noPath);
    logoBS.setSource(wrapper.getFilesystemName("String_Node_Str"));
    BitstreamFormat bf=FormatIdentifier.guessFormat(context,logoBS);
    logoBS.setFormat(bf);
    logoBS.update();
    temp.delete();
  }
  collection.update();
  showNextPage(context,request,response,collection,BASIC_INFO);
  context.complete();
}

Fixed version (ground truth):
/** 
 * process input from basic info page
 * @param context
 * @param request
 * @param response
 * @param collection
 * @throws SQLException
 * @throws ServletException
 * @throws IOException
 * @throws AuthorizeException
 */
private void processBasicInfo(Context context,HttpServletRequest request,HttpServletResponse response) throws SQLException, ServletException, IOException, AuthorizeException {
  FileUploadRequest wrapper=new FileUploadRequest(request);
  Collection collection=Collection.find(context,UIUtil.getIntParameter(wrapper,"String_Node_Str"));
  if (collection == null) {
    log.warn(LogManager.getHeader(context,"String_Node_Str",UIUtil.getRequestLogInfo(wrapper)));
    JSPManager.showIntegrityError(request,response);
    return;
  }
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  collection.setMetadata("String_Node_Str",wrapper.getParameter("String_Node_Str"));
  String license=wrapper.getParameter("String_Node_Str");
  if (license != null || license.equals("String_Node_Str")) {
    collection.setLicense(license);
  }
  File temp=wrapper.getFile("String_Node_Str");
  if (temp != null) {
    InputStream is=new BufferedInputStream(new FileInputStream(temp));
    Bitstream logoBS=collection.setLogo(is);
    String noPath=wrapper.getFilesystemName("String_Node_Str");
    while (noPath.indexOf('/') > -1) {
      noPath=noPath.substring(noPath.indexOf('/') + 1);
    }
    while (noPath.indexOf('\\') > -1) {
      noPath=noPath.substring(noPath.indexOf('\\') + 1);
    }
    logoBS.setName(noPath);
    logoBS.setSource(wrapper.getFilesystemName("String_Node_Str"));
    BitstreamFormat bf=FormatIdentifier.guessFormat(context,logoBS);
    logoBS.setFormat(bf);
    logoBS.update();
    temp.delete();
  }
  collection.update();
  showNextPage(context,request,response,collection,BASIC_INFO);
  context.complete();
}