Program: 102986
Project: 102986
Buggy source:
/** 
 * Initializes plug-in components for this container.
 */
void initPluginComponents(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + net.java.sip.communicator.service.gui.Container.CONTAINER_ID + "String_Node_Str"+ net.java.sip.communicator.service.gui.Container.CONTAINER_CHAT_WRITE_PANEL.getID()+ "String_Node_Str";
  try {
    serRefs=GuiActivator.bundleContext.getServiceReferences(PluginComponentFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException exc) {
    logger.error("String_Node_Str",exc);
  }
  if (serRefs != null) {
    for (int i=0; i < serRefs.length; i++) {
      PluginComponentFactory factory=(PluginComponentFactory)GuiActivator.bundleContext.getService(serRefs[i]);
      PluginComponent component=factory.getPluginComponentInstance(this);
      ChatSession chatSession=chatPanel.getChatSession();
      if (chatSession != null) {
        ChatTransport currentTransport=chatSession.getCurrentChatTransport();
        Object currentDescriptor=currentTransport.getDescriptor();
        if (currentDescriptor instanceof Contact) {
          Contact contact=(Contact)currentDescriptor;
          component.setCurrentContact(contact,currentTransport.getResourceName());
        }
      }
      if (component.getComponent() == null)       continue;
      centerPanel.add((Component)component.getComponent());
    }
  }
  GuiActivator.getUIService().addPluginComponentListener(this);
  this.centerPanel.repaint();
}

Fixed version (ground truth):
/** 
 * Initializes plug-in components for this container.
 */
void initPluginComponents(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + net.java.sip.communicator.service.gui.Container.CONTAINER_ID + "String_Node_Str"+ net.java.sip.communicator.service.gui.Container.CONTAINER_CHAT_WRITE_PANEL.getID()+ "String_Node_Str";
  try {
    serRefs=GuiActivator.bundleContext.getServiceReferences(PluginComponentFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException exc) {
    logger.error("String_Node_Str",exc);
  }
  if (serRefs != null) {
    for (int i=0; i < serRefs.length; i++) {
      PluginComponentFactory factory=(PluginComponentFactory)GuiActivator.bundleContext.getService(serRefs[i]);
      PluginComponent component=factory.getPluginComponentInstance(this);
      ChatSession chatSession=chatPanel.getChatSession();
      if (chatSession != null) {
        ChatTransport currentTransport=chatSession.getCurrentChatTransport();
        Object currentDescriptor=currentTransport.getDescriptor();
        if (currentDescriptor instanceof Contact) {
          Contact contact=(Contact)currentDescriptor;
          component.setCurrentContact(contact,currentTransport.getResourceName());
        }
      }
      if (component.getComponent() == null)       continue;
      GridBagConstraints constraints=new GridBagConstraints();
      constraints.anchor=GridBagConstraints.NORTHEAST;
      constraints.fill=GridBagConstraints.NONE;
      constraints.gridy=0;
      constraints.gridheight=1;
      constraints.weightx=0f;
      constraints.weighty=0f;
      constraints.insets=new Insets(0,3,0,0);
      centerPanel.add((Component)component.getComponent(),constraints);
    }
  }
  GuiActivator.getUIService().addPluginComponentListener(this);
  this.centerPanel.repaint();
}