Program: 47910
Project: 47910
Buggy source:
private Record updateRecord(Record record,boolean useLatestRecordType,List<MutationCondition> conditions,FieldTypes fieldTypes) throws RepositoryException {
  RecordId recordId=record.getId();
  try {
    Pair<Record,Long> recordAndOcc=readWithOcc(record.getId(),null,null,fieldTypes);
    Record originalRecord=new UnmodifiableRecord(recordAndOcc.getV1());
    long oldOcc=recordAndOcc.getV2();
    long newOcc=oldOcc + 1;
    RecordEvent recordEvent=new RecordEvent();
    recordEvent.setType(Type.UPDATE);
    recordEvent.setTableName(getTableName());
    for (    RecordUpdateHook hook : updateHooks) {
      hook.beforeUpdate(record,originalRecord,this,fieldTypes,recordEvent);
    }
    Record newRecord=record.cloneRecord();
    Put put=new Put(newRecord.getId().toBytes());
    Set<BlobReference> referencedBlobs=new HashSet<BlobReference>();
    Set<BlobReference> unReferencedBlobs=new HashSet<BlobReference>();
    long newVersion=originalRecord.getVersion() == null ? 1 : originalRecord.getVersion() + 1;
    if (calculateRecordChanges(newRecord,originalRecord,newVersion,put,recordEvent,referencedBlobs,unReferencedBlobs,useLatestRecordType,fieldTypes)) {
      Record conditionsResponse=MutationConditionVerifier.checkConditions(originalRecord,conditions,this,record);
      if (conditionsResponse != null) {
        return conditionsResponse;
      }
      if (record.hasAttributes()) {
        recordEvent.setAttributes(record.getAttributes());
      }
      reserveBlobs(record.getId(),referencedBlobs);
      put.add(RecordCf.DATA.bytes,RecordColumn.PAYLOAD.bytes,recordEvent.toJsonBytes());
      put.add(RecordCf.DATA.bytes,RecordColumn.OCC.bytes,1L,Bytes.toBytes(newOcc));
      boolean occSuccess=recordTable.checkAndPut(put.getRow(),RecordCf.DATA.bytes,RecordColumn.OCC.bytes,Bytes.toBytes(oldOcc),put);
      if (!occSuccess) {
        throw new ConcurrentRecordUpdateException(recordId);
      }
      blobManager.handleBlobReferences(recordId,referencedBlobs,unReferencedBlobs);
      newRecord.setResponseStatus(ResponseStatus.UPDATED);
    }
 else {
      newRecord.setResponseStatus(ResponseStatus.UP_TO_DATE);
    }
    newRecord.getFieldsToDelete().clear();
    return newRecord;
  }
 catch (  IOException e) {
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
catch (  BlobException e) {
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private Record updateRecord(Record record,boolean useLatestRecordType,List<MutationCondition> conditions,FieldTypes fieldTypes) throws RepositoryException {
  RecordId recordId=record.getId();
  try {
    Pair<Record,Long> recordAndOcc=readWithOcc(record.getId(),null,null,fieldTypes);
    Record originalRecord=new UnmodifiableRecord(recordAndOcc.getV1());
    long oldOcc=recordAndOcc.getV2();
    long newOcc=oldOcc + 1;
    RecordEvent recordEvent=new RecordEvent();
    recordEvent.setType(Type.UPDATE);
    recordEvent.setTableName(getTableName());
    for (    RecordUpdateHook hook : updateHooks) {
      hook.beforeUpdate(record,originalRecord,this,fieldTypes,recordEvent);
    }
    Record newRecord=record.cloneRecord();
    Put put=new Put(newRecord.getId().toBytes());
    Set<BlobReference> referencedBlobs=new HashSet<BlobReference>();
    Set<BlobReference> unReferencedBlobs=new HashSet<BlobReference>();
    long newVersion=originalRecord.getVersion() == null ? 1 : originalRecord.getVersion() + 1;
    Record conditionsResponse=MutationConditionVerifier.checkConditions(originalRecord,conditions,this,record);
    if (conditionsResponse != null) {
      return conditionsResponse;
    }
    if (calculateRecordChanges(newRecord,originalRecord,newVersion,put,recordEvent,referencedBlobs,unReferencedBlobs,useLatestRecordType,fieldTypes)) {
      if (record.hasAttributes()) {
        recordEvent.setAttributes(record.getAttributes());
      }
      reserveBlobs(record.getId(),referencedBlobs);
      put.add(RecordCf.DATA.bytes,RecordColumn.PAYLOAD.bytes,recordEvent.toJsonBytes());
      put.add(RecordCf.DATA.bytes,RecordColumn.OCC.bytes,1L,Bytes.toBytes(newOcc));
      boolean occSuccess=recordTable.checkAndPut(put.getRow(),RecordCf.DATA.bytes,RecordColumn.OCC.bytes,Bytes.toBytes(oldOcc),put);
      if (!occSuccess) {
        throw new ConcurrentRecordUpdateException(recordId);
      }
      blobManager.handleBlobReferences(recordId,referencedBlobs,unReferencedBlobs);
      newRecord.setResponseStatus(ResponseStatus.UPDATED);
    }
 else {
      newRecord.setResponseStatus(ResponseStatus.UP_TO_DATE);
    }
    newRecord.getFieldsToDelete().clear();
    return newRecord;
  }
 catch (  IOException e) {
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
catch (  BlobException e) {
    throw new RecordException("String_Node_Str" + recordId + "String_Node_Str",e);
  }
}