Program: 89772
Project: 89772
Buggy source:
/** 
 * Extract the name of the replica (parameter Constants.BITARCHIVE_NAME_PARAM) and the type of update  requested (parameter Constants.UPDATE_TYPE_PARAM). The latter is set to to Constants.FIND_MISSING_FILES_OPTION if the request is to update missing files, or to Constants.CHECKSUM_OPTION if the request is to update the  checksum information.
 * @param context the current JSP context
 * @throws ForwardedToErrorPage if an unknown bitarchive or update type is posted, or one of the two required parameters are missing. 
 * @throws ArgumentNotValid If the context is null.
 * @return an I18N string telling which type of update has just been initiated. 
 */
public static String processUpdateRequest(PageContext context) throws ArgumentNotValid, ForwardedToErrorPage {
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  ServletRequest request=context.getRequest();
  String bitarchiveName=request.getParameter(Constants.BITARCHIVE_NAME_PARAM);
  if (bitarchiveName == null) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",bitarchiveName);
    throw new ForwardedToErrorPage("String_Node_Str" + Constants.BITARCHIVE_NAME_PARAM + "String_Node_Str");
  }
  String updateTypeRequested=request.getParameter(Constants.UPDATE_TYPE_PARAM);
  if (updateTypeRequested == null) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",updateTypeRequested);
    throw new ForwardedToErrorPage("String_Node_Str" + Constants.UPDATE_TYPE_PARAM + "String_Node_Str");
  }
  if (!Replica.isKnownReplicaName(bitarchiveName)) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",bitarchiveName);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
  Replica bitarchive=Replica.getReplicaFromName(bitarchiveName);
  Locale l=context.getResponse().getLocale();
  String statusmessage=HTMLUtils.escapeHtmlValues(I18N.getString(l,"String_Node_Str",updateTypeRequested,bitarchiveName));
  if (updateTypeRequested.equalsIgnoreCase(Constants.FIND_MISSING_FILES_OPTION)) {
    new BitpreservationUpdateThread(bitarchive,BitpreservationUpdateType.FINDMISSING).start();
    return statusmessage;
  }
 else   if (updateTypeRequested.equalsIgnoreCase(Constants.CHECKSUM_OPTION)) {
    new BitpreservationUpdateThread(bitarchive,BitpreservationUpdateType.CHECKSUM).start();
    return statusmessage;
  }
 else {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",updateTypeRequested);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
}

Fixed version (ground truth):
/** 
 * Extract the name of the replica (parameter Constants.BITARCHIVE_NAME_PARAM) and the type of update  requested (parameter Constants.UPDATE_TYPE_PARAM). The latter is set to to Constants.FIND_MISSING_FILES_OPTION if the request is to update  missing files, or to Constants.CHECKSUM_OPTION if the request is to  update the checksum information.
 * @param context the current JSP context
 * @throws ForwardedToErrorPage if an unknown bitarchive or update type is posted, or one of the two required parameters are missing. 
 * @throws ArgumentNotValid If the context is null.
 * @return an I18N string telling which type of update has just been initiated. 
 */
public static String processUpdateRequest(PageContext context) throws ArgumentNotValid, ForwardedToErrorPage {
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  ServletRequest request=context.getRequest();
  String bitarchiveName=request.getParameter(Constants.BITARCHIVE_NAME_PARAM);
  if (bitarchiveName == null) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",Constants.BITARCHIVE_NAME_PARAM);
    throw new ForwardedToErrorPage("String_Node_Str" + Constants.BITARCHIVE_NAME_PARAM + "String_Node_Str");
  }
  String updateTypeRequested=request.getParameter(Constants.UPDATE_TYPE_PARAM);
  if (updateTypeRequested == null) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",Constants.UPDATE_TYPE_PARAM);
    throw new ForwardedToErrorPage("String_Node_Str" + Constants.UPDATE_TYPE_PARAM + "String_Node_Str");
  }
  if (!Replica.isKnownReplicaName(bitarchiveName)) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",bitarchiveName);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
  Replica bitarchive=Replica.getReplicaFromName(bitarchiveName);
  Locale l=context.getResponse().getLocale();
  String statusmessage=HTMLUtils.escapeHtmlValues(I18N.getString(l,"String_Node_Str",updateTypeRequested,bitarchiveName));
  if (updateTypeRequested.equalsIgnoreCase(Constants.FIND_MISSING_FILES_OPTION)) {
    new BitpreservationUpdateThread(bitarchive,BitpreservationUpdateType.FINDMISSING).start();
    return statusmessage;
  }
 else   if (updateTypeRequested.equalsIgnoreCase(Constants.CHECKSUM_OPTION)) {
    new BitpreservationUpdateThread(bitarchive,BitpreservationUpdateType.CHECKSUM).start();
    return statusmessage;
  }
 else {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",updateTypeRequested);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
}