Program: 178212
Project: 178212
Buggy source:
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  List<Programme> prList=new ArrayList<Programme>();
  Intent intent=getIntent();
  if ("String_Node_Str".equals(intent.getAction())) {
    pattern=Pattern.compile(intent.getStringExtra("String_Node_Str"),Pattern.CASE_INSENSITIVE);
  }
 else {
    TVHGuideApplication app=(TVHGuideApplication)getApplication();
    channel=app.getChannel(getIntent().getLongExtra("String_Node_Str",0));
  }
  if (pattern == null && channel == null) {
    finish();
    return;
  }
  if (channel != null && !channel.epg.isEmpty()) {
    setTitle(channel.name);
    prList.addAll(channel.epg);
    Button btn=new Button(this);
    btn.setText(R.string.pr_get_more);
    btn.setOnClickListener(new OnClickListener(){
      public void onClick(      View view){
        Programme p=null;
        Iterator<Programme> it=channel.epg.iterator();
        long nextId=0;
        while (it.hasNext()) {
          p=it.next();
          if (p.id != nextId && nextId != 0) {
            break;
          }
          nextId=p.nextId;
        }
        if (nextId == 0) {
          nextId=p.nextId;
        }
        if (nextId == 0) {
          nextId=p.id;
          return;
        }
        Intent intent=new Intent(ProgrammeListActivity.this,HTSService.class);
        intent.setAction(HTSService.ACTION_GET_EVENTS);
        intent.putExtra("String_Node_Str",nextId);
        intent.putExtra("String_Node_Str",channel.id);
        intent.putExtra("String_Node_Str",10);
        startService(intent);
      }
    }
);
    getListView().addFooterView(btn);
  }
 else   if (pattern != null) {
    TVHGuideApplication app=(TVHGuideApplication)getApplication();
    for (    Channel ch : app.getChannels()) {
      for (      Programme p : ch.epg) {
        if (pattern.matcher(p.title).find()) {
          prList.add(p);
        }
      }
    }
  }
 else {
    finish();
    return;
  }
  contentTypes=getResources().getStringArray(R.array.pr_type);
  prAdapter=new ProgrammeListAdapter(this,prList);
  prAdapter.sort();
  setListAdapter(prAdapter);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  List<Programme> prList=new ArrayList<Programme>();
  Intent intent=getIntent();
  if ("String_Node_Str".equals(intent.getAction())) {
    pattern=Pattern.compile(intent.getStringExtra("String_Node_Str"),Pattern.CASE_INSENSITIVE);
  }
 else {
    TVHGuideApplication app=(TVHGuideApplication)getApplication();
    channel=app.getChannel(getIntent().getLongExtra("String_Node_Str",0));
  }
  if (pattern == null && channel == null) {
    finish();
    return;
  }
  if (channel != null && !channel.epg.isEmpty()) {
    setTitle(channel.name);
    prList.addAll(channel.epg);
    Button btn=new Button(this);
    btn.setText(R.string.pr_get_more);
    btn.setOnClickListener(new OnClickListener(){
      public void onClick(      View view){
        Programme p=null;
        Iterator<Programme> it=channel.epg.iterator();
        long nextId=0;
        while (it.hasNext()) {
          p=it.next();
          if (p.id != nextId && nextId != 0) {
            break;
          }
          nextId=p.nextId;
        }
        if (nextId == 0) {
          nextId=p.nextId;
        }
        if (nextId == 0) {
          nextId=p.id;
        }
        Intent intent=new Intent(ProgrammeListActivity.this,HTSService.class);
        intent.setAction(HTSService.ACTION_GET_EVENTS);
        intent.putExtra("String_Node_Str",nextId);
        intent.putExtra("String_Node_Str",channel.id);
        intent.putExtra("String_Node_Str",10);
        startService(intent);
      }
    }
);
    getListView().addFooterView(btn);
  }
 else   if (pattern != null) {
    TVHGuideApplication app=(TVHGuideApplication)getApplication();
    for (    Channel ch : app.getChannels()) {
      for (      Programme p : ch.epg) {
        if (pattern.matcher(p.title).find()) {
          prList.add(p);
        }
      }
    }
  }
 else {
    finish();
    return;
  }
  contentTypes=getResources().getStringArray(R.array.pr_type);
  prAdapter=new ProgrammeListAdapter(this,prList);
  prAdapter.sort();
  setListAdapter(prAdapter);
}