Program: 15409
Project: 15409
Buggy source:
public RedditPostView(final Context context,final ListView listParent,final PostListingFragment fragmentParent){
  super(context,listParent);
  this.fragmentParent=fragmentParent;
  offsetBeginAllowed=General.dpToPixels(context,50);
  offsetActionPerformed=General.dpToPixels(context,150);
  thumbnailHandler=new Handler(Looper.getMainLooper()){
    @Override public void handleMessage(    final Message msg){
      if (usageId != msg.what)       return;
      thumbnailView.setImageBitmap((Bitmap)msg.obj);
      invalidate();
    }
  }
;
  dpScale=context.getResources().getDisplayMetrics().density;
  final float fontScale=PrefsUtility.appearance_fontscale_posts(context,PreferenceManager.getDefaultSharedPreferences(context));
  final FrameLayout mainLayout=(FrameLayout)inflate(context,R.layout.reddit_post,null);
  visiblePostLayout=(LinearLayout)mainLayout.findViewById(R.id.reddit_post_layout);
  thumbnailView=(ImageView)mainLayout.findViewById(R.id.reddit_post_thumbnail_view);
  savedIcon=(ImageView)mainLayout.findViewById(R.id.reddit_post_saved_icon);
  hiddenIcon=(ImageView)mainLayout.findViewById(R.id.reddit_post_hidden_icon);
  title=(TextView)mainLayout.findViewById(R.id.reddit_post_title);
  subtitle=(TextView)mainLayout.findViewById(R.id.reddit_post_subtitle);
  commentsButton=(LinearLayout)mainLayout.findViewById(R.id.reddit_post_comments_button);
  commentsText=(TextView)commentsButton.findViewById(R.id.reddit_post_comments_text);
  title.setTextSize(TypedValue.COMPLEX_UNIT_PX,title.getTextSize() * fontScale);
  subtitle.setTextSize(TypedValue.COMPLEX_UNIT_PX,subtitle.getTextSize() * fontScale);
  leftOverlayText=(TextView)mainLayout.findViewById(R.id.reddit_post_fling_text_left);
  rightOverlayText=(TextView)mainLayout.findViewById(R.id.reddit_post_fling_text_right);
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  leftFlingPref=PrefsUtility.pref_behaviour_fling_post_left(context,sharedPreferences);
  rightFlingPref=PrefsUtility.pref_behaviour_fling_post_right(context,sharedPreferences);
  final TypedArray attr=context.obtainStyledAttributes(new int[]{R.attr.rrIconFfLeft,R.attr.rrIconFfRight,R.attr.rrIconTick,R.attr.rrPostTitleCol,R.attr.rrPostTitleReadCol,R.attr.rrListItemBackgroundCol,R.attr.rrPostBackgroundColSticky,R.attr.rrPostCommentsButtonBackCol,R.attr.rrPostCommentsButtonBackColSticky});
  rrIconFfLeft=attr.getDrawable(0);
  rrIconFfRight=attr.getDrawable(1);
  rrIconTick=attr.getDrawable(2);
  rrPostTitleCol=attr.getColor(3,0);
  rrPostTitleReadCol=attr.getColor(4,0);
  rrListItemBackgroundCol=attr.getColor(5,0);
  rrPostBackgroundColSticky=attr.getColor(6,0);
  rrPostCommentsButtonBackCol=attr.getColor(7,0);
  rrPostCommentsButtonBackColSticky=attr.getColor(8,0);
  setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
  setSwipableView(visiblePostLayout);
  setVisibleView(mainLayout);
}

Fixed version (ground truth):
public RedditPostView(final Context context,final ListView listParent,final PostListingFragment fragmentParent){
  super(context,listParent);
  this.fragmentParent=fragmentParent;
  mListView=listParent;
  offsetBeginAllowed=General.dpToPixels(context,50);
  offsetActionPerformed=General.dpToPixels(context,150);
  thumbnailHandler=new Handler(Looper.getMainLooper()){
    @Override public void handleMessage(    final Message msg){
      if (usageId != msg.what)       return;
      thumbnailView.setImageBitmap((Bitmap)msg.obj);
      invalidate();
      mListView.invalidateViews();
    }
  }
;
  dpScale=context.getResources().getDisplayMetrics().density;
  final float fontScale=PrefsUtility.appearance_fontscale_posts(context,PreferenceManager.getDefaultSharedPreferences(context));
  final FrameLayout mainLayout=(FrameLayout)inflate(context,R.layout.reddit_post,null);
  visiblePostLayout=(LinearLayout)mainLayout.findViewById(R.id.reddit_post_layout);
  thumbnailView=(ImageView)mainLayout.findViewById(R.id.reddit_post_thumbnail_view);
  savedIcon=(ImageView)mainLayout.findViewById(R.id.reddit_post_saved_icon);
  hiddenIcon=(ImageView)mainLayout.findViewById(R.id.reddit_post_hidden_icon);
  title=(TextView)mainLayout.findViewById(R.id.reddit_post_title);
  subtitle=(TextView)mainLayout.findViewById(R.id.reddit_post_subtitle);
  commentsButton=(LinearLayout)mainLayout.findViewById(R.id.reddit_post_comments_button);
  commentsText=(TextView)commentsButton.findViewById(R.id.reddit_post_comments_text);
  title.setTextSize(TypedValue.COMPLEX_UNIT_PX,title.getTextSize() * fontScale);
  subtitle.setTextSize(TypedValue.COMPLEX_UNIT_PX,subtitle.getTextSize() * fontScale);
  leftOverlayText=(TextView)mainLayout.findViewById(R.id.reddit_post_fling_text_left);
  rightOverlayText=(TextView)mainLayout.findViewById(R.id.reddit_post_fling_text_right);
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  leftFlingPref=PrefsUtility.pref_behaviour_fling_post_left(context,sharedPreferences);
  rightFlingPref=PrefsUtility.pref_behaviour_fling_post_right(context,sharedPreferences);
  final TypedArray attr=context.obtainStyledAttributes(new int[]{R.attr.rrIconFfLeft,R.attr.rrIconFfRight,R.attr.rrIconTick,R.attr.rrPostTitleCol,R.attr.rrPostTitleReadCol,R.attr.rrListItemBackgroundCol,R.attr.rrPostBackgroundColSticky,R.attr.rrPostCommentsButtonBackCol,R.attr.rrPostCommentsButtonBackColSticky});
  rrIconFfLeft=attr.getDrawable(0);
  rrIconFfRight=attr.getDrawable(1);
  rrIconTick=attr.getDrawable(2);
  rrPostTitleCol=attr.getColor(3,0);
  rrPostTitleReadCol=attr.getColor(4,0);
  rrListItemBackgroundCol=attr.getColor(5,0);
  rrPostBackgroundColSticky=attr.getColor(6,0);
  rrPostCommentsButtonBackCol=attr.getColor(7,0);
  rrPostCommentsButtonBackColSticky=attr.getColor(8,0);
  setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
  setSwipableView(visiblePostLayout);
  setVisibleView(mainLayout);
}