Program: 57063
Project: 57063
Buggy source:
/** 
 * <p> Creates and returns a FacesMessage for the specified Locale. </p> Simplified and streamlined version of the implementation of Mojarra 2.2.8-b02 (see MessageFactory).
 * @param locale - the target <code>Locale</code>
 * @param messageId - the key of the message in the resource bundle
 * @param params - substittion parameters
 * @return a localized <code>FacesMessage</code> with the severity of FacesMessage.SEVERITY_ERROR
 */
public static FacesMessage getMessage(String messageId,String... params){
  String summary=null;
  String detail=null;
  ResourceBundle bundle;
  String bundleName;
  FacesContext context=FacesContext.getCurrentInstance();
  Locale locale=context.getViewRoot().getLocale();
  Application app=(FacesContext.getCurrentInstance().getApplication());
  if (null != (bundleName=app.getMessageBundle())) {
    if (null != (bundle=ResourceBundle.getBundle(bundleName,locale,Thread.currentThread().getContextClassLoader()))) {
      try {
        summary=bundle.getString(messageId);
        detail=bundle.getString(messageId + "String_Node_Str");
      }
 catch (      MissingResourceException e) {
      }
    }
  }
  if (null == summary) {
    bundle=ResourceBundle.getBundle(FacesMessage.FACES_MESSAGES,locale,Thread.currentThread().getContextClassLoader());
    if (null == bundle) {
      throw new NullPointerException();
    }
    try {
      summary=bundle.getString(messageId);
      detail=bundle.getString(messageId + "String_Node_Str");
    }
 catch (    MissingResourceException e) {
    }
  }
  for (int i=0; i < params.length; i++) {
    summary=summary.replace("String_Node_Str" + i + "String_Node_Str",params[i]);
    detail=detail.replace("String_Node_Str" + i + "String_Node_Str",params[i]);
  }
  FacesMessage ret=new FacesMessage(FacesMessage.SEVERITY_ERROR,summary,detail);
  ret.setSeverity(FacesMessage.SEVERITY_ERROR);
  return ret;
}

Fixed version (ground truth):
/** 
 * <p> Creates and returns a FacesMessage for the specified Locale. </p> Simplified and streamlined version of the implementation of Mojarra 2.2.8-b02 (see MessageFactory).
 * @param messageId - the key of the message in the resource bundle
 * @param params - substitution parameters
 * @return a localized <code>FacesMessage</code> with the severity of FacesMessage.SEVERITY_ERROR
 */
public static FacesMessage getMessage(String messageId,String... params){
  String summary=null;
  String detail=null;
  ResourceBundle bundle;
  String bundleName;
  FacesContext context=FacesContext.getCurrentInstance();
  Locale locale=context.getViewRoot().getLocale();
  Application app=(FacesContext.getCurrentInstance().getApplication());
  if (null != (bundleName=app.getMessageBundle())) {
    if (null != (bundle=ResourceBundle.getBundle(bundleName,locale,Thread.currentThread().getContextClassLoader()))) {
      try {
        summary=bundle.getString(messageId);
        detail=bundle.getString(messageId + "String_Node_Str");
      }
 catch (      MissingResourceException e) {
      }
    }
  }
  if (null == summary) {
    bundle=ResourceBundle.getBundle(FacesMessage.FACES_MESSAGES,locale,Thread.currentThread().getContextClassLoader());
    if (null == bundle) {
      throw new NullPointerException();
    }
    try {
      summary=bundle.getString(messageId);
      detail=bundle.getString(messageId + "String_Node_Str");
    }
 catch (    MissingResourceException e) {
    }
  }
  for (int i=0; i < params.length; i++) {
    summary=summary.replace("String_Node_Str" + i + "String_Node_Str",params[i]);
    detail=detail.replace("String_Node_Str" + i + "String_Node_Str",params[i]);
  }
  FacesMessage ret=new FacesMessage(FacesMessage.SEVERITY_ERROR,summary,detail);
  ret.setSeverity(FacesMessage.SEVERITY_ERROR);
  return ret;
}