Program: 13457
Project: 13457
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);
  startOfWeek=getStringFromCursor(cursor,START_OF_WEEK_COLUMN_NAME);
  dateFormat=getStringFromCursor(cursor,DATE_FORMAT_COLUMN_NAME);
  timeFormat=getStringFromCursor(cursor,TIME_FORMAT_COLUMN_NAME);
  timezone=getStringFromCursor(cursor,TIMEZONE_COLUMN_NAME);
  postsPerPage=getIntFromCursor(cursor,POSTS_PER_PAGE_COLUMN_NAME);
  ampSupported=getBooleanFromCursor(cursor,AMP_SUPPORTED_COLUMN_NAME);
  ampEnabled=getBooleanFromCursor(cursor,AMP_ENABLED_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"));
  }
  sharingLabel=getStringFromCursor(cursor,SHARING_LABEL_COLUMN_NAME);
  sharingButtonStyle=getStringFromCursor(cursor,SHARING_BUTTON_STYLE_COLUMN_NAME);
  allowReblogButton=getBooleanFromCursor(cursor,ALLOW_REBLOG_BUTTON_COLUMN_NAME);
  allowLikeButton=getBooleanFromCursor(cursor,ALLOW_LIKE_BUTTON_COLUMN_NAME);
  allowCommentLikes=getBooleanFromCursor(cursor,ALLOW_COMMENT_LIKES_COLUMN_NAME);
  twitterUsername=getStringFromCursor(cursor,TWITTER_USERNAME_COLUMN_NAME);
  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,SparseArrayCompat<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);
  startOfWeek=getStringFromCursor(cursor,START_OF_WEEK_COLUMN_NAME);
  dateFormat=getStringFromCursor(cursor,DATE_FORMAT_COLUMN_NAME);
  timeFormat=getStringFromCursor(cursor,TIME_FORMAT_COLUMN_NAME);
  timezone=getStringFromCursor(cursor,TIMEZONE_COLUMN_NAME);
  postsPerPage=getIntFromCursor(cursor,POSTS_PER_PAGE_COLUMN_NAME);
  ampSupported=getBooleanFromCursor(cursor,AMP_SUPPORTED_COLUMN_NAME);
  ampEnabled=getBooleanFromCursor(cursor,AMP_ENABLED_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"));
  }
  sharingLabel=getStringFromCursor(cursor,SHARING_LABEL_COLUMN_NAME);
  sharingButtonStyle=getStringFromCursor(cursor,SHARING_BUTTON_STYLE_COLUMN_NAME);
  allowReblogButton=getBooleanFromCursor(cursor,ALLOW_REBLOG_BUTTON_COLUMN_NAME);
  allowLikeButton=getBooleanFromCursor(cursor,ALLOW_LIKE_BUTTON_COLUMN_NAME);
  allowCommentLikes=getBooleanFromCursor(cursor,ALLOW_COMMENT_LIKES_COLUMN_NAME);
  twitterUsername=getStringFromCursor(cursor,TWITTER_USERNAME_COLUMN_NAME);
  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;
}