Program: 88503
Project: 88503
Buggy source:
/** 
 * Validates that a string contains no spaces and is non-null/non-empty Throw an exception if the string contains whitespace.  Whitespace is not allowed in tagNames and attributes.
 * @param string any string
 * @throws IllegalArgumentException
 */
public static String validate(String string){
  if (string == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int i, length=string.length();
  if (length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (i=0; i < length; i+=1) {
    if (Character.isWhitespace(string.charAt(i))) {
      throw new IllegalArgumentException("String_Node_Str" + string + "String_Node_Str");
    }
  }
  return string;
}

Fixed version (ground truth):
/** 
 * Validates that a string is a valid tag or attribute name i.e. it contains no spaces and is non-null/non-empty Whitespace is not allowed in tagNames and attributes. XML elements must follow these naming rules: Names can contain letters, numbers, and other characters Names cannot start with a number or punctuation character (and a few others) Names cannot start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces See http://www.w3.org/TR/REC-xml/#sec-common-syn Names beginning with the string "xml", or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')),  are reserved for standardization in this or future versions of this specification.
 * @param string any string
 * @param correct if true then correct any errors found (if possible)
 * @return the valid string
 * @throws IllegalArgumentException if the string is invalid (and cannot be corrected)
 */
public static String validate(String string){
  boolean correct=true;
  if (string == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int i, length=string.length();
  if (length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  StringBuilder sb=new StringBuilder();
  for (i=0; i < length; i+=1) {
    char c=string.charAt(i);
    if (i == 0) {
      if (!Character.isLetter(c) && '_' != c && ':' != c) {
        if (correct) {
          sb.append('_');
        }
 else {
          throw new IllegalArgumentException("String_Node_Str" + string + "String_Node_Str"+ c+ "String_Node_Str");
        }
        continue;
      }
 else       if ('x' == c || 'X' == c) {
        if (string.toLowerCase().startsWith("String_Node_Str")) {
          if (correct) {
            sb.append('_');
            i+=2;
          }
 else {
            throw new IllegalArgumentException("String_Node_Str" + string + "String_Node_Str");
          }
          continue;
        }
      }
    }
    if (Character.isWhitespace(c)) {
      if (correct) {
        sb.append('_');
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + string + "String_Node_Str");
      }
    }
 else     if (!Character.isLetterOrDigit(c) && ':' != c && '-' != c && '.' != c && '_' != c) {
      if (correct) {
        sb.append('_');
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + string + "String_Node_Str"+ c+ "String_Node_Str");
      }
    }
 else {
      sb.append(c);
    }
  }
  return sb.toString();
}