Program: 6510
Project: 6510
Buggy source:
/** 
 * Helper method to create a string that enforces the 'whiteSpace' restriction on the given member variable. Possible values for 'whiteSpace' are 'preserve', 'replace' and 'collapse'. Value 'preserve' means that the value of the member variable remains unchanged. Value 'replace' means that all whitespace characters (line feeds, tabs, spaces and carriage returns) will be replaced by spaces. Value 'collapse' means that multiple whitespace characters will be replaced with a single space plus leading and tailing whitespace characters will be trimmed.
 * @param memberName Name of member variable to check
 * @param whiteSpace Either 'preserve', 'replace' or 'collapse'
 * @return String that enforces 'whiteSpace' restriction
 * @throws Exception Invalid value for 'whiteSpace' provided
 */
public static String createWhiteSpaceCheckCode(final String memberName,final String whiteSpace) throws Exception {
  String result="String_Node_Str";
  String message="String_Node_Str";
  if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+=String.format("String_Node_Str",memberName,memberName);
  }
 else   if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+="String_Node_Str";
    result+=String.format("String_Node_Str",memberName);
    result+=String.format("String_Node_Str",memberName,memberName,memberName);
  }
 else   if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+=String.format("String_Node_Str",memberName);
    result+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
    result+=String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",memberName,memberName);
    result+=String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",memberName,memberName,memberName);
  }
 else {
    throw new FabricTypeGenException(String.format("String_Node_Str" + "String_Node_Str",whiteSpace,memberName));
  }
  result+="String_Node_Str";
  return result;
}

Fixed version (ground truth):
/** 
 * Helper method to create a string that enforces the 'whiteSpace' restriction on the given member variable. Possible values for 'whiteSpace' are 'preserve', 'replace' and 'collapse'. Value 'preserve' means that the value of the member variable remains unchanged. Value 'replace' means that all whitespace characters (line feeds, tabs, spaces and carriage returns) will be replaced by spaces. Value 'collapse' means that multiple whitespace characters will be replaced with a single space plus leading and tailing whitespace characters will be trimmed.
 * @param memberName Name of member variable to check
 * @param whiteSpace Either 'preserve', 'replace' or 'collapse'
 * @return String that enforces 'whiteSpace' restriction
 * @throws Exception Invalid value for 'whiteSpace' provided
 */
public static String createWhiteSpaceCheckCode(final String memberName,final String whiteSpace) throws Exception {
  String result="String_Node_Str";
  String message="String_Node_Str";
  if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+=String.format("String_Node_Str",memberName,memberName);
  }
 else   if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+="String_Node_Str";
    result+=String.format("String_Node_Str",memberName);
    result+=String.format("String_Node_Str",memberName,memberName,memberName);
  }
 else   if (("String_Node_Str").equals(whiteSpace)) {
    result+=String.format(message,"String_Node_Str");
    result+=String.format("String_Node_Str" + "String_Node_Str",memberName);
    result+="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
    result+=String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",memberName,memberName);
    result+=String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",memberName,memberName,memberName);
  }
 else {
    throw new FabricTypeGenException(String.format("String_Node_Str" + "String_Node_Str",whiteSpace,memberName));
  }
  result+="String_Node_Str";
  return result;
}