Program: 152411
Project: 152411
Buggy source:
private void flushTransactionalChanges(){
  if (VERBOSE_LOGGING) {
    Log.v(TAG,"String_Node_Str" + (inProfileMode() ? "String_Node_Str" : "String_Node_Str"));
  }
  final SQLiteDatabase db=mDbHelper.get().getWritableDatabase();
  for (  long rawContactId : mTransactionContext.get().getInsertedRawContactIds()) {
    mDbHelper.get().updateRawContactDisplayName(db,rawContactId);
    mAggregator.get().onRawContactInsert(mTransactionContext.get(),db,rawContactId);
  }
  Set<Long> dirtyRawContacts=mTransactionContext.get().getDirtyRawContactIds();
  if (!dirtyRawContacts.isEmpty()) {
    mSb.setLength(0);
    mSb.append(UPDATE_RAW_CONTACT_SET_DIRTY_SQL);
    appendIds(mSb,dirtyRawContacts);
    mSb.append("String_Node_Str");
    db.execSQL(mSb.toString());
  }
  Set<Long> updatedRawContacts=mTransactionContext.get().getUpdatedRawContactIds();
  if (!updatedRawContacts.isEmpty()) {
    mSb.setLength(0);
    mSb.append(UPDATE_RAW_CONTACT_SET_VERSION_SQL);
    appendIds(mSb,updatedRawContacts);
    mSb.append("String_Node_Str");
    db.execSQL(mSb.toString());
  }
  final Set<Long> changedRawContacts=mTransactionContext.get().getChangedRawContactIds();
  ContactsTableUtil.updateContactLastUpdate(db,changedRawContacts);
  for (  Map.Entry<Long,Object> entry : mTransactionContext.get().getUpdatedSyncStates()) {
    long id=entry.getKey();
    if (mDbHelper.get().getSyncState().update(db,id,entry.getValue()) <= 0) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  mTransactionContext.get().clearExceptSearchIndexUpdates();
}

Fixed version (ground truth):
private void flushTransactionalChanges(){
  if (VERBOSE_LOGGING) {
    Log.v(TAG,"String_Node_Str" + (inProfileMode() ? "String_Node_Str" : "String_Node_Str"));
  }
  final SQLiteDatabase db=mDbHelper.get().getWritableDatabase();
  for (  long rawContactId : mTransactionContext.get().getInsertedRawContactIds()) {
    mDbHelper.get().updateRawContactDisplayName(db,rawContactId);
    mAggregator.get().onRawContactInsert(mTransactionContext.get(),db,rawContactId);
  }
  Set<Long> dirtyRawContacts=mTransactionContext.get().getDirtyRawContactIds();
  if (!dirtyRawContacts.isEmpty()) {
    mSb.setLength(0);
    mSb.append(UPDATE_RAW_CONTACT_SET_DIRTY_SQL);
    appendIds(mSb,dirtyRawContacts);
    mSb.append("String_Node_Str");
    db.execSQL(mSb.toString());
  }
  Set<Long> updatedRawContacts=mTransactionContext.get().getUpdatedRawContactIds();
  if (!updatedRawContacts.isEmpty()) {
    mSb.setLength(0);
    mSb.append(UPDATE_RAW_CONTACT_SET_VERSION_SQL);
    appendIds(mSb,updatedRawContacts);
    mSb.append("String_Node_Str");
    db.execSQL(mSb.toString());
  }
  final Set<Long> changedRawContacts=mTransactionContext.get().getChangedRawContactIds();
  ContactsTableUtil.updateContactLastUpdateByRawContactId(db,changedRawContacts);
  for (  Map.Entry<Long,Object> entry : mTransactionContext.get().getUpdatedSyncStates()) {
    long id=entry.getKey();
    if (mDbHelper.get().getSyncState().update(db,id,entry.getValue()) <= 0) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  mTransactionContext.get().clearExceptSearchIndexUpdates();
}