Program: 141948
Project: 141948
Buggy source:
private void addTab(final String tag,final ChatModel chat,final Screen host){
  if (tabs == null)   return;
  View preexisting=tabs.getTabByTag(tag);
  if (preexisting != null) {
    preexisting.setVisibility(View.VISIBLE);
  }
 else {
    Controller channel=new ChannelController(getModel(),tag);
    LayoutInflater inflater=(LayoutInflater)tabs.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    if (inflater == null) {
      Logger.log("String_Node_Str","String_Node_Str" + tag + "String_Node_Str");
      tabs.addTab(tabs.newTabSpec(tag).setIndicator(tag),FragmentScreen.class,FragmentScreen.prepare(channel));
    }
 else {
      ChannelModel channelModel=getModel().getChannel(tag);
      if (channelModel == null) {
        return;
      }
      Controller channelName=new ChannelCounterController(getModel().getChannel(tag));
      View tabView=inflater.inflate(channelName.getView(),null);
      channelName.connect(tabView,host);
      tabs.addTab(tabs.newTabSpec(tag).setIndicator(tabView),FragmentScreen.class,FragmentScreen.prepare(channel));
    }
    currentTabs.add(tag);
    View tabTitle=tabs.getTabByTag(tag);
    tabTitle.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        new AlertDialog.Builder(host.getActivity()).setTitle("String_Node_Str" + tag + "String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            if (chat != null) {
              ChannelModel channel=chat.getChannel(tag);
              channel.leave();
              dialog.dismiss();
            }
          }
        }
).setNegativeButton("String_Node_Str",null).show();
        return true;
      }
    }
);
  }
  currentTabs.add(tag);
}

Fixed version (ground truth):
private void addTab(final String tag,final ChatModel chat,final Screen host){
  if (tabs == null)   return;
  View preexisting=tabs.getTabByTag(tag);
  if (preexisting != null) {
    preexisting.setVisibility(View.VISIBLE);
  }
 else {
    Controller channel=new ChannelController(getModel(),tag);
    LayoutInflater inflater=(LayoutInflater)tabs.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    if (inflater == null) {
      Logger.log("String_Node_Str","String_Node_Str" + tag + "String_Node_Str");
      tabs.addTab(tabs.newTabSpec(tag).setIndicator(tag),FragmentScreen.class,FragmentScreen.prepare(channel));
    }
 else {
      Controller channelName;
      if (tabControllers.containsKey(tag)) {
        channelName=tabControllers.get(tag);
      }
 else {
        ChannelModel channelModel=getModel().getChannel(tag);
        if (channelModel == null) {
          return;
        }
        channelName=new ChannelCounterController(getModel().getChannel(tag));
        tabControllers.put(tag,channelName);
      }
      View tabView=inflater.inflate(channelName.getView(),null);
      channelName.connect(tabView,host);
      tabs.addTab(tabs.newTabSpec(tag).setIndicator(tabView),FragmentScreen.class,FragmentScreen.prepare(channel));
    }
    currentTabs.add(tag);
    View tabTitle=tabs.getTabByTag(tag);
    tabTitle.setOnLongClickListener(new OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        new AlertDialog.Builder(host.getActivity()).setTitle("String_Node_Str" + tag + "String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            if (chat != null) {
              ChannelModel channel=chat.getChannel(tag);
              channel.leave();
              dialog.dismiss();
            }
          }
        }
).setNegativeButton("String_Node_Str",null).show();
        return true;
      }
    }
);
  }
  currentTabs.add(tag);
}