Program: 86178
Project: 86178
Buggy source:
@Override public void setItem(final LentItem item){
  super.setItem(item);
  DateTimeFormatter fmt=DateTimeFormat.shortDate();
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(context);
  final int tolerance=Integer.parseInt(sp.getString("String_Node_Str","String_Node_Str"));
  SpannableStringBuilder builder=new SpannableStringBuilder();
  if (item.getDeadline() != null) {
    builder.append(fmt.print(item.getDeadline()),new ForegroundColorSpan(textColorPrimary),0);
    if (item.getStatus() != null)     builder.append("String_Node_Str");
  }
  if (item.getStatus() != null) {
    builder.append(Html.fromHtml(item.getStatus()));
  }
  setTextOrHide(builder,tvStatus);
  if (item.getDeadline() != null) {
    if (item.getDeadline().equals(LocalDate.now()) || item.getDeadline().isBefore(LocalDate.now())) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.date_overdue));
    }
 else     if (Days.daysBetween(LocalDate.now(),item.getDeadline()).getDays() <= tolerance) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.date_warning));
    }
 else     if (item.getDownloadData() != null) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.account_downloadable));
    }
 else {
      vStatusColor.setBackground(null);
    }
  }
 else   if (item.getDownloadData() != null) {
    vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.account_downloadable));
  }
 else {
    vStatusColor.setBackground(null);
  }
  ivCancel.setVisibility(View.GONE);
  ivBooking.setVisibility(View.GONE);
  if (item.getProlongData() != null) {
    ivProlong.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View arg0){
        callback.prolong(item.getProlongData());
      }
    }
);
    ivProlong.setVisibility(View.VISIBLE);
    ViewCompat.setAlpha(ivProlong,item.isRenewable() ? 1f : 0.4f);
    ivDownload.setVisibility(View.GONE);
  }
 else   if (item.getDownloadData() != null && api != null && api instanceof EbookServiceApi) {
    ivDownload.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View arg0){
        callback.download(item.getDownloadData());
      }
    }
);
    ivProlong.setVisibility(View.GONE);
    ivDownload.setVisibility(View.VISIBLE);
  }
 else {
    ivProlong.setVisibility(View.INVISIBLE);
    ivDownload.setVisibility(View.GONE);
  }
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      callback.onClick(item,ViewHolder.this);
    }
  }
);
}

Fixed version (ground truth):
@Override public void setItem(final LentItem item){
  super.setItem(item);
  DateTimeFormatter fmt=DateTimeFormat.shortDate();
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(context);
  final int tolerance=Integer.parseInt(sp.getString("String_Node_Str","String_Node_Str"));
  SpannableStringBuilder builder=new SpannableStringBuilder();
  if (item.getDeadline() != null) {
    int start=builder.length();
    builder.append(fmt.print(item.getDeadline()));
    builder.setSpan(new ForegroundColorSpan(textColorPrimary),start,start + fmt.print(item.getDeadline()).length(),0);
    if (item.getStatus() != null)     builder.append("String_Node_Str");
  }
  if (item.getStatus() != null) {
    builder.append(Html.fromHtml(item.getStatus()));
  }
  setTextOrHide(builder,tvStatus);
  if (item.getDeadline() != null) {
    if (item.getDeadline().equals(LocalDate.now()) || item.getDeadline().isBefore(LocalDate.now())) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.date_overdue));
    }
 else     if (Days.daysBetween(LocalDate.now(),item.getDeadline()).getDays() <= tolerance) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.date_warning));
    }
 else     if (item.getDownloadData() != null) {
      vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.account_downloadable));
    }
 else {
      vStatusColor.setBackground(null);
    }
  }
 else   if (item.getDownloadData() != null) {
    vStatusColor.setBackgroundColor(ContextCompat.getColor(context,R.color.account_downloadable));
  }
 else {
    vStatusColor.setBackground(null);
  }
  ivCancel.setVisibility(View.GONE);
  ivBooking.setVisibility(View.GONE);
  if (item.getProlongData() != null) {
    ivProlong.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View arg0){
        callback.prolong(item.getProlongData());
      }
    }
);
    ivProlong.setVisibility(View.VISIBLE);
    ViewCompat.setAlpha(ivProlong,item.isRenewable() ? 1f : 0.4f);
    ivDownload.setVisibility(View.GONE);
  }
 else   if (item.getDownloadData() != null && api != null && api instanceof EbookServiceApi) {
    ivDownload.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View arg0){
        callback.download(item.getDownloadData());
      }
    }
);
    ivProlong.setVisibility(View.GONE);
    ivDownload.setVisibility(View.VISIBLE);
  }
 else {
    ivProlong.setVisibility(View.INVISIBLE);
    ivDownload.setVisibility(View.GONE);
  }
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      callback.onClick(item,ViewHolder.this);
    }
  }
);
}