Program: 152548
Project: 152548
Buggy source:
@Override public boolean onCreate(){
  super.onCreate();
  final Context context=getContext();
  mOpenHelper=(OpenHelper)getOpenHelper();
  mGlobalSearchSupport=new GlobalSearchSupport(this);
  mLegacyApiSupport=new LegacyApiSupport(context,mOpenHelper,this,mGlobalSearchSupport);
  mContactAggregator=new ContactAggregator(this,mOpenHelper,mAggregationScheduler);
  final SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  mSetPrimaryStatement=db.compileStatement("String_Node_Str" + Tables.DATA + "String_Node_Str"+ Data.IS_PRIMARY+ "String_Node_Str"+ "String_Node_Str"+ DataColumns.MIMETYPE_ID+ "String_Node_Str"+ "String_Node_Str"+ Data.RAW_CONTACT_ID+ "String_Node_Str");
  mSetSuperPrimaryStatement=db.compileStatement("String_Node_Str" + Tables.DATA + "String_Node_Str"+ Data.IS_SUPER_PRIMARY+ "String_Node_Str"+ Data._ID+ "String_Node_Str"+ "String_Node_Str"+ DataColumns.MIMETYPE_ID+ "String_Node_Str"+ "String_Node_Str"+ Data.RAW_CONTACT_ID+ "String_Node_Str"+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str"+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mLastTimeContactedUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContacts.TIMES_CONTACTED+ "String_Node_Str"+ RawContacts.TIMES_CONTACTED+ "String_Node_Str"+ RawContacts.LAST_TIME_CONTACTED+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str");
  mRawContactDisplayNameUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContactsColumns.DISPLAY_NAME+ "String_Node_Str"+ RawContactsColumns.DISPLAY_NAME_SOURCE+ "String_Node_Str"+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mRawContactDirtyUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContacts.DIRTY+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mAggregatedPresenceReplace=db.compileStatement("String_Node_Str" + Tables.AGGREGATED_PRESENCE + "String_Node_Str"+ AggregatedPresenceColumns.CONTACT_ID+ "String_Node_Str"+ Presence.PRESENCE_STATUS+ "String_Node_Str"+ Presence.PRESENCE_STATUS+ "String_Node_Str"+ "String_Node_Str"+ Tables.PRESENCE+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ PresenceColumns.RAW_CONTACT_ID+ "String_Node_Str"+ RawContactsColumns.CONCRETE_ID+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str");
  mAggregatedPresenceStatusUpdate=db.compileStatement("String_Node_Str" + Tables.AGGREGATED_PRESENCE + "String_Node_Str"+ Presence.PRESENCE_CUSTOM_STATUS+ "String_Node_Str"+ "String_Node_Str"+ AggregatedPresenceColumns.CONTACT_ID+ "String_Node_Str");
  final Locale locale=Locale.getDefault();
  mNameSplitter=new NameSplitter(context.getString(com.android.internal.R.string.common_name_prefixes),context.getString(com.android.internal.R.string.common_last_name_prefixes),context.getString(com.android.internal.R.string.common_name_suffixes),context.getString(com.android.internal.R.string.common_name_conjunctions),locale);
  mPostalSplitter=new PostalSplitter(locale);
  mDataRowHandlers=new HashMap<String,DataRowHandler>();
  mDataRowHandlers.put(Email.CONTENT_ITEM_TYPE,new EmailDataRowHandler());
  mDataRowHandlers.put(Im.CONTENT_ITEM_TYPE,new CommonDataRowHandler(Im.CONTENT_ITEM_TYPE,Im.TYPE,Im.LABEL));
  mDataRowHandlers.put(Nickname.CONTENT_ITEM_TYPE,new CommonDataRowHandler(StructuredPostal.CONTENT_ITEM_TYPE,StructuredPostal.TYPE,StructuredPostal.LABEL));
  mDataRowHandlers.put(Organization.CONTENT_ITEM_TYPE,new OrganizationDataRowHandler());
  mDataRowHandlers.put(Phone.CONTENT_ITEM_TYPE,new PhoneDataRowHandler());
  mDataRowHandlers.put(Nickname.CONTENT_ITEM_TYPE,new NicknameDataRowHandler());
  mDataRowHandlers.put(StructuredName.CONTENT_ITEM_TYPE,new StructuredNameRowHandler(mNameSplitter));
  mDataRowHandlers.put(StructuredPostal.CONTENT_ITEM_TYPE,new StructuredPostalRowHandler(mPostalSplitter));
  mDataRowHandlers.put(GroupMembership.CONTENT_ITEM_TYPE,new GroupMembershipRowHandler());
  mDataRowHandlers.put(Photo.CONTENT_ITEM_TYPE,new PhotoDataRowHandler());
  if (isLegacyContactImportNeeded()) {
    importLegacyContactsAsync();
  }
  AccountManager.get(context).addOnAccountsUpdatedListener(this,null,false);
  onAccountsUpdated(AccountManager.get(context).getAccounts());
  return (db != null);
}

Fixed version (ground truth):
@Override public boolean onCreate(){
  super.onCreate();
  final Context context=getContext();
  mOpenHelper=(OpenHelper)getOpenHelper();
  mGlobalSearchSupport=new GlobalSearchSupport(this);
  mLegacyApiSupport=new LegacyApiSupport(context,mOpenHelper,this,mGlobalSearchSupport);
  mContactAggregator=new ContactAggregator(this,mOpenHelper,mAggregationScheduler);
  final SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  mSetPrimaryStatement=db.compileStatement("String_Node_Str" + Tables.DATA + "String_Node_Str"+ Data.IS_PRIMARY+ "String_Node_Str"+ "String_Node_Str"+ DataColumns.MIMETYPE_ID+ "String_Node_Str"+ "String_Node_Str"+ Data.RAW_CONTACT_ID+ "String_Node_Str");
  mSetSuperPrimaryStatement=db.compileStatement("String_Node_Str" + Tables.DATA + "String_Node_Str"+ Data.IS_SUPER_PRIMARY+ "String_Node_Str"+ Data._ID+ "String_Node_Str"+ "String_Node_Str"+ DataColumns.MIMETYPE_ID+ "String_Node_Str"+ "String_Node_Str"+ Data.RAW_CONTACT_ID+ "String_Node_Str"+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str"+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mLastTimeContactedUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContacts.TIMES_CONTACTED+ "String_Node_Str"+ RawContacts.TIMES_CONTACTED+ "String_Node_Str"+ RawContacts.LAST_TIME_CONTACTED+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str");
  mRawContactDisplayNameUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContactsColumns.DISPLAY_NAME+ "String_Node_Str"+ RawContactsColumns.DISPLAY_NAME_SOURCE+ "String_Node_Str"+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mRawContactDirtyUpdate=db.compileStatement("String_Node_Str" + Tables.RAW_CONTACTS + "String_Node_Str"+ RawContacts.DIRTY+ "String_Node_Str"+ RawContacts._ID+ "String_Node_Str");
  mAggregatedPresenceReplace=db.compileStatement("String_Node_Str" + Tables.AGGREGATED_PRESENCE + "String_Node_Str"+ AggregatedPresenceColumns.CONTACT_ID+ "String_Node_Str"+ Presence.PRESENCE_STATUS+ "String_Node_Str"+ Presence.PRESENCE_STATUS+ "String_Node_Str"+ "String_Node_Str"+ Tables.PRESENCE+ "String_Node_Str"+ Tables.RAW_CONTACTS+ "String_Node_Str"+ PresenceColumns.RAW_CONTACT_ID+ "String_Node_Str"+ RawContactsColumns.CONCRETE_ID+ "String_Node_Str"+ RawContacts.CONTACT_ID+ "String_Node_Str");
  mAggregatedPresenceStatusUpdate=db.compileStatement("String_Node_Str" + Tables.AGGREGATED_PRESENCE + "String_Node_Str"+ Presence.PRESENCE_CUSTOM_STATUS+ "String_Node_Str"+ "String_Node_Str"+ AggregatedPresenceColumns.CONTACT_ID+ "String_Node_Str");
  final Locale locale=Locale.getDefault();
  mNameSplitter=new NameSplitter(context.getString(com.android.internal.R.string.common_name_prefixes),context.getString(com.android.internal.R.string.common_last_name_prefixes),context.getString(com.android.internal.R.string.common_name_suffixes),context.getString(com.android.internal.R.string.common_name_conjunctions),locale);
  mPostalSplitter=new PostalSplitter(locale);
  mDataRowHandlers=new HashMap<String,DataRowHandler>();
  mDataRowHandlers.put(Email.CONTENT_ITEM_TYPE,new EmailDataRowHandler());
  mDataRowHandlers.put(Im.CONTENT_ITEM_TYPE,new CommonDataRowHandler(Im.CONTENT_ITEM_TYPE,Im.TYPE,Im.LABEL));
  mDataRowHandlers.put(Nickname.CONTENT_ITEM_TYPE,new CommonDataRowHandler(StructuredPostal.CONTENT_ITEM_TYPE,StructuredPostal.TYPE,StructuredPostal.LABEL));
  mDataRowHandlers.put(Organization.CONTENT_ITEM_TYPE,new OrganizationDataRowHandler());
  mDataRowHandlers.put(Phone.CONTENT_ITEM_TYPE,new PhoneDataRowHandler());
  mDataRowHandlers.put(Nickname.CONTENT_ITEM_TYPE,new NicknameDataRowHandler());
  mDataRowHandlers.put(StructuredName.CONTENT_ITEM_TYPE,new StructuredNameRowHandler(mNameSplitter));
  mDataRowHandlers.put(StructuredPostal.CONTENT_ITEM_TYPE,new StructuredPostalRowHandler(mPostalSplitter));
  mDataRowHandlers.put(GroupMembership.CONTENT_ITEM_TYPE,new GroupMembershipRowHandler());
  mDataRowHandlers.put(Photo.CONTENT_ITEM_TYPE,new PhotoDataRowHandler());
  if (isLegacyContactImportNeeded()) {
    importLegacyContactsAsync();
  }
  verifyAccounts();
  return (db != null);
}