Program: 3906
Project: 3906
Buggy source:
@Inject FriendStatusPanel(final FriendActions friendActions,final ChatFramePanel friendsPanel,IconLibrary iconLibrary){
  GuiUtils.assignResources(this);
  JPanel chatPanel=new JPanel(new BorderLayout());
  Border insideBorder=BorderFactory.createEmptyBorder(-1,0,0,0);
  Border outsideBorder=BorderFactory.createLineBorder(buttonBorderColor);
  chatPanelVisibleBorder=new CompoundBorder(insideBorder,outsideBorder);
  chatPanel.setOpaque(true);
  chatPanel.setBackground(chatBackground);
  chatButton=new JXButton(new AbstractAction(I18n.tr("String_Node_Str")){
    @Override public void actionPerformed(    ActionEvent e){
      if (!friendActions.isSignedIn()) {
        friendActions.signIn();
      }
 else {
        friendsPanel.setAdjacentEdgeWidth(mainComponent.getWidth());
        friendsPanel.toggleVisibility();
        mainComponent.setBorder(friendsPanel.isVisible() ? chatPanelVisibleBorder : null);
        chatButton.setSize(chatButton.getWidth(),chatButton.getHeight() + 1);
      }
    }
  }
);
  RectanglePainter<JXButton> backgroundPainter=new RectanglePainter<JXButton>(chatBackground,chatBackground);
  backgroundPainter.setBorderWidth(0.0f);
  chatButton.setBackgroundPainter(backgroundPainter);
  chatButton.setIcon(iconLibrary.getChatting());
  chatButton.setFont(chatButtonFont);
  chatButton.setForeground(chatButtonForeground);
  chatButton.setFocusPainted(false);
  chatButton.setHorizontalAlignment(AbstractButton.LEFT);
  chatButton.setHorizontalTextPosition(AbstractButton.RIGHT);
  Insets insets=new Insets(1,2,0,25);
  chatButton.setMargin(insets);
  chatButton.setPaintBorderInsets(true);
  chatPanel.add(chatButton);
  friendsPanel.setUnseenMessageListener(new UnseenMessageFlasher(chatButton,iconLibrary));
  mainComponent=chatPanel;
}

Fixed version (ground truth):
@Inject FriendStatusPanel(final ChatFramePanel friendsPanel,IconLibrary iconLibrary){
  GuiUtils.assignResources(this);
  JPanel chatPanel=new JPanel(new BorderLayout());
  chatPanel.setBorder(BorderFactory.createEmptyBorder(0,0,0,25));
  Border insideBorder=BorderFactory.createEmptyBorder(-1,0,0,0);
  Border outsideBorder=BorderFactory.createLineBorder(buttonBorderColor);
  chatPanelVisibleBorder=new CompoundBorder(insideBorder,outsideBorder);
  chatPanel.setOpaque(true);
  chatPanel.setBackground(chatBackground);
  final RectanglePainter<JXButton> backgroundPainter=new RectanglePainter<JXButton>();
  chatButton=new JXButton(new AbstractAction(I18n.tr("String_Node_Str")){
    @Override public void actionPerformed(    ActionEvent e){
      friendsPanel.setAdjacentEdgeWidth(mainComponent.getWidth());
      friendsPanel.toggleVisibility();
      boolean friendsVisible=friendsPanel.isVisible();
      backgroundPainter.setBorderPaint(friendsVisible ? chatBackground : null);
      mainComponent.setBorder(friendsVisible ? chatPanelVisibleBorder : null);
    }
  }
);
  backgroundPainter.setFillPaint(chatBackground);
  backgroundPainter.setBorderWidth(0.0f);
  chatButton.setBackgroundPainter(backgroundPainter);
  chatButton.setIcon(iconLibrary.getChatting());
  chatButton.setFont(chatButtonFont);
  chatButton.setForeground(chatButtonForeground);
  chatButton.setFocusPainted(false);
  chatButton.setHorizontalAlignment(AbstractButton.LEFT);
  chatPanel.add(chatButton);
  friendsPanel.setUnseenMessageListener(new UnseenMessageFlasher(chatButton,iconLibrary));
  mainComponent=chatPanel;
}