Program: 98196
Project: 98196
Buggy source:
private QueryTerm parseTerm(){
  trim();
  if (charAt0() == '(') {
    throw new UnsupportedOperationException();
  }
  Object value=null;
  String paramName=null;
  COMP_OP op=null;
  String fName=null;
  Class<?> type=null;
  int pos0=pos();
  char c=charAt0();
  while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| (c == '_')|| (c == '.')) {
    inc();
    if (c == '.') {
      String dummy=substring(pos0,pos());
      if (dummy.equals("String_Node_Str")) {
        pos0=pos();
      }
 else {
        fName=substring(pos0,pos() - 1);
        pos0=pos();
      }
    }
    c=charAt0();
  }
  if (fName == null) {
    fName=substring(pos0,pos());
  }
  if (fName.equals("String_Node_Str")) {
    throw new JDOUserException("String_Node_Str" + pos0 + "String_Node_Str");
  }
  pos0=pos();
  trim();
  try {
    ZooFieldDef f=fields.get(fName);
    if (f == null) {
      throw new JDOFatalInternalException("String_Node_Str" + fName);
    }
    type=f.getJavaType();
  }
 catch (  SecurityException e) {
    throw new JDOUserException("String_Node_Str" + fName,e);
  }
  c=charAt0();
  char c2=charAt(1);
  char c3=charAt(2);
  if (c == '=' && c2 == '=' && c3 == ' ') {
    op=COMP_OP.EQ;
  }
 else   if (c == '<') {
    if (c2 == '=' && c3 == ' ') {
      op=COMP_OP.LE;
    }
 else     if (c2 == ' ') {
      op=COMP_OP.L;
    }
  }
 else   if (c == '>') {
    if (c2 == '=' && c3 == ' ') {
      op=COMP_OP.AE;
    }
 else     if (c2 == ' ') {
      op=COMP_OP.A;
    }
  }
 else   if (c == '!' && c2 == '=' && c3 == ' ') {
    op=COMP_OP.NE;
  }
  if (op == null) {
    throw new JDOUserException("String_Node_Str" + c + c2+ c3+ "String_Node_Str"+ pos0);
  }
  inc(op._len);
  trim();
  pos0=pos();
  c=charAt0();
  if ((len() >= 4 && substring(pos0,pos0 + 4).equals("String_Node_Str")) && (len() == 4 || (len() > 4 && (charAt(4) == ' ' || charAt(4) == ')')))) {
    if (type.isPrimitive()) {
      throw new JDOUserException("String_Node_Str" + pos0);
    }
    value=NULL;
  }
 else   if (c == '"' || c == '\'') {
    boolean singleQuote=c == '\'';
    if (!String.class.isAssignableFrom(type)) {
      throw new JDOUserException("String_Node_Str" + type.getName());
    }
    inc();
    pos0=pos();
    c=charAt0();
    while (true) {
      if ((!singleQuote && c == '"') || (singleQuote && c == '\'')) {
        break;
      }
 else       if (c == '\\') {
        inc();
      }
      inc();
      c=charAt0();
    }
    value=substring(pos0,pos());
    inc();
  }
 else   if (c == '-' || (c > '0' && c < '9')) {
    pos0=pos();
    boolean isHex=false;
    while (!isFinished()) {
      c=charAt0();
      if (c == ')' || c == ' ') {
        break;
      }
 else       if (c == 'x') {
        isHex=true;
      }
      inc();
    }
    if (type == Double.TYPE || type == Double.class) {
      value=Double.parseDouble(substring(pos0,pos()));
    }
 else     if (type == Float.TYPE || type == Float.class) {
      value=Float.parseFloat(substring(pos0,pos()));
    }
 else     if (type == Long.TYPE || type == Long.class) {
      if (isHex) {
        value=Long.parseLong(substring(pos0,pos()),16);
      }
 else {
        value=Long.parseLong(substring(pos0,pos()));
      }
    }
 else     if (type == Integer.TYPE || type == Integer.class) {
      if (isHex) {
        value=Integer.parseInt(substring(pos0,pos()),16);
      }
 else {
        value=Integer.parseInt(substring(pos0,pos()));
      }
    }
 else     if (type == Short.TYPE || type == Short.class) {
      if (isHex) {
        value=Short.parseShort(substring(pos0,pos()),16);
      }
 else {
        value=Short.parseShort(substring(pos0,pos()));
      }
    }
 else     if (type == Byte.TYPE || type == Byte.class) {
      if (isHex) {
        value=Byte.parseByte(substring(pos0,pos()),16);
      }
 else {
        value=Byte.parseByte(substring(pos0,pos()));
      }
    }
 else     if (type == BigDecimal.class) {
      value=new BigDecimal(substring(pos0,pos()));
    }
 else     if (type == BigInteger.class) {
      value=new BigInteger(substring(pos0,pos()));
    }
 else {
      throw new JDOUserException("String_Node_Str" + type.getName());
    }
  }
 else   if (type == Boolean.TYPE || type == Boolean.class) {
    if (substring(pos0,pos0 + 4).toLowerCase().equals("String_Node_Str") && (isFinished(4) || charAt(4) == ' ' || charAt(4) == ')')) {
      value=true;
      inc(4);
    }
 else     if (substring(pos0,pos0 + 5).toLowerCase().equals("String_Node_Str") && (isFinished(5) || charAt(5) == ' ' || charAt(5) == ')')) {
      value=false;
      inc(5);
    }
 else {
      throw new JDOUserException("String_Node_Str" + substring(pos0,pos0 + 5));
    }
  }
 else {
    while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| (c == '_')|| (c == '"')) {
      inc();
      if (isFinished())       break;
      c=charAt0();
    }
    paramName=substring(pos0,pos());
  }
  if (fName == null || (value == null && paramName == null) || op == null) {
    throw new JDOUserException("String_Node_Str" + pos() + "String_Node_Str"+ str);
  }
  trim();
  return new QueryTerm(op,paramName,value,clsDef.getField(fName));
}

Fixed version (ground truth):
private QueryTerm parseTerm(){
  trim();
  if (charAt0() == '(') {
    throw new UnsupportedOperationException();
  }
  Object value=null;
  String paramName=null;
  COMP_OP op=null;
  String fName=null;
  Class<?> type=null;
  int pos0=pos();
  char c=charAt0();
  while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| (c == '_')|| (c == '.')) {
    inc();
    if (c == '.') {
      String dummy=substring(pos0,pos());
      if (dummy.equals("String_Node_Str")) {
        pos0=pos();
      }
 else {
        fName=substring(pos0,pos() - 1);
        pos0=pos();
      }
    }
    c=charAt0();
  }
  if (fName == null) {
    fName=substring(pos0,pos());
  }
  if (fName.equals("String_Node_Str")) {
    throw new JDOUserException("String_Node_Str" + pos0 + "String_Node_Str");
  }
  pos0=pos();
  trim();
  try {
    ZooFieldDef f=fields.get(fName);
    if (f == null) {
      throw new JDOFatalInternalException("String_Node_Str" + fName);
    }
    type=f.getJavaType();
  }
 catch (  SecurityException e) {
    throw new JDOUserException("String_Node_Str" + fName,e);
  }
  c=charAt0();
  char c2=charAt(1);
  char c3=charAt(2);
  if (c == '=' && c2 == '=' && c3 == ' ') {
    op=COMP_OP.EQ;
  }
 else   if (c == '<') {
    if (c2 == '=' && c3 == ' ') {
      op=COMP_OP.LE;
    }
 else     if (c2 == ' ') {
      op=COMP_OP.L;
    }
  }
 else   if (c == '>') {
    if (c2 == '=' && c3 == ' ') {
      op=COMP_OP.AE;
    }
 else     if (c2 == ' ') {
      op=COMP_OP.A;
    }
  }
 else   if (c == '!' && c2 == '=' && c3 == ' ') {
    op=COMP_OP.NE;
  }
  if (op == null) {
    throw new JDOUserException("String_Node_Str" + c + c2+ c3+ "String_Node_Str"+ pos0);
  }
  inc(op._len);
  trim();
  pos0=pos();
  c=charAt0();
  if ((len() >= 4 && substring(pos0,pos0 + 4).equals("String_Node_Str")) && (len() == 4 || (len() > 4 && (charAt(4) == ' ' || charAt(4) == ')')))) {
    if (type.isPrimitive()) {
      throw new JDOUserException("String_Node_Str" + pos0);
    }
    value=NULL;
    inc(4);
  }
 else   if (c == '"' || c == '\'') {
    boolean singleQuote=c == '\'';
    if (!String.class.isAssignableFrom(type)) {
      throw new JDOUserException("String_Node_Str" + type.getName());
    }
    inc();
    pos0=pos();
    c=charAt0();
    while (true) {
      if ((!singleQuote && c == '"') || (singleQuote && c == '\'')) {
        break;
      }
 else       if (c == '\\') {
        inc();
      }
      inc();
      c=charAt0();
    }
    value=substring(pos0,pos());
    inc();
  }
 else   if (c == '-' || (c >= '0' && c <= '9')) {
    pos0=pos();
    boolean isHex=false;
    while (!isFinished()) {
      c=charAt0();
      if (c == ')' || c == ' ') {
        break;
      }
 else       if (c == 'x') {
        isHex=true;
      }
      inc();
    }
    if (type == Double.TYPE || type == Double.class) {
      value=Double.parseDouble(substring(pos0,pos()));
    }
 else     if (type == Float.TYPE || type == Float.class) {
      value=Float.parseFloat(substring(pos0,pos()));
    }
 else     if (type == Long.TYPE || type == Long.class) {
      if (isHex) {
        value=Long.parseLong(substring(pos0,pos()),16);
      }
 else {
        value=Long.parseLong(substring(pos0,pos()));
      }
    }
 else     if (type == Integer.TYPE || type == Integer.class) {
      if (isHex) {
        value=Integer.parseInt(substring(pos0,pos()),16);
      }
 else {
        value=Integer.parseInt(substring(pos0,pos()));
      }
    }
 else     if (type == Short.TYPE || type == Short.class) {
      if (isHex) {
        value=Short.parseShort(substring(pos0,pos()),16);
      }
 else {
        value=Short.parseShort(substring(pos0,pos()));
      }
    }
 else     if (type == Byte.TYPE || type == Byte.class) {
      if (isHex) {
        value=Byte.parseByte(substring(pos0,pos()),16);
      }
 else {
        value=Byte.parseByte(substring(pos0,pos()));
      }
    }
 else     if (type == BigDecimal.class) {
      value=new BigDecimal(substring(pos0,pos()));
    }
 else     if (type == BigInteger.class) {
      value=new BigInteger(substring(pos0,pos()));
    }
 else {
      throw new JDOUserException("String_Node_Str" + type.getName());
    }
  }
 else   if (type == Boolean.TYPE || type == Boolean.class) {
    if (substring(pos0,pos0 + 4).toLowerCase().equals("String_Node_Str") && (isFinished(4) || charAt(4) == ' ' || charAt(4) == ')')) {
      value=true;
      inc(4);
    }
 else     if (substring(pos0,pos0 + 5).toLowerCase().equals("String_Node_Str") && (isFinished(5) || charAt(5) == ' ' || charAt(5) == ')')) {
      value=false;
      inc(5);
    }
 else {
      throw new JDOUserException("String_Node_Str" + substring(pos0,pos0 + 5));
    }
  }
 else {
    while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| (c == '_')|| (c == '"')) {
      inc();
      if (isFinished())       break;
      c=charAt0();
    }
    paramName=substring(pos0,pos());
  }
  if (fName == null || (value == null && paramName == null) || op == null) {
    throw new JDOUserException("String_Node_Str" + pos() + "String_Node_Str"+ str);
  }
  trim();
  return new QueryTerm(op,paramName,value,clsDef.getField(fName));
}