Program: 2580
Project: 2580
Buggy source:
public HablarChatManager(final Hablar hablarPresenter,final ChatConfig config,final ChatPageFactory chatPageFactory,final PairChatPresenterFactory chatPresenterFactory){
  hablar=hablarPresenter;
  this.chatPageFactory=chatPageFactory;
  this.chatPresenterFactory=chatPresenterFactory;
  chatPages=new HashMap<Chat,PairChatPage>();
  roster=Suco.get(Roster.class);
  final ChatManager chatManager=Suco.get(ChatManager.class);
  if (config.openChat != null) {
    chatManager.open(config.openChat);
  }
  chatManager.addChatChangedHandler(new ChatChangedHandler(){
    @Override public void onChatChanged(    ChatChangedEvent event){
      if (event.isCreated()) {
        createChat(event.getChat(),Visibility.notFocused);
      }
      if (event.isOpened()) {
        final PairChatPage page=chatPages.get(event.getChat());
        if (page != null) {
          page.requestVisibility(Visibility.focused);
        }
 else {
          createChat(event.getChat(),Visibility.notFocused);
        }
      }
      if (event.isClosed()) {
        final PairChatPage page=chatPages.get(event.getChat().getURI());
        page.requestVisibility(Visibility.hidden);
      }
    }
  }
);
  roster.onItemChanged(new Listener<RosterItem>(){
    @Override public void onEvent(    final RosterItem item){
      final XmppURI jid=item.getJID();
      for (      final Entry<Chat,PairChatPage> entry : chatPages.entrySet()) {
        if (entry.getKey().getURI().equalsNoResource(jid)) {
          entry.getValue().setPresence(item.isAvailable(),item.getShow());
        }
      }
    }
  }
);
  sendButtonVisible=config.sendButtonVisible;
}

Fixed version (ground truth):
public HablarChatManager(final Hablar hablarPresenter,final ChatConfig config,final ChatPageFactory chatPageFactory,final PairChatPresenterFactory chatPresenterFactory){
  hablar=hablarPresenter;
  this.chatPageFactory=chatPageFactory;
  this.chatPresenterFactory=chatPresenterFactory;
  chatPages=new HashMap<Chat,PairChatPage>();
  roster=Suco.get(Roster.class);
  final ChatManager chatManager=Suco.get(ChatManager.class);
  if (config.openChat != null) {
    chatManager.open(config.openChat);
  }
  chatManager.addChatChangedHandler(new ChatChangedHandler(){
    @Override public void onChatChanged(    ChatChangedEvent event){
      if (event.isCreated()) {
        createChat(event.getChat(),Visibility.notFocused);
      }
      if (event.isOpened()) {
        final PairChatPage page=chatPages.get(event.getChat());
        if (page != null) {
          page.requestVisibility(Visibility.focused);
        }
 else {
          createChat(event.getChat(),Visibility.notFocused);
        }
      }
      if (event.isClosed()) {
        final PairChatPage page=chatPages.get(event.getChat());
        page.requestVisibility(Visibility.hidden);
      }
    }
  }
);
  roster.onItemChanged(new Listener<RosterItem>(){
    @Override public void onEvent(    final RosterItem item){
      final XmppURI jid=item.getJID();
      for (      final Entry<Chat,PairChatPage> entry : chatPages.entrySet()) {
        if (entry.getKey().getURI().equalsNoResource(jid)) {
          entry.getValue().setPresence(item.isAvailable(),item.getShow());
        }
      }
    }
  }
);
  sendButtonVisible=config.sendButtonVisible;
}