Program: 36882
Project: 36882
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    getWindow().setStatusBarColor(getResources().getColor(R.color.primary_dark));
  }
  final String[] allSavedTests=fileList();
  LinearLayout layout=new LinearLayout(this);
  setContentView(layout);
  layout.setBackgroundColor(Color.parseColor("String_Node_Str"));
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setPadding(0,16,16,16);
  TextView textview=new TextView(this);
  textview.setText("String_Node_Str");
  textview.setTextColor(Color.parseColor("String_Node_Str"));
  textview.setTextSize(30);
  textview.setTypeface(null,Typeface.BOLD);
  textview.setGravity(Gravity.RIGHT);
  layout.addView(textview,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  if (allSavedTests.length < 2) {
    TextView message=new TextView(this);
    message.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
    message.setTextColor(Color.parseColor("String_Node_Str"));
    message.setBackgroundColor(Color.parseColor("String_Node_Str"));
    message.setText("String_Node_Str");
    layout.addView(message,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  }
 else {
    ScrollView scrollview=new ScrollView(this);
    scrollview.setLayoutParams(new ScrollView.LayoutParams(ScrollView.LayoutParams.FILL_PARENT,ScrollView.LayoutParams.WRAP_CONTENT));
    LinearLayout container=new LinearLayout(this);
    container.setOrientation(LinearLayout.VERTICAL);
    for (int i=0; i < allSavedTests.length; i++) {
      if (allSavedTests[i].equals("String_Node_Str")) {
      }
 else {
        LinearLayout spacer=new LinearLayout(this);
        spacer.setLayoutParams(new LinearLayout.LayoutParams(40,40));
        container.addView(spacer);
        Button b=new Button(this);
        final int number=i;
        b.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT + 50));
        b.setBackgroundResource(R.drawable.button_background);
        b.setPadding(10,20,10,20);
        String[] names=allSavedTests[i].split("String_Node_Str");
        String time="String_Node_Str";
        for (int j=0; j < 4; j=j + 2) {
          if (j != 2) {
            time+=String.valueOf(names[3].charAt(j)) + String.valueOf(names[3].charAt(j + 1)) + "String_Node_Str";
          }
 else {
            time+=String.valueOf(names[3].charAt(j)) + String.valueOf(names[3].charAt(j + 1));
          }
        }
        String name="String_Node_Str" + time + "String_Node_Str"+ names[2].replaceAll("String_Node_Str","String_Node_Str");
        b.setText(name);
        b.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View view){
            gotoTestData(view,allSavedTests[number]);
          }
        }
);
        container.addView(b,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
        i++;
      }
    }
    scrollview.addView(container);
    layout.addView(scrollview);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    getWindow().setStatusBarColor(getResources().getColor(R.color.primary_dark));
  }
  final String[] allSavedTests=fileList();
  LinearLayout layout=new LinearLayout(this);
  setContentView(layout);
  layout.setBackgroundColor(Color.parseColor("String_Node_Str"));
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setPadding(0,40,16,16);
  TextView textview=new TextView(this);
  textview.setText("String_Node_Str");
  textview.setTextColor(Color.parseColor("String_Node_Str"));
  textview.setTextSize(30);
  textview.setTypeface(null,Typeface.BOLD);
  textview.setGravity(Gravity.CENTER);
  layout.addView(textview,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  if (allSavedTests.length < 2) {
    TextView message=new TextView(this);
    message.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
    message.setTextColor(Color.parseColor("String_Node_Str"));
    message.setTextSize(20);
    message.setBackgroundColor(Color.parseColor("String_Node_Str"));
    message.setPadding(40,30,16,0);
    message.setText("String_Node_Str");
    layout.addView(message,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  }
 else {
    ScrollView scrollview=new ScrollView(this);
    scrollview.setLayoutParams(new ScrollView.LayoutParams(ScrollView.LayoutParams.FILL_PARENT,ScrollView.LayoutParams.WRAP_CONTENT));
    LinearLayout container=new LinearLayout(this);
    container.setOrientation(LinearLayout.VERTICAL);
    for (int i=0; i < allSavedTests.length; i++) {
      if (allSavedTests[i].equals("String_Node_Str")) {
      }
 else {
        LinearLayout spacer=new LinearLayout(this);
        spacer.setLayoutParams(new LinearLayout.LayoutParams(40,40));
        container.addView(spacer);
        Button b=new Button(this);
        final int number=i;
        b.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT + 50));
        b.setBackgroundResource(R.drawable.button_background);
        b.setPadding(10,20,10,20);
        String[] names=allSavedTests[i].split("String_Node_Str");
        String time="String_Node_Str";
        for (int j=0; j < 4; j=j + 2) {
          if (j != 2) {
            time+=String.valueOf(names[3].charAt(j)) + String.valueOf(names[3].charAt(j + 1)) + "String_Node_Str";
          }
 else {
            time+=String.valueOf(names[3].charAt(j)) + String.valueOf(names[3].charAt(j + 1));
          }
        }
        String name="String_Node_Str" + time + "String_Node_Str"+ names[2].replaceAll("String_Node_Str","String_Node_Str");
        b.setText(name);
        b.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View view){
            gotoTestData(view,allSavedTests[number]);
          }
        }
);
        container.addView(b,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
        i++;
      }
    }
    scrollview.addView(container);
    layout.addView(scrollview);
  }
}