Program: 165434
Project: 165434
Buggy source:
private LinearLayout generateRow(Diff.Line line){
  if (line == null)   return null;
  LinearLayout row=new LinearLayout(getContext());
  row.setOrientation(HORIZONTAL);
  row.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  TextView oldLine=new TextView(getContext());
  oldLine.setText(line.oldLine);
  oldLine.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  oldLine.setEms(2);
  oldLine.setGravity(Gravity.CENTER_HORIZONTAL);
  row.addView(oldLine);
  TextView newLine=new TextView(getContext());
  newLine.setText(line.newLine);
  newLine.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  newLine.setEms(2);
  newLine.setGravity(Gravity.CENTER_HORIZONTAL);
  row.addView(newLine);
  TextView content=new TextView(getContext());
  content.setText(line.lineContent);
  content.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  content.setPadding(PADDING_CONTENT_H,PADDING_CONTENT_V,PADDING_CONTENT_H,PADDING_CONTENT_V);
  row.addView(content);
switch (line.lineType) {
case NORMAL:
    oldLine.setBackgroundColor(LINE_BG);
  newLine.setBackgroundColor(LINE_BG);
content.setBackgroundColor(CONTENT_BG);
break;
case ADDED:
oldLine.setBackgroundColor(LINE_BG_ADDED);
newLine.setBackgroundColor(LINE_BG_ADDED);
content.setBackgroundColor(CONTENT_BG_ADDED);
break;
case REMOVED:
oldLine.setBackgroundColor(LINE_BG_REMOVED);
newLine.setBackgroundColor(LINE_BG_REMOVED);
content.setBackgroundColor(CONTENT_BG_REMOVED);
break;
case COMMENT:
oldLine.setBackgroundColor(LINE_BG);
newLine.setBackgroundColor(LINE_BG);
content.setBackgroundColor(CONTENT_BG_COMMENT);
content.setTextColor(CONTENT_FONT_COMMENT);
content.setGravity(Gravity.CENTER_HORIZONTAL);
break;
}
return row;
}

Fixed version (ground truth):
private LinearLayout generateRow(Diff.Line line){
  if (line == null)   return null;
  LinearLayout row=new LinearLayout(getContext());
  row.setOrientation(HORIZONTAL);
  row.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  TextView oldLine=new TextView(getContext());
  oldLine.setText(line.oldLine);
  oldLine.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  oldLine.setEms(2);
  oldLine.setGravity(Gravity.CENTER_HORIZONTAL);
  row.addView(oldLine);
  TextView newLine=new TextView(getContext());
  newLine.setText(line.newLine);
  newLine.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  newLine.setEms(2);
  newLine.setGravity(Gravity.CENTER_HORIZONTAL);
  row.addView(newLine);
  TextView content=new TextView(getContext());
  content.setText(line.lineContent);
  content.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
  content.setPadding(PADDING_CONTENT_H,PADDING_CONTENT_V,PADDING_CONTENT_H,PADDING_CONTENT_V);
  row.addView(content);
  if (line.lineType == null)   return row;
switch (line.lineType) {
case NORMAL:
    oldLine.setBackgroundColor(LINE_BG);
  newLine.setBackgroundColor(LINE_BG);
content.setBackgroundColor(CONTENT_BG);
break;
case ADDED:
oldLine.setBackgroundColor(LINE_BG_ADDED);
newLine.setBackgroundColor(LINE_BG_ADDED);
content.setBackgroundColor(CONTENT_BG_ADDED);
break;
case REMOVED:
oldLine.setBackgroundColor(LINE_BG_REMOVED);
newLine.setBackgroundColor(LINE_BG_REMOVED);
content.setBackgroundColor(CONTENT_BG_REMOVED);
break;
case COMMENT:
oldLine.setBackgroundColor(LINE_BG);
newLine.setBackgroundColor(LINE_BG);
content.setBackgroundColor(CONTENT_BG_COMMENT);
content.setTextColor(CONTENT_FONT_COMMENT);
content.setGravity(Gravity.CENTER_HORIZONTAL);
break;
}
return row;
}