Program: 187128
Project: 187128
Buggy source:
@Override public void onBindViewHolder(ViewHolder holder,int position){
  Context context=holder.card.getContext();
  final BaseIndexItem baseItem=mDataset.get(position);
  String description=baseItem.getDescription();
  if (baseItem instanceof InstanceIndexItem) {
    final InstanceIndexItem instanceItem=(InstanceIndexItem)baseItem;
    holder.title.setText(String.format("String_Node_Str",!TextUtils.isEmpty(instanceItem.getTitle()) ? instanceItem.getTitle() : context.getString(R.string.no_title),instanceItem.getStoryCreationDate() == 0 ? "String_Node_Str" : sdf.format(new Date(instanceItem.getStoryCreationDate()))));
    int mediumStringResId;
    String storyType=TextUtils.isEmpty(instanceItem.getStoryType()) ? "String_Node_Str" : instanceItem.getStoryType();
switch (storyType) {
case "String_Node_Str":
      mediumStringResId=R.string.lbl_video;
    break;
case "String_Node_Str":
  mediumStringResId=R.string.lbl_audio;
break;
case "String_Node_Str":
mediumStringResId=R.string.lbl_photo;
break;
default :
mediumStringResId=R.string.no_medium;
break;
}
description=context.getString(mediumStringResId) + "String_Node_Str" + context.getString(org.storymaker.app.R.string.last_modified)+ "String_Node_Str";
if (!TextUtils.isEmpty(instanceItem.getInstanceFilePath())) {
description+=sdf.format(new Date(new File(instanceItem.getInstanceFilePath()).lastModified()));
}
String thumbnailPath=baseItem.getThumbnailPath();
if (!TextUtils.isEmpty(thumbnailPath)) {
if (thumbnailPath.startsWith("String_Node_Str")) {
Picasso.with(context).load(thumbnailPath).into(holder.thumb);
}
 else {
Picasso.with(context).load(new File(thumbnailPath)).into(holder.thumb);
}
}
 else {
Picasso.with(context).load(R.drawable.no_thumbnail).into(holder.thumb);
}
}
 else {
ExpansionIndexItem expansionIndexItem=(ExpansionIndexItem)baseItem;
HashMap<String,ExpansionIndexItem> installedIds=IndexManager.loadInstalledIdIndex(context);
holder.title.setText(baseItem.getTitle());
File contentCheck=new File(IndexManager.buildFilePath(expansionIndexItem),IndexManager.buildFileName(expansionIndexItem,Constants.MAIN));
String contentPath=expansionIndexItem.getPackageName() + File.separator + expansionIndexItem.getExpansionId();
if (installedIds.containsKey(expansionIndexItem.getExpansionId()) && contentCheck.exists() && baseItem.getThumbnailPath().startsWith(contentPath)) {
holder.thumb.setImageBitmap(BitmapFactory.decodeStream(ZipHelper.getFileInputStream(baseItem.getThumbnailPath(),context)));
}
 else {
String thumbnailPath=baseItem.getThumbnailPath();
if (!TextUtils.isEmpty(thumbnailPath)) {
if (thumbnailPath.startsWith("String_Node_Str")) {
Picasso.with(context).load(thumbnailPath).into(holder.thumb);
}
 else {
File file=IndexManager.copyThumbnail(context,expansionIndexItem.getThumbnailPath());
Picasso.with(context).load(file).into(holder.thumb);
}
}
 else {
Picasso.with(context).load(R.drawable.no_thumbnail).into(holder.thumb);
}
}
}
holder.card.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
if (mListener != null) {
mListener.onStorySelected(baseItem);
}
}
}
);
holder.card.setOnLongClickListener(new DeleteListener(context,baseItem,position));
holder.description.setText(description);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ViewHolder holder,int position){
  Context context=holder.card.getContext();
  final BaseIndexItem baseItem=mDataset.get(position);
  String description=baseItem.getDescription();
  if (baseItem instanceof InstanceIndexItem) {
    final InstanceIndexItem instanceItem=(InstanceIndexItem)baseItem;
    holder.title.setText(String.format("String_Node_Str",!TextUtils.isEmpty(instanceItem.getTitle()) ? instanceItem.getTitle() : context.getString(R.string.no_title),instanceItem.getStoryCreationDate() == 0 ? "String_Node_Str" : sdf.format(new Date(instanceItem.getStoryCreationDate()))));
    int mediumStringResId;
    String storyType=TextUtils.isEmpty(instanceItem.getStoryType()) ? "String_Node_Str" : instanceItem.getStoryType();
switch (storyType) {
case "String_Node_Str":
      mediumStringResId=R.string.lbl_video;
    break;
case "String_Node_Str":
  mediumStringResId=R.string.lbl_audio;
break;
case "String_Node_Str":
mediumStringResId=R.string.lbl_photo;
break;
default :
mediumStringResId=R.string.no_medium;
break;
}
description=context.getString(mediumStringResId) + "String_Node_Str" + context.getString(org.storymaker.app.R.string.last_modified)+ "String_Node_Str";
if (!TextUtils.isEmpty(instanceItem.getInstanceFilePath())) {
description+=sdf.format(new Date(new File(instanceItem.getInstanceFilePath()).lastModified()));
}
String thumbnailPath=baseItem.getThumbnailPath();
if (!TextUtils.isEmpty(thumbnailPath)) {
if (thumbnailPath.startsWith("String_Node_Str")) {
Picasso.with(context).load(thumbnailPath).into(holder.thumb);
}
 else {
Picasso.with(context).load(new File(thumbnailPath)).into(holder.thumb);
}
}
 else {
Picasso.with(context).load(R.drawable.no_thumbnail).into(holder.thumb);
}
}
 else {
ExpansionIndexItem expansionIndexItem=(ExpansionIndexItem)baseItem;
HashMap<String,ExpansionIndexItem> installedIds=IndexManager.loadInstalledIdIndex(context);
holder.title.setText(baseItem.getTitle());
File contentCheck=new File(IndexManager.buildFilePath(expansionIndexItem),IndexManager.buildFileName(expansionIndexItem,Constants.MAIN));
String contentPath=expansionIndexItem.getPackageName() + File.separator + expansionIndexItem.getExpansionId();
if (installedIds.containsKey(expansionIndexItem.getExpansionId()) && contentCheck.exists() && baseItem.getThumbnailPath().startsWith(contentPath)) {
holder.thumb.setImageBitmap(BitmapFactory.decodeStream(ZipHelper.getFileInputStream(baseItem.getThumbnailPath(),context)));
}
 else {
String thumbnailPath=baseItem.getThumbnailPath();
if (!TextUtils.isEmpty(thumbnailPath)) {
if (thumbnailPath.startsWith("String_Node_Str")) {
Picasso.with(context).load(thumbnailPath).into(holder.thumb);
}
 else {
File file=IndexManager.copyThumbnail(context,expansionIndexItem.getThumbnailPath());
Picasso.with(context).load(file).into(holder.thumb);
}
}
 else {
Picasso.with(context).load(R.drawable.no_thumbnail).into(holder.thumb);
}
}
}
holder.card.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
if (mListener != null) {
mListener.onStorySelected(baseItem);
}
}
}
);
holder.card.setOnLongClickListener(new DeleteListener(context,baseItem));
holder.description.setText(description);
}