Program: 131846
Project: 131846
Buggy source:
protected Term extractTerm(String line){
  String spacedLine="String_Node_Str";
  for (  char c : line.toCharArray()) {
    if (c == '(' || c == ')' || c == ',') {
      spacedLine+=' ';
    }
 else     if (c == ':') {
      spacedLine+="String_Node_Str";
    }
 else     if (c == '=') {
      spacedLine+="String_Node_Str";
    }
 else {
      spacedLine+=c;
    }
  }
  final int S_KWTERM=1, S_NAME=2, S_ASSIGN=3, S_TERM_CLASS=4, S_PARAMETERS=5;
  int state=S_KWTERM;
  StringTokenizer tokenizer=new StringTokenizer(spacedLine);
  String token="String_Node_Str", name="String_Node_Str", termClass="String_Node_Str";
  List<String> parameters=new ArrayList<>();
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    if (state == S_KWTERM && "String_Node_Str".equals(token)) {
      state=S_NAME;
      continue;
    }
    if (state == S_NAME) {
      name=token;
      state=S_ASSIGN;
      continue;
    }
    if (state == S_ASSIGN && "String_Node_Str".equals(token)) {
      state=S_TERM_CLASS;
      continue;
    }
    if (state == S_TERM_CLASS) {
      if (Op.isNumeric(token)) {
        termClass=Constant.class.getSimpleName();
        parameters.add(token);
      }
 else       if ("String_Node_Str".equals(token)) {
        termClass=Discrete.class.getSimpleName();
      }
 else {
        termClass=token;
      }
      state=S_PARAMETERS;
      continue;
    }
    if (state == S_PARAMETERS) {
      if (!Function.class.getSimpleName().equals(termClass) && ("String_Node_Str".equals(token) || "String_Node_Str".equals(token) || "String_Node_Str".equals(token))) {
        continue;
      }
      if ("String_Node_Str".equals(token)) {
        break;
      }
      parameters.add(token.trim());
    }
  }
  if (state <= S_ASSIGN) {
    throw new RuntimeException("String_Node_Str" + line);
  }
  double[] values=new double[parameters.size()];
  if (!Function.class.getSimpleName().equals(termClass)) {
    String parameter="String_Node_Str";
    try {
      for (int i=0; i < parameters.size(); ++i) {
        parameter=parameters.get(i);
        values[i]=Op.toDouble(parameter);
      }
    }
 catch (    Exception ex) {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",parameter,line));
    }
  }
  try {
    Term result=FactoryManager.instance().term().createInstance(termClass,values);
    result.setName(Op.makeValidId(name));
    if (Function.class.getSimpleName().equals(termClass) && !parameters.isEmpty()) {
      String infix=Op.join(parameters,"String_Node_Str");
      if (infix.length() > 1 && infix.charAt(0) == '(' && infix.charAt(infix.length() - 1) == ')') {
        infix=infix.substring(1,infix.length() - 2);
      }
      ((Function)result).setText(infix);
    }
    return result;
  }
 catch (  Exception ex) {
    throw ex;
  }
}

Fixed version (ground truth):
protected Term extractTerm(String line){
  String spacedLine="String_Node_Str";
  for (  char c : line.toCharArray()) {
    if (c == '(' || c == ')' || c == ',') {
      spacedLine+="String_Node_Str" + c + "String_Node_Str";
    }
 else     if (c == ':') {
      spacedLine+="String_Node_Str";
    }
 else     if (c == '=') {
      spacedLine+="String_Node_Str";
    }
 else {
      spacedLine+=c;
    }
  }
  final int S_KWTERM=1, S_NAME=2, S_ASSIGN=3, S_TERM_CLASS=4, S_PARAMETERS=5;
  int state=S_KWTERM;
  StringTokenizer tokenizer=new StringTokenizer(spacedLine);
  String token, name="String_Node_Str", termClass="String_Node_Str";
  List<String> parameters=new ArrayList<>();
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    if (state == S_KWTERM && "String_Node_Str".equals(token)) {
      state=S_NAME;
      continue;
    }
    if (state == S_NAME) {
      name=token;
      state=S_ASSIGN;
      continue;
    }
    if (state == S_ASSIGN && "String_Node_Str".equals(token)) {
      state=S_TERM_CLASS;
      continue;
    }
    if (state == S_TERM_CLASS) {
      if (Op.isNumeric(token)) {
        termClass=Constant.class.getSimpleName();
        parameters.add(token);
      }
 else       if ("String_Node_Str".equals(token)) {
        termClass=Discrete.class.getSimpleName();
      }
 else {
        termClass=token;
      }
      state=S_PARAMETERS;
      continue;
    }
    if (state == S_PARAMETERS) {
      if (!Function.class.getSimpleName().equals(termClass) && ("String_Node_Str".equals(token) || "String_Node_Str".equals(token) || "String_Node_Str".equals(token))) {
        continue;
      }
      if ("String_Node_Str".equals(token)) {
        break;
      }
      parameters.add(token.trim());
    }
  }
  if (state <= S_ASSIGN) {
    throw new RuntimeException("String_Node_Str" + line);
  }
  double[] values=new double[parameters.size()];
  if (!Function.class.getSimpleName().equals(termClass)) {
    String parameter="String_Node_Str";
    try {
      for (int i=0; i < parameters.size(); ++i) {
        parameter=parameters.get(i);
        values[i]=Op.toDouble(parameter);
      }
    }
 catch (    Exception ex) {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",parameter,line));
    }
  }
  try {
    Term result=FactoryManager.instance().term().createInstance(termClass,values);
    result.setName(Op.makeValidId(name));
    if (Function.class.getSimpleName().equals(termClass) && !parameters.isEmpty()) {
      String infix=Op.join(parameters,"String_Node_Str");
      if (infix.length() > 1 && infix.charAt(0) == '(' && infix.charAt(infix.length() - 1) == ')') {
        infix=infix.substring(1,infix.length() - 1);
      }
      ((Function)result).setText(infix);
    }
    return result;
  }
 catch (  Exception ex) {
    throw ex;
  }
}