Program: 152742
Project: 152742
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (lessoncontainer.istSomethinStrange())   __paintRedBorder(canvas);
  List<Lesson> lessons=lessoncontainer.getStandardLessons();
  ArrayList<String> firstline=new ArrayList<String>();
  ArrayList<String> secondline=new ArrayList<String>();
  List<? extends ViewType> vtfirstline=null;
  List<? extends ViewType> vtsecondline=null;
  for (  Lesson l : lessons) {
    if (viewtype instanceof SchoolClass) {
      vtfirstline=l.getSchoolSubjects();
      vtsecondline=l.getSchoolTeachers();
    }
 else     if (viewtype instanceof SchoolTeacher) {
      vtfirstline=l.getSchoolClasses();
      vtsecondline=l.getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolRoom) {
      vtfirstline=l.getSchoolClasses();
      vtsecondline=l.getSchoolTeachers();
    }
 else     if (viewtype instanceof SchoolSubject) {
      vtfirstline=l.getSchoolTeachers();
      vtsecondline=l.getSchoolClasses();
    }
    for (    ViewType s : vtfirstline) {
      if (!firstline.contains(s.getName()))       firstline.add(s.getName());
    }
    for (    ViewType s : vtsecondline) {
      if (!secondline.contains(s.getName()))       secondline.add(s.getName());
    }
  }
  int left=getResources().getDimensionPixelSize(R.dimen.gui_lesson_padding_left);
  int top=getResources().getDimensionPixelSize(R.dimen.gui_lesson_padding_top);
  int l1l2p=getResources().getDimensionPixelSize(R.dimen.gui_lesson_line1_line1_padding);
  TextPaint tp=new TextPaint(paint);
  tp.setTypeface(Typeface.DEFAULT_BOLD);
  tp.setTextSize(getResources().getDimension(R.dimen.gui_lesson_line1_size));
  String line1=prepareListForDisplay(firstline,tp);
  canvas.drawText(line1,left,top,tp);
  tp.setTextSize(getResources().getDimension(R.dimen.gui_lesson_line2_size));
  tp.setTypeface(Typeface.DEFAULT);
  String line2=prepareListForDisplay(secondline,tp);
  canvas.drawText(line2,left,l1l2p + top,tp);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (lessoncontainer.isSomethinStrange())   __paintRedBorder(canvas);
  List<Lesson> lessons=lessoncontainer.getStandardLessons();
  ArrayList<String> firstline=new ArrayList<String>();
  ArrayList<String> secondline=new ArrayList<String>();
  List<? extends ViewType> vtfirstline=null;
  List<? extends ViewType> vtsecondline=null;
  for (  Lesson l : lessons) {
    if (viewtype instanceof SchoolClass) {
      vtfirstline=l.getSchoolSubjects();
      vtsecondline=l.getSchoolTeachers();
    }
 else     if (viewtype instanceof SchoolTeacher) {
      vtfirstline=l.getSchoolClasses();
      vtsecondline=l.getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolRoom) {
      vtfirstline=l.getSchoolClasses();
      vtsecondline=l.getSchoolTeachers();
    }
 else     if (viewtype instanceof SchoolSubject) {
      vtfirstline=l.getSchoolTeachers();
      vtsecondline=l.getSchoolClasses();
    }
    for (    ViewType s : vtfirstline) {
      if (!firstline.contains(s.getName()))       firstline.add(s.getName());
    }
    for (    ViewType s : vtsecondline) {
      if (!secondline.contains(s.getName()))       secondline.add(s.getName());
    }
  }
  int left=getResources().getDimensionPixelSize(R.dimen.gui_lesson_padding_left);
  int top=getResources().getDimensionPixelSize(R.dimen.gui_lesson_padding_top);
  int l1l2p=getResources().getDimensionPixelSize(R.dimen.gui_lesson_line1_line1_padding);
  TextPaint tp=new TextPaint(paint);
  tp.setTypeface(Typeface.DEFAULT_BOLD);
  tp.setTextSize(getResources().getDimension(R.dimen.gui_lesson_line1_size));
  String line1=prepareListForDisplay(firstline,tp);
  canvas.drawText(line1,left,top,tp);
  tp.setTextSize(getResources().getDimension(R.dimen.gui_lesson_line2_size));
  tp.setTypeface(Typeface.DEFAULT);
  String line2=prepareListForDisplay(secondline,tp);
  canvas.drawText(line2,left,l1l2p + top,tp);
}