Program: 13908
Project: 13908
Buggy source:
/** 
 * Sets values from a local database   {@link Cursor}.
 */
public void deserializeOptionsDatabaseCursor(Cursor cursor,Map<Integer,CategoryModel> models){
  if (cursor == null || !cursor.moveToFirst() || cursor.getCount() == 0)   return;
  localTableId=getIntFromCursor(cursor,ID_COLUMN_NAME);
  address=getStringFromCursor(cursor,ADDRESS_COLUMN_NAME);
  username=getStringFromCursor(cursor,USERNAME_COLUMN_NAME);
  password=getStringFromCursor(cursor,PASSWORD_COLUMN_NAME);
  title=getStringFromCursor(cursor,TITLE_COLUMN_NAME);
  tagline=getStringFromCursor(cursor,TAGLINE_COLUMN_NAME);
  languageId=getIntFromCursor(cursor,LANGUAGE_COLUMN_NAME);
  privacy=getIntFromCursor(cursor,PRIVACY_COLUMN_NAME);
  defaultCategory=getIntFromCursor(cursor,DEF_CATEGORY_COLUMN_NAME);
  defaultPostFormat=getStringFromCursor(cursor,DEF_POST_FORMAT_COLUMN_NAME);
  location=getBooleanFromCursor(cursor,LOCATION_COLUMN_NAME);
  hasVerifiedCredentials=getBooleanFromCursor(cursor,CREDS_VERIFIED_COLUMN_NAME);
  allowComments=getBooleanFromCursor(cursor,ALLOW_COMMENTS_COLUMN_NAME);
  sendPingbacks=getBooleanFromCursor(cursor,SEND_PINGBACKS_COLUMN_NAME);
  receivePingbacks=getBooleanFromCursor(cursor,RECEIVE_PINGBACKS_COLUMN_NAME);
  shouldCloseAfter=getBooleanFromCursor(cursor,SHOULD_CLOSE_AFTER_COLUMN_NAME);
  closeCommentAfter=getIntFromCursor(cursor,CLOSE_AFTER_COLUMN_NAME);
  sortCommentsBy=getIntFromCursor(cursor,SORT_BY_COLUMN_NAME);
  shouldThreadComments=getBooleanFromCursor(cursor,SHOULD_THREAD_COLUMN_NAME);
  threadingLevels=getIntFromCursor(cursor,THREADING_COLUMN_NAME);
  shouldPageComments=getBooleanFromCursor(cursor,SHOULD_PAGE_COLUMN_NAME);
  commentsPerPage=getIntFromCursor(cursor,PAGING_COLUMN_NAME);
  commentApprovalRequired=getBooleanFromCursor(cursor,MANUAL_APPROVAL_COLUMN_NAME);
  commentsRequireIdentity=getBooleanFromCursor(cursor,IDENTITY_REQUIRED_COLUMN_NAME);
  commentsRequireUserAccount=getBooleanFromCursor(cursor,USER_ACCOUNT_REQUIRED_COLUMN_NAME);
  commentAutoApprovalKnownUsers=getBooleanFromCursor(cursor,WHITELIST_COLUMN_NAME);
  String moderationKeys=getStringFromCursor(cursor,MODERATION_KEYS_COLUMN_NAME);
  String blacklistKeys=getStringFromCursor(cursor,BLACKLIST_KEYS_COLUMN_NAME);
  holdForModeration=new ArrayList<>();
  blacklist=new ArrayList<>();
  if (!TextUtils.isEmpty(moderationKeys)) {
    Collections.addAll(holdForModeration,moderationKeys.split("String_Node_Str"));
  }
  if (!TextUtils.isEmpty(blacklistKeys)) {
    Collections.addAll(blacklist,blacklistKeys.split("String_Node_Str"));
  }
  setRelatedPostsFlags(Math.max(0,getIntFromCursor(cursor,RELATED_POSTS_COLUMN_NAME)));
  String cachedCategories=getStringFromCursor(cursor,CATEGORIES_COLUMN_NAME);
  String cachedFormats=getStringFromCursor(cursor,POST_FORMATS_COLUMN_NAME);
  if (models != null && !TextUtils.isEmpty(cachedCategories)) {
    String[] split=cachedCategories.split("String_Node_Str");
    categories=new CategoryModel[split.length];
    for (int i=0; i < split.length; ++i) {
      int catId=Integer.parseInt(split[i]);
      categories[i]=models.get(catId);
    }
  }
  if (!TextUtils.isEmpty(cachedFormats)) {
    String[] split=cachedFormats.split("String_Node_Str");
    postFormats=new HashMap<>();
    for (    String format : split) {
      String[] kvp=format.split("String_Node_Str");
      postFormats.put(kvp[0],kvp[1]);
    }
  }
  int cachedRelatedPosts=getIntFromCursor(cursor,RELATED_POSTS_COLUMN_NAME);
  if (cachedRelatedPosts != -1) {
    setRelatedPostsFlags(cachedRelatedPosts);
  }
  isInLocalTable=true;
}

Fixed version (ground truth):
/** 
 * Sets values from a local database   {@link Cursor}.
 */
public void deserializeOptionsDatabaseCursor(Cursor cursor,Map<Integer,CategoryModel> models){
  if (cursor == null || !cursor.moveToFirst() || cursor.getCount() == 0)   return;
  localTableId=getIntFromCursor(cursor,ID_COLUMN_NAME);
  address=getStringFromCursor(cursor,ADDRESS_COLUMN_NAME);
  username=getStringFromCursor(cursor,USERNAME_COLUMN_NAME);
  password=getStringFromCursor(cursor,PASSWORD_COLUMN_NAME);
  title=getStringFromCursor(cursor,TITLE_COLUMN_NAME);
  tagline=getStringFromCursor(cursor,TAGLINE_COLUMN_NAME);
  languageId=getIntFromCursor(cursor,LANGUAGE_COLUMN_NAME);
  privacy=getIntFromCursor(cursor,PRIVACY_COLUMN_NAME);
  defaultCategory=getIntFromCursor(cursor,DEF_CATEGORY_COLUMN_NAME);
  defaultPostFormat=getStringFromCursor(cursor,DEF_POST_FORMAT_COLUMN_NAME);
  location=getBooleanFromCursor(cursor,LOCATION_COLUMN_NAME);
  optimizeImage=getBooleanFromCursor(cursor,OPTIMIZE_IMAGE_COLUMN_NAME);
  hasVerifiedCredentials=getBooleanFromCursor(cursor,CREDS_VERIFIED_COLUMN_NAME);
  allowComments=getBooleanFromCursor(cursor,ALLOW_COMMENTS_COLUMN_NAME);
  sendPingbacks=getBooleanFromCursor(cursor,SEND_PINGBACKS_COLUMN_NAME);
  receivePingbacks=getBooleanFromCursor(cursor,RECEIVE_PINGBACKS_COLUMN_NAME);
  shouldCloseAfter=getBooleanFromCursor(cursor,SHOULD_CLOSE_AFTER_COLUMN_NAME);
  closeCommentAfter=getIntFromCursor(cursor,CLOSE_AFTER_COLUMN_NAME);
  sortCommentsBy=getIntFromCursor(cursor,SORT_BY_COLUMN_NAME);
  shouldThreadComments=getBooleanFromCursor(cursor,SHOULD_THREAD_COLUMN_NAME);
  threadingLevels=getIntFromCursor(cursor,THREADING_COLUMN_NAME);
  shouldPageComments=getBooleanFromCursor(cursor,SHOULD_PAGE_COLUMN_NAME);
  commentsPerPage=getIntFromCursor(cursor,PAGING_COLUMN_NAME);
  commentApprovalRequired=getBooleanFromCursor(cursor,MANUAL_APPROVAL_COLUMN_NAME);
  commentsRequireIdentity=getBooleanFromCursor(cursor,IDENTITY_REQUIRED_COLUMN_NAME);
  commentsRequireUserAccount=getBooleanFromCursor(cursor,USER_ACCOUNT_REQUIRED_COLUMN_NAME);
  commentAutoApprovalKnownUsers=getBooleanFromCursor(cursor,WHITELIST_COLUMN_NAME);
  String moderationKeys=getStringFromCursor(cursor,MODERATION_KEYS_COLUMN_NAME);
  String blacklistKeys=getStringFromCursor(cursor,BLACKLIST_KEYS_COLUMN_NAME);
  holdForModeration=new ArrayList<>();
  blacklist=new ArrayList<>();
  if (!TextUtils.isEmpty(moderationKeys)) {
    Collections.addAll(holdForModeration,moderationKeys.split("String_Node_Str"));
  }
  if (!TextUtils.isEmpty(blacklistKeys)) {
    Collections.addAll(blacklist,blacklistKeys.split("String_Node_Str"));
  }
  setRelatedPostsFlags(Math.max(0,getIntFromCursor(cursor,RELATED_POSTS_COLUMN_NAME)));
  String cachedCategories=getStringFromCursor(cursor,CATEGORIES_COLUMN_NAME);
  String cachedFormats=getStringFromCursor(cursor,POST_FORMATS_COLUMN_NAME);
  if (models != null && !TextUtils.isEmpty(cachedCategories)) {
    String[] split=cachedCategories.split("String_Node_Str");
    categories=new CategoryModel[split.length];
    for (int i=0; i < split.length; ++i) {
      int catId=Integer.parseInt(split[i]);
      categories[i]=models.get(catId);
    }
  }
  if (!TextUtils.isEmpty(cachedFormats)) {
    String[] split=cachedFormats.split("String_Node_Str");
    postFormats=new HashMap<>();
    for (    String format : split) {
      String[] kvp=format.split("String_Node_Str");
      postFormats.put(kvp[0],kvp[1]);
    }
  }
  int cachedRelatedPosts=getIntFromCursor(cursor,RELATED_POSTS_COLUMN_NAME);
  if (cachedRelatedPosts != -1) {
    setRelatedPostsFlags(cachedRelatedPosts);
  }
  isInLocalTable=true;
}