Program: 162723
Project: 162723
Buggy source:
private Card getRandomCard(final int position){
  String title="String_Node_Str" + (position + 1);
  String description="String_Node_Str";
  int type=position % 6;
  final Card card;
  Drawable icon;
switch (type) {
case 0:
    card=new SmallImageCard();
  card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.ic_launcher);
card.setBitmap(icon);
return card;
case 1:
card=new BigImageCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.photo);
card.setBitmap(icon);
card.setCanDismiss(false);
return card;
case 2:
card=new BasicImageButtonsCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.dog);
card.setBitmap(icon);
((BasicImageButtonsCard)card).setLeftButtonText("String_Node_Str");
((BasicImageButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) ((BasicImageButtonsCard)card).setShowDivider(true);
((BasicImageButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
mListView.getAdapter().getItem(0).setTitle("String_Node_Str");
mListView.getAdapter().notifyDataSetChanged();
}
}
);
((BasicImageButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
card.dismiss();
}
}
);
return card;
case 3:
card=new BasicButtonsCard();
card.setDescription(description);
card.setTitle(title);
((BasicButtonsCard)card).setLeftButtonText("String_Node_Str");
((BasicButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) ((BasicButtonsCard)card).setShowDivider(true);
((BasicButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
((BasicButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
return card;
case 4:
card=new WelcomeCard();
card.setTitle("String_Node_Str");
card.setDescription("String_Node_Str");
((WelcomeCard)card).setSubtitle("String_Node_Str");
((WelcomeCard)card).setButtonText("String_Node_Str");
((WelcomeCard)card).setOnButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
if (position % 2 == 0) ((WelcomeCard)card).setBackgroundColorFromId(mContext,R.color.background_material_dark);
return card;
case 5:
card=new BasicListCard();
card.setTitle("String_Node_Str");
card.setDescription("String_Node_Str");
((BasicListCard)card).addAllItems("String_Node_Str","String_Node_Str","String_Node_Str");
((BasicListCard)card).setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
CheckedTextView checkedTextView=(CheckedTextView)view;
checkedTextView.setChecked(!checkedTextView.isChecked());
}
}
);
return card;
default :
card=new BigImageButtonsCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.photo);
card.setBitmap(icon);
((BigImageButtonsCard)card).setLeftButtonText("String_Node_Str");
((BigImageButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) {
((BigImageButtonsCard)card).setShowDivider(true);
}
((BigImageButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Log.d("String_Node_Str","String_Node_Str");
mListView.getAdapter().add(generateNewCard());
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
((BigImageButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
return card;
}
}

Fixed version (ground truth):
private Card getRandomCard(final int position){
  String title="String_Node_Str" + (position + 1);
  String description="String_Node_Str";
  int type=position % 6;
  final Card card;
  Drawable icon;
switch (type) {
case 0:
    card=new SmallImageCard();
  card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.ic_launcher);
card.setBitmap(icon);
return card;
case 1:
card=new BigImageCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.photo);
card.setBitmap(icon);
card.setDismissible(false);
return card;
case 2:
card=new BasicImageButtonsCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.dog);
card.setBitmap(icon);
((BasicImageButtonsCard)card).setLeftButtonText("String_Node_Str");
((BasicImageButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) ((BasicImageButtonsCard)card).setShowDivider(true);
((BasicImageButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
mListView.getCard(0).setTitle("String_Node_Str");
mListView.notifyDataSetChanged();
}
}
);
((BasicImageButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
card.dismiss();
}
}
);
return card;
case 3:
card=new BasicButtonsCard();
card.setDescription(description);
card.setTitle(title);
((BasicButtonsCard)card).setLeftButtonText("String_Node_Str");
((BasicButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) ((BasicButtonsCard)card).setShowDivider(true);
((BasicButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
((BasicButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
return card;
case 4:
card=new WelcomeCard();
card.setTitle("String_Node_Str");
card.setDescription("String_Node_Str");
((WelcomeCard)card).setSubtitle("String_Node_Str");
((WelcomeCard)card).setButtonText("String_Node_Str");
((WelcomeCard)card).setOnButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
if (position % 2 == 0) ((WelcomeCard)card).setBackgroundColorFromId(mContext,R.color.background_material_dark);
return card;
case 5:
card=new BasicListCard();
card.setTitle("String_Node_Str");
card.setDescription("String_Node_Str");
((BasicListCard)card).addAllItems("String_Node_Str","String_Node_Str","String_Node_Str");
((BasicListCard)card).setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
boolean checked=((BasicListCard)card).isItemChecked(((BasicListCard)card).getItems().get(position));
((BasicListCard)card).setItemChecked(position,!checked);
}
}
);
return card;
default :
card=new BigImageButtonsCard();
card.setDescription(description);
card.setTitle(title);
icon=getResources().getDrawable(R.drawable.photo);
card.setBitmap(icon);
((BigImageButtonsCard)card).setLeftButtonText("String_Node_Str");
((BigImageButtonsCard)card).setRightButtonText("String_Node_Str");
if (position % 2 == 0) {
((BigImageButtonsCard)card).setShowDivider(true);
}
((BigImageButtonsCard)card).setOnLeftButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Log.d("String_Node_Str","String_Node_Str");
mListView.add(generateNewCard());
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
((BigImageButtonsCard)card).setOnRightButtonPressedListener(new OnButtonPressListener(){
@Override public void onButtonPressedListener(TextView textView){
Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
);
return card;
}
}