Program: 64147
Project: 64147
Buggy source:
/** 
 * Parses a comma-separated list of method names and check their validity.
 * @param methodNames comma-separated list of method names to be parsed
 * @return array of individual test method names
 * @exception java.lang.IllegalArgumentException if the given string is <code>null</code> or if it is not a comma-separated list of valid Java identifiers; an empty string is acceptable and is handled as an empty list
 * @since 1.8.2
 */
public static String[] parseTestMethodNamesList(String methodNames) throws IllegalArgumentException {
  if (methodNames == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  methodNames=methodNames.trim();
  int length=methodNames.length();
  if (length == 0) {
    return new String[0];
  }
  if (methodNames.charAt(length - 1) == ',') {
    methodNames=methodNames.substring(0,length - 1).trim();
    length=methodNames.length();
    if (length == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  final char[] chars=methodNames.toCharArray();
  if (chars[0] == ',') {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int wordCount=1;
  for (int i=1; i < chars.length; i++) {
    if (chars[i] == ',') {
      wordCount++;
    }
  }
  String[] result=new String[wordCount];
  final int stateBeforeWord=1;
  final int stateInsideWord=2;
  final int stateAfterWord=3;
  int state=stateBeforeWord;
  int wordStartIndex=-1;
  int wordIndex=0;
  for (int i=0; i < chars.length; i++) {
    char c=chars[i];
switch (state) {
case stateBeforeWord:
      if (c == ',') {
        throw new IllegalArgumentException("String_Node_Str");
      }
 else       if (c == ' ') {
      }
 else       if (Character.isJavaIdentifierStart(c)) {
        wordStartIndex=i;
        state=stateInsideWord;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + c);
      }
    break;
case stateInsideWord:
  if (c == ',') {
    result[wordIndex++]=new String(methodNames.substring(wordStartIndex,i));
    state=stateBeforeWord;
  }
 else   if (c == ' ') {
    result[wordIndex++]=new String(methodNames.substring(wordStartIndex,i));
    state=stateAfterWord;
  }
 else   if (Character.isJavaIdentifierPart(c)) {
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + c);
  }
break;
case stateAfterWord:
if (c == ',') {
state=stateBeforeWord;
}
 else if (c == ' ') {
}
 else {
throw new IllegalArgumentException("String_Node_Str");
}
break;
default :
}
}
switch (state) {
case stateBeforeWord:
case stateAfterWord:
break;
case stateInsideWord:
result[wordIndex++]=new String(methodNames.substring(wordStartIndex,chars.length));
break;
default :
}
return result;
}

Fixed version (ground truth):
/** 
 * Parses a comma-separated list of method names and check their validity.
 * @param methodNames comma-separated list of method names to be parsed
 * @return array of individual test method names
 * @exception java.lang.IllegalArgumentException if the given string is <code>null</code> or if it is not a comma-separated list of valid Java identifiers; an empty string is acceptable and is handled as an empty list
 * @since 1.8.2
 */
public static String[] parseTestMethodNamesList(String methodNames) throws IllegalArgumentException {
  if (methodNames == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  methodNames=methodNames.trim();
  int length=methodNames.length();
  if (length == 0) {
    return new String[0];
  }
  if (methodNames.charAt(length - 1) == ',') {
    methodNames=methodNames.substring(0,length - 1).trim();
    length=methodNames.length();
    if (length == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  final char[] chars=methodNames.toCharArray();
  if (chars[0] == ',') {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int wordCount=1;
  for (int i=1; i < chars.length; i++) {
    if (chars[i] == ',') {
      wordCount++;
    }
  }
  String[] result=new String[wordCount];
  final int stateBeforeWord=1;
  final int stateInsideWord=2;
  final int stateAfterWord=3;
  int state=stateBeforeWord;
  int wordStartIndex=-1;
  int wordIndex=0;
  for (int i=0; i < chars.length; i++) {
    char c=chars[i];
switch (state) {
case stateBeforeWord:
      if (c == ',') {
        throw new IllegalArgumentException("String_Node_Str");
      }
 else       if (c == ' ') {
      }
 else       if (Character.isJavaIdentifierStart(c)) {
        wordStartIndex=i;
        state=stateInsideWord;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + c);
      }
    break;
case stateInsideWord:
  if (c == ',') {
    result[wordIndex++]=methodNames.substring(wordStartIndex,i);
    state=stateBeforeWord;
  }
 else   if (c == ' ') {
    result[wordIndex++]=methodNames.substring(wordStartIndex,i);
    state=stateAfterWord;
  }
 else   if (Character.isJavaIdentifierPart(c)) {
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + c);
  }
break;
case stateAfterWord:
if (c == ',') {
state=stateBeforeWord;
}
 else if (c == ' ') {
}
 else {
throw new IllegalArgumentException("String_Node_Str");
}
break;
default :
}
}
switch (state) {
case stateBeforeWord:
case stateAfterWord:
break;
case stateInsideWord:
result[wordIndex++]=methodNames.substring(wordStartIndex,chars.length);
break;
default :
}
return result;
}