Program: 98022
Project: 98022
Buggy source:
private void updateFieldIndicesGO(){
  final GenericObject[] buffer=this.bufferGO;
  final int bufferCnt=this.bufferGOCnt;
  int iInd=-1;
  int iField=-1;
  for (  ZooFieldDef field : cls.getAllFields()) {
    iField++;
    if (!field.isIndexed()) {
      continue;
    }
    iInd++;
    SchemaIndexEntry schemaTop=node.getSchemaIE(field.getDeclaringType());
    LongLongIndex fieldInd=(LongLongIndex)schemaTop.getIndex(field);
    try {
      for (int i=0; i < bufferCnt; i++) {
        GenericObject co=buffer[i];
        final long l;
        if (field.isString()) {
          l=(Long)co.getFieldRaw(iField);
        }
 else {
          Object primO=co.getFieldRaw(iField);
          l=SerializerTools.primitiveToLong(primO,field.getPrimitiveType());
        }
        if (!co.jdoZooIsNew()) {
          long lOld=co.jdoZooGetBackup()[iInd];
          if (lOld == l) {
            continue;
          }
          fieldInd.removeLong(lOld,co.getOid());
        }
        if (field.isIndexUnique()) {
          if (!fieldInd.insertLongIfNotSet(l,co.getOid())) {
            if (fieldUpdateBuffer[iField] == null) {
              fieldUpdateBuffer[iField]=new ArrayList<Pair>();
            }
            fieldUpdateBuffer[iField].add(new Pair(co.getOid(),l));
          }
        }
 else {
          fieldInd.insertLong(l,co.getOid());
        }
      }
    }
 catch (    IllegalArgumentException e) {
      throw DBLogger.newFatal("String_Node_Str" + field.getName(),e);
    }
  }
}

Fixed version (ground truth):
private void updateFieldIndicesGO(){
  final GenericObject[] buffer=this.bufferGO;
  final int bufferCnt=this.bufferGOCnt;
  int iInd=-1;
  int iField=-1;
  for (  ZooFieldDef field : cls.getAllFields()) {
    iField++;
    if (!field.isIndexed()) {
      continue;
    }
    iInd++;
    SchemaIndexEntry schemaTop=node.getSchemaIE(field.getDeclaringType());
    LongLongIndex fieldInd=(LongLongIndex)schemaTop.getIndex(field);
    try {
      for (int i=0; i < bufferCnt; i++) {
        GenericObject co=buffer[i];
        final long l;
        String str=null;
        if (field.isString()) {
          l=(Long)co.getFieldRaw(iField);
          str=(String)co.getField(field);
        }
 else {
          Object primO=co.getFieldRaw(iField);
          l=SerializerTools.primitiveToLong(primO,field.getPrimitiveType());
        }
        if (!co.jdoZooIsNew()) {
          long lOld=co.jdoZooGetBackup().getA()[iInd];
          if (lOld == l) {
            if (field.isString()) {
              String str2=(String)co.jdoZooGetBackup().getB()[iInd];
              if ((str == null && str2 == null) || str.equals(str2)) {
                continue;
              }
            }
 else {
              continue;
            }
          }
          fieldInd.removeLong(lOld,co.getOid());
        }
        if (field.isIndexUnique()) {
          if (!fieldInd.insertLongIfNotSet(l,co.getOid())) {
            bufferIndexUpdate(iField,co,l);
          }
        }
 else         if (field.isString()) {
          bufferIndexUpdate(iField,co,l);
        }
 else {
          fieldInd.insertLong(l,co.getOid());
        }
      }
    }
 catch (    IllegalArgumentException e) {
      throw DBLogger.newFatal("String_Node_Str" + field.getName(),e);
    }
  }
}