nus-yam/ex-repair huggingface dataset:
Program: 104304
Project: 104304
Buggy source:
/** 
 * Creates an instance of this <tt>SmiliesSelectorBox</tt> and initializes the panel with the smiley icons given by the incoming imageList.
 * @param imageList The pack of smiley icons.
 */
public SmiliesSelectorBox(ArrayList imageList,ChatWritePanel writePanel){
  this.imageList=imageList;
  this.chatWritePanel=writePanel;
  this.selectorBox.setUI(new SIPCommChatSelectorMenuUI());
  this.setOpaque(false);
  this.selectorBox.setOpaque(false);
  this.setPreferredSize(new Dimension(BUTTON_WIDTH,BUTTON_HEIGHT));
  this.selectorBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
  this.selectorBox.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.SMILIES_ICON)));
  this.calculateGridDimensions(imageList.size());
  this.selectorBox.getPopupMenu().setLayout(new GridLayout(this.gridRowCount,this.gridColCount,5,5));
  for (int i=0; i < imageList.size(); i++) {
    Smiley smiley=(Smiley)this.imageList.get(i);
    ImageIcon imageIcon=new ImageIcon(ImageLoader.getImage(smiley.getImageID()));
    JMenuItem smileyItem=new JMenuItem(imageIcon);
    smileyItem.setToolTipText(smiley.getSmileyStrings()[0]);
    smileyItem.addActionListener(this);
    this.selectorBox.add(smileyItem);
  }
  this.add(selectorBox);
}

Fixed version (ground truth):
/** 
 * Creates an instance of this <tt>SmiliesSelectorBox</tt> and initializes the panel with the smiley icons given by the incoming imageList.
 * @param imageList The pack of smiley icons.
 */
public SmiliesSelectorBox(ArrayList<Smiley> imageList,ChatWritePanel writePanel){
  this.imageList=imageList;
  this.chatWritePanel=writePanel;
  this.selectorBox.setUI(new SIPCommChatSelectorMenuUI());
  this.setOpaque(false);
  this.selectorBox.setOpaque(false);
  this.setPreferredSize(new Dimension(BUTTON_WIDTH,BUTTON_HEIGHT));
  this.selectorBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
  this.selectorBox.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.SMILIES_ICON)));
  this.calculateGridDimensions(imageList.size());
  this.selectorBox.getPopupMenu().setLayout(new GridLayout(this.gridRowCount,this.gridColCount,5,5));
  for (  Smiley smiley : imageList) {
    ImageIcon imageIcon=new ImageIcon(ImageLoader.getImage(smiley.getImageID()));
    JMenuItem smileyItem=new JMenuItem(imageIcon);
    smileyItem.setToolTipText(smiley.getSmileyStrings()[0]);
    smileyItem.addActionListener(this);
    this.selectorBox.add(smileyItem);
  }
  this.add(selectorBox);
}
Program: 104307
Project: 104307
Buggy source:
/** 
 * The class constructor. Gets a reference to the ZRTP GUI plugin and initializes the  ZRTP GUI component members.
 */
public SCCallback(CallSession callSession){
  BundleContext bc=MediaActivator.getBundleContext();
  ServiceReference uiServiceRef=bc.getServiceReference(UIService.class.getName());
  uiService=(UIService)bc.getService(uiServiceRef);
  popupDialog=uiService.getPopupDialog();
  ServiceReference[] serRefs=null;
  this.callSession=callSession;
  String osgiFilter="String_Node_Str" + Container.CONTAINER_ID + "String_Node_Str"+ Container.CONTAINER_MAIN_TOOL_BAR.getID()+ "String_Node_Str";
  zrtpButton=(JButton)callSession.getCall().getSecureGUIComponent("String_Node_Str");
  zrtpLabel=(JLabel)callSession.getCall().getSecureGUIComponent("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * The class constructor. Gets a reference to the ZRTP GUI plugin and initializes the  ZRTP GUI component members.
 */
public SCCallback(){
  BundleContext bc=MediaActivator.getBundleContext();
  ServiceReference uiServiceRef=bc.getServiceReference(UIService.class.getName());
  uiService=(UIService)bc.getService(uiServiceRef);
  popupDialog=uiService.getPopupDialog();
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + Container.CONTAINER_ID + "String_Node_Str"+ Container.CONTAINER_MAIN_TOOL_BAR.getID()+ "String_Node_Str";
  try {
    serRefs=bc.getServiceReferences(PluginComponent.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException exc) {
    exc.printStackTrace();
  }
  if (serRefs != null) {
    for (int i=0; i < serRefs.length; i++) {
      PluginComponent component=(PluginComponent)bc.getService(serRefs[i]);
      if (component.getName().equals("String_Node_Str")) {
        zrtpPanel=(JPanel)component.getComponent();
        for (int j=0; j < zrtpPanel.getComponentCount(); j++) {
          Component subComponent=zrtpPanel.getComponent(j);
          if (subComponent.getName().equals("String_Node_Str")) {
            zrtpButton=(JButton)subComponent;
          }
 else           if (subComponent.getName().equals("String_Node_Str")) {
            zrtpLabel=(JLabel)subComponent;
          }
        }
      }
    }
  }
}
Program: 104308
Project: 104308
Buggy source:
public void actionPerformed(ActionEvent evt){
  Call call=callParticipant.getCall();
  if (call != null) {
    String command=evt.getActionCommand();
    if (command.equals("String_Node_Str")) {
      OperationSetBasicTelephony telephony=(OperationSetBasicTelephony)call.getProtocolProvider().getOperationSet(OperationSetBasicTelephony.class);
      if (telephony.getSecured(callParticipant)) {
        updateSecureButton(false);
        telephony.setSecured(callParticipant,false,OperationSetBasicTelephony.SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
      }
 else {
        updateSecureButton(true);
        telephony.setSecured(callParticipant,true,OperationSetBasicTelephony.SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
      }
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent evt){
  Call call=callParticipant.getCall();
  if (call != null) {
    String command=evt.getActionCommand();
    if (command.equals("String_Node_Str")) {
      OperationSetBasicTelephony telephony=(OperationSetBasicTelephony)call.getProtocolProvider().getOperationSet(OperationSetBasicTelephony.class);
      if (telephony.isSecured(callParticipant)) {
        updateSecureButton(false);
        telephony.setSecured(callParticipant,false,OperationSetBasicTelephony.SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
      }
 else {
        updateSecureButton(true);
        telephony.setSecured(callParticipant,true,OperationSetBasicTelephony.SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
      }
    }
  }
}
Program: 104309
Project: 104309
Buggy source:
public void setSecured(CallParticipant participant,boolean secured,OperationSetBasicTelephony.SecureStatusChangeSource source){
}

Fixed version (ground truth):
@Override public void setSecured(CallParticipant participant,boolean secured,OperationSetBasicTelephony.SecureStatusChangeSource source){
}
Program: 104310
Project: 104310
Buggy source:
public void actionPerformed(ActionEvent evt){
  JButton button=(JButton)evt.getSource();
  String buttonName=button.getName();
  if (buttonName.equals(HANGUP_BUTTON)) {
    Call call=callPanel.getCall();
    CallManager.hangupCall(call);
    this.dispose();
  }
 else   if (buttonName.equals(DIAL_BUTTON)) {
    if (dialpadDialog == null) {
      Call call=callPanel.getCall();
      if (call != null) {
        dialpadDialog=new DialpadDialog(callPanel.getCall().getCallParticipants());
      }
 else {
        dialpadDialog=new DialpadDialog(new Vector().iterator());
      }
    }
    if (!dialpadDialog.isVisible()) {
      dialpadDialog.setSize(this.getWidth() - 20,dialpadDialog.getHeight());
      dialpadDialog.setLocation(this.getX() + 10,getLocationOnScreen().y + getHeight());
      dialpadDialog.setVisible(true);
    }
 else {
      dialpadDialog.setVisible(false);
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent evt){
  JButton button=(JButton)evt.getSource();
  String buttonName=button.getName();
  if (buttonName.equals(HANGUP_BUTTON)) {
    Call call=callPanel.getCall();
    CallManager.hangupCall(call);
    this.dispose();
  }
 else   if (buttonName.equals(DIAL_BUTTON)) {
    if (dialpadDialog == null) {
      Call call=callPanel.getCall();
      if (call != null) {
        dialpadDialog=new DialpadDialog(callPanel.getCall().getCallParticipants());
      }
 else {
        dialpadDialog=new DialpadDialog(new Vector().iterator());
      }
    }
    if (!dialpadDialog.isVisible()) {
      dialpadDialog.setSize(this.getWidth() - 20,dialpadDialog.getHeight());
      dialpadDialog.setLocation(this.getX() + 10,getLocationOnScreen().y + getHeight());
      dialpadDialog.setVisible(true);
      dialpadDialog.requestFocus();
    }
 else {
      dialpadDialog.setVisible(false);
    }
  }
}
Program: 104311
Project: 104311
Buggy source:
public void focusLost(FocusEvent e){
  this.dispose();
}

Fixed version (ground truth):
public void focusLost(FocusEvent e){
  this.setVisible(false);
}
Program: 104314
Project: 104314
Buggy source:
/** 
 * Adds the specified protocol specific contact to the list of contacts merged in this meta contact. The method also keeps up to date the contactsOnline field which is used in the compareTo() method.
 * @param contact the protocol specific Contact to add.
 */
void addProtoContact(Contact contact){
synchronized (parentGroupModLock) {
    if (parentGroup != null) {
      parentGroup.lightRemoveMetaContact(this);
    }
    contactsOnline+=contact.getPresenceStatus().isOnline() ? 1 : 0;
    this.protoContacts.add(contact);
    if (this.protoContacts.size() == 1 && (this.displayName == null || this.displayName.trim().length() == 0)) {
      this.displayName=new String(contact.getDisplayName().getBytes());
    }
    if (parentGroup != null) {
      parentGroup.lightAddMetaContact(this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds the specified protocol specific contact to the list of contacts merged in this meta contact. The method also keeps up to date the contactsOnline field which is used in the compareTo() method.
 * @param contact the protocol specific Contact to add.
 */
void addProtoContact(Contact contact){
synchronized (parentGroupModLock) {
    if (parentGroup != null) {
      parentGroup.lightRemoveMetaContact(this);
    }
    contactsOnline+=contact.getPresenceStatus().isOnline() ? 1 : 0;
    this.protoContacts.add(contact);
    if (this.protoContacts.size() == 1 && (this.displayName == null || this.displayName.trim().length() == 0)) {
      this.displayName=contact.getDisplayName();
    }
    if (parentGroup != null) {
      parentGroup.lightAddMetaContact(this);
    }
  }
}
Program: 104316
Project: 104316
Buggy source:
/** 
 * Used to convert HistoryRecord in ChatRoomMessageDeliveredEvent or  ChatRoomMessageReceivedEvent which are returned by the finder methods
 * @param hr HistoryRecord
 * @param contact Contact
 * @return Object
 */
private Object convertHistoryRecordToMessageEvent(HistoryRecord hr,ChatRoom room){
  MessageImpl msg=new MessageImpl(hr);
  Date timestamp=null;
  if (msg.getMessageReceivedDate() != null) {
    if (msg.getMessageReceivedDate().after(hr.getTimestamp()) && (msg.getMessageReceivedDate().getTime() - hr.getTimestamp().getTime()) > 86400000)     timestamp=hr.getTimestamp();
 else     timestamp=msg.getMessageReceivedDate();
  }
 else   timestamp=hr.getTimestamp();
  String fromStr=hr.getPropertyValues()[5];
  ChatRoomMember from=new ChatRoomMemberImpl(fromStr,room,null);
  if (msg.isOutgoing) {
    return new ChatRoomMessageDeliveredEvent(room,timestamp,msg,ChatRoomMessageDeliveredEvent.CONVERSATION_MESSAGE_DELIVERED);
  }
 else   return new ChatRoomMessageReceivedEvent(room,from,timestamp,msg,ChatRoomMessageReceivedEvent.CONVERSATION_MESSAGE_RECEIVED);
}

Fixed version (ground truth):
/** 
 * Used to convert HistoryRecord in ChatRoomMessageDeliveredEvent or  ChatRoomMessageReceivedEvent which are returned by the finder methods
 * @param hr HistoryRecord
 * @param contact Contact
 * @return Object
 */
private Object convertHistoryRecordToMessageEvent(HistoryRecord hr,ChatRoom room){
  MessageImpl msg=createMessageFromHistoryRecord(hr);
  Date timestamp=null;
  if (msg.getMessageReceivedDate() != null) {
    if (msg.getMessageReceivedDate().after(hr.getTimestamp()) && (msg.getMessageReceivedDate().getTime() - hr.getTimestamp().getTime()) > 86400000)     timestamp=hr.getTimestamp();
 else     timestamp=msg.getMessageReceivedDate();
  }
 else   timestamp=hr.getTimestamp();
  String fromStr=hr.getPropertyValues()[5];
  ChatRoomMember from=new ChatRoomMemberImpl(fromStr,room,null);
  if (msg.isOutgoing) {
    return new ChatRoomMessageDeliveredEvent(room,timestamp,msg,ChatRoomMessageDeliveredEvent.CONVERSATION_MESSAGE_DELIVERED);
  }
 else   return new ChatRoomMessageReceivedEvent(room,from,timestamp,msg,ChatRoomMessageReceivedEvent.CONVERSATION_MESSAGE_RECEIVED);
}
Program: 104317
Project: 104317
Buggy source:
MessageImpl(HistoryRecord hr){
  for (int i=0; i < hr.getPropertyNames().length; i++) {
    String propName=hr.getPropertyNames()[i];
    if (propName.equals("String_Node_Str") || propName.equals(STRUCTURE_NAMES[1]))     textContent=hr.getPropertyValues()[i];
 else     if (propName.equals(STRUCTURE_NAMES[2]))     contentType=hr.getPropertyValues()[i];
 else     if (propName.equals(STRUCTURE_NAMES[3]))     contentEncoding=hr.getPropertyValues()[i];
 else     if (propName.equals(STRUCTURE_NAMES[4]))     messageUID=hr.getPropertyValues()[i];
 else     if (propName.equals(STRUCTURE_NAMES[5]))     subject=hr.getPropertyValues()[i];
 else     if (propName.equals(STRUCTURE_NAMES[0])) {
      if (hr.getPropertyValues()[i].equals("String_Node_Str"))       isOutgoing=false;
 else       if (hr.getPropertyValues()[i].equals("String_Node_Str"))       isOutgoing=true;
    }
 else     if (propName.equals(STRUCTURE_NAMES[6])) {
      messageReceivedDate=new Date(Long.parseLong(hr.getPropertyValues()[i]));
    }
  }
}

Fixed version (ground truth):
MessageImpl(String content,String contentType,String encoding,String subject,String messageUID,boolean isOutgoing,Date messageReceivedDate){
  super(content,contentType,encoding,subject,messageUID);
  this.isOutgoing=isOutgoing;
  this.messageReceivedDate=messageReceivedDate;
}
Program: 104318
Project: 104318
Buggy source:
/** 
 * Creates a message instance according to the specified parameters.
 * @param content the message body
 * @param contentType message content type or null for text/plain
 * @param contentEncoding message encoding or null for UTF8
 * @param subject the subject of the message or null for no subject.
 */
public MessageDictImpl(String content,String contentType,String contentEncoding,String subject){
  this.textContent=content;
  this.contentType=contentType;
  this.contentEncoding=contentEncoding;
  this.subject=subject;
  this.messageUID=String.valueOf(System.currentTimeMillis()) + String.valueOf(hashCode());
}

Fixed version (ground truth):
/** 
 * Creates a message instance according to the specified parameters.
 * @param content the message body
 * @param contentType message content type or null for text/plain
 * @param contentEncoding message encoding or null for UTF8
 * @param subject the subject of the message or null for no subject.
 */
public MessageDictImpl(String content,String contentType,String contentEncoding,String subject){
  super(content,contentType,contentEncoding,subject);
}
Program: 104319
Project: 104319
Buggy source:
/** 
 * Prepares the meta contact list service for shutdown.
 * @param bc the currently active bundle context.
 */
public void stop(BundleContext bc){
  storageManager.storeContactListAndStopStorageManager();
  bc.removeServiceListener(this);
  Iterator providers=this.currentlyInstalledProviders.values().iterator();
  while (providers.hasNext()) {
    ProtocolProviderService pp=(ProtocolProviderService)providers.next();
    OperationSetPersistentPresence opSetPersPresence=(OperationSetPersistentPresence)pp.getOperationSet(OperationSetPersistentPresence.class);
    if (opSetPersPresence != null) {
      opSetPersPresence.removeSubscriptionListener(clSubscriptionEventHandler);
      opSetPersPresence.removeServerStoredGroupChangeListener(clGroupEventHandler);
    }
 else {
      OperationSetPresence opSetPresence=(OperationSetPresence)pp.getOperationSet(OperationSetPresence.class);
      if (opSetPresence != null) {
        opSetPersPresence.removeSubscriptionListener(clSubscriptionEventHandler);
      }
    }
  }
  currentlyInstalledProviders.clear();
  if (storageManager != null) {
    storageManager.stop();
  }
}

Fixed version (ground truth):
/** 
 * Prepares the meta contact list service for shutdown.
 * @param bc the currently active bundle context.
 */
public void stop(BundleContext bc){
  storageManager.storeContactListAndStopStorageManager();
  bc.removeServiceListener(this);
  Iterator providers=this.currentlyInstalledProviders.values().iterator();
  while (providers.hasNext()) {
    ProtocolProviderService pp=(ProtocolProviderService)providers.next();
    OperationSetPersistentPresence opSetPersPresence=(OperationSetPersistentPresence)pp.getOperationSet(OperationSetPersistentPresence.class);
    if (opSetPersPresence != null) {
      opSetPersPresence.removeSubscriptionListener(clSubscriptionEventHandler);
      opSetPersPresence.removeServerStoredGroupChangeListener(clGroupEventHandler);
    }
 else {
      OperationSetPresence opSetPresence=(OperationSetPresence)pp.getOperationSet(OperationSetPresence.class);
      if (opSetPresence != null) {
        opSetPresence.removeSubscriptionListener(clSubscriptionEventHandler);
      }
    }
  }
  currentlyInstalledProviders.clear();
  if (storageManager != null) {
    storageManager.stop();
  }
}
Program: 104320
Project: 104320
Buggy source:
/** 
 * This method returns a file specific to the current user. It may not exist, but it is guaranteed that you will have the sufficient rights to create it. This file should not be considered secure because the implementor may return a file accesible to everyone. Generaly it will reside in current user's homedir, but it may as well reside in a shared directory. Note: DO NOT store unencrypted sensitive information in this file
 * @param fileName The name of the private file you wish to access
 * @return The file
 * @throws Exception if we faile to create the file.
 */
public File getPrivatePersistentFile(String fileName) throws Exception {
  File file=null;
  try {
    logger.logEntry();
    String fullPath=getFullPath(fileName);
    file=this.accessibleFile(fullPath,fileName);
    if (file == null) {
      throw new SecurityException("String_Node_Str" + "String_Node_Str" + file.getAbsolutePath());
    }
  }
  finally {
    logger.logExit();
  }
  return file;
}

Fixed version (ground truth):
/** 
 * This method returns a file specific to the current user. It may not exist, but it is guaranteed that you will have the sufficient rights to create it. This file should not be considered secure because the implementor may return a file accesible to everyone. Generaly it will reside in current user's homedir, but it may as well reside in a shared directory. Note: DO NOT store unencrypted sensitive information in this file
 * @param fileName The name of the private file you wish to access
 * @return The file
 * @throws Exception if we faile to create the file.
 */
public File getPrivatePersistentFile(String fileName) throws Exception {
  File file=null;
  try {
    logger.logEntry();
    String fullPath=getFullPath(fileName);
    file=this.accessibleFile(fullPath,fileName);
    if (file == null) {
      throw new SecurityException("String_Node_Str" + "String_Node_Str" + new File(fullPath,fileName).getPath());
    }
  }
  finally {
    logger.logExit();
  }
  return file;
}
Program: 104321
Project: 104321
Buggy source:
/** 
 * Creates an IcqContactImpl
 * @param buddy the JoustSIM object that we will be encapsulating.
 * @param ssclCallback a reference to the ServerStoredContactListIcqImplinstance that created us.
 * @param isPersistent determines whether this contact is persistent or not.
 * @param isResolved specifies whether the contact has been resolved againstthe server contact list
 */
ContactIcqImpl(Buddy buddy,ServerStoredContactListIcqImpl ssclCallback,boolean isPersistent,boolean isResolved){
  this.joustSimBuddy=buddy;
  this.isLocal=isLocal;
  this.ssclCallback=ssclCallback;
  this.isPersistent=isPersistent;
  this.isResolved=isResolved;
}

Fixed version (ground truth):
/** 
 * Creates an IcqContactImpl
 * @param buddy the JoustSIM object that we will be encapsulating.
 * @param ssclCallback a reference to the ServerStoredContactListIcqImplinstance that created us.
 * @param isPersistent determines whether this contact is persistent or not.
 * @param isResolved specifies whether the contact has been resolved againstthe server contact list
 */
ContactIcqImpl(Buddy buddy,ServerStoredContactListIcqImpl ssclCallback,boolean isPersistent,boolean isResolved){
  this.joustSimBuddy=buddy;
  this.ssclCallback=ssclCallback;
  this.isPersistent=isPersistent;
  this.isResolved=isResolved;
}
Program: 104322
Project: 104322
Buggy source:
ContactJabberImpl(String id,ServerStoredContactListJabberImpl ssclCallback,boolean isPersistent){
  this.tempId=id;
  this.isLocal=isLocal;
  this.ssclCallback=ssclCallback;
  this.isPersistent=isPersistent;
  this.isResolved=false;
  this.status=((ProtocolProviderServiceJabberImpl)getProtocolProvider()).getJabberStatusEnum().getStatus(JabberStatusEnum.OFFLINE);
}

Fixed version (ground truth):
ContactJabberImpl(String id,ServerStoredContactListJabberImpl ssclCallback,boolean isPersistent){
  this.tempId=id;
  this.ssclCallback=ssclCallback;
  this.isPersistent=isPersistent;
  this.isResolved=false;
  this.status=((ProtocolProviderServiceJabberImpl)getProtocolProvider()).getJabberStatusEnum().getStatus(JabberStatusEnum.OFFLINE);
}
Program: 104324
Project: 104324
Buggy source:
public void setUp() throws Exception {
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",serRefs != null || serRefs.length > 0);
  providerFactory=(ProtocolProviderFactory)IcqSlickFixture.bc.getService(serRefs[0]);
  ourUserID=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME);
  ServiceReference[] icqProviderRefs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ ourUserID+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + ourUserID,icqProviderRefs);
  assertTrue("String_Node_Str" + ourUserID,icqProviderRefs.length > 0);
  icqServiceRef=icqProviderRefs[0];
  provider=(ProtocolProviderService)bc.getService(icqServiceRef);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",(serRefs != null) && (serRefs.length > 0));
  providerFactory=(ProtocolProviderFactory)IcqSlickFixture.bc.getService(serRefs[0]);
  ourUserID=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME);
  ServiceReference[] icqProviderRefs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ ourUserID+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + ourUserID,icqProviderRefs);
  assertTrue("String_Node_Str" + ourUserID,icqProviderRefs.length > 0);
  icqServiceRef=icqProviderRefs[0];
  provider=(ProtocolProviderService)bc.getService(icqServiceRef);
}
Program: 104332
Project: 104332
Buggy source:
/** 
 * Sets the call-hold related attribute of a specific <tt>MediaDescription</tt> to a specific value depending on the type of hold this <tt>CallSession</tt> is currently in.
 * @param mediaDescription the <tt>MediaDescription</tt> to set thecall-hold related attribute of
 * @param onHold the call-hold state of this <tt>CallSession</tt> which isa combination of  {@link #ON_HOLD_LOCALLY} and{@link #ON_HOLD_REMOTELY}
 * @throws SdpException
 */
private void setAttributeOnHold(MediaDescription mediaDescription,byte onHold) throws SdpException {
  String attribute;
  if (ON_HOLD_LOCALLY == (onHold | ON_HOLD_LOCALLY))   attribute=(ON_HOLD_REMOTELY == (onHold | ON_HOLD_REMOTELY)) ? "String_Node_Str" : "String_Node_Str";
 else   attribute=(ON_HOLD_REMOTELY == (onHold | ON_HOLD_REMOTELY)) ? "String_Node_Str" : null;
  if (attribute != null)   mediaDescription.setAttribute(attribute,null);
}

Fixed version (ground truth):
/** 
 * Sets the call-hold related attribute of a specific <tt>MediaDescription</tt> to a specific value depending on the type of hold this <tt>CallSession</tt> is currently in.
 * @param mediaDescription the <tt>MediaDescription</tt> to set thecall-hold related attribute of
 * @param onHold the call-hold state of this <tt>CallSession</tt> which isa combination of  {@link #ON_HOLD_LOCALLY} and{@link #ON_HOLD_REMOTELY}
 * @throws SdpException
 */
private void setAttributeOnHold(MediaDescription mediaDescription,byte onHold) throws SdpException {
  String attribute;
  if (ON_HOLD_LOCALLY == (onHold & ON_HOLD_LOCALLY))   attribute=(ON_HOLD_REMOTELY == (onHold & ON_HOLD_REMOTELY)) ? "String_Node_Str" : "String_Node_Str";
 else   attribute=(ON_HOLD_REMOTELY == (onHold & ON_HOLD_REMOTELY)) ? "String_Node_Str" : null;
  if (attribute != null)   mediaDescription.setAttribute(attribute,null);
}
Program: 104333
Project: 104333
Buggy source:
/** 
 * Checks whether the current component will  exceeds the screen size and if it do will set a default size 
 */
private void ensureOnScreenLocationAndSize(){
  int x=this.getX();
  int y=this.getY();
  int width=this.getWidth();
  int height=this.getHeight();
  int screenWidth=Toolkit.getDefaultToolkit().getScreenSize().width;
  int screenHeight=Toolkit.getDefaultToolkit().getScreenSize().height;
  if (x < 0 || y < 0) {
    this.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - this.getWidth() / 2,50);
    x=this.getX();
    y=this.getY();
  }
  if (x + width > screenWidth || y + height > screenHeight - 50) {
    double aspect=(double)width / height;
    int newHeight=screenHeight - 100;
    int newWidth=(int)(newHeight * aspect);
    this.setPreferredSize(new Dimension(newWidth,newHeight));
    this.setSize(newWidth,newHeight);
  }
}

Fixed version (ground truth):
/** 
 * Checks whether the current component will  exceeds the screen size and if it do will set a default size 
 */
private void ensureOnScreenLocationAndSize(){
  int x=this.getX();
  int y=this.getY();
  int width=this.getWidth();
  int height=this.getHeight();
  int screenWidth=Toolkit.getDefaultToolkit().getScreenSize().width;
  int screenHeight=Toolkit.getDefaultToolkit().getScreenSize().height;
  if (x < 0 || y < 0) {
    this.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - this.getWidth() / 2,50);
    x=this.getX();
    y=this.getY();
  }
  Rectangle virtualBounds=new Rectangle();
  GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] gs=ge.getScreenDevices();
  for (int j=0; j < gs.length; j++) {
    GraphicsDevice gd=gs[j];
    GraphicsConfiguration[] gc=gd.getConfigurations();
    for (int i=0; i < gc.length; i++) {
      virtualBounds=virtualBounds.union(gc[i].getBounds());
    }
  }
  if (!(virtualBounds.contains(x,y) && virtualBounds.contains(x + width,y + height))) {
    if (x + width > virtualBounds.width) {
      x=virtualBounds.width - width;
      if (x < 20) {
        x=20;
        width=virtualBounds.width - 40;
      }
    }
    if (y + height > virtualBounds.height) {
      y=virtualBounds.height - height;
      if (y < 20) {
        y=20;
        height=virtualBounds.height - 40;
      }
    }
    this.setPreferredSize(new Dimension(width,height));
    this.setSize(width,height);
    this.setLocation(x,y);
  }
}
Program: 104334
Project: 104334
Buggy source:
/** 
 * Checks whether the current component will  exceeds the screen size and if it do will set a default size 
 */
private void ensureOnScreenLocationAndSize(){
  int x=this.getX();
  int y=this.getY();
  int width=this.getWidth();
  int height=this.getHeight();
  int screenWidth=Toolkit.getDefaultToolkit().getScreenSize().width;
  int screenHeight=Toolkit.getDefaultToolkit().getScreenSize().height;
  if (x < 0 || y < 0) {
    this.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - this.getWidth() / 2,50);
    x=this.getX();
    y=this.getY();
  }
  if (x + width > screenWidth || y + height > screenHeight - 50) {
    double aspect=(double)width / height;
    int newHeight=screenHeight - 100;
    int newWidth=(int)(newHeight * aspect);
    this.setPreferredSize(new Dimension(newWidth,newHeight));
    this.setSize(newWidth,newHeight);
  }
}

Fixed version (ground truth):
/** 
 * Checks whether the current component will  exceeds the screen size and if it do will set a default size 
 */
private void ensureOnScreenLocationAndSize(){
  int x=this.getX();
  int y=this.getY();
  int width=this.getWidth();
  int height=this.getHeight();
  int screenWidth=Toolkit.getDefaultToolkit().getScreenSize().width;
  int screenHeight=Toolkit.getDefaultToolkit().getScreenSize().height;
  if (x < 0 || y < 0) {
    this.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - this.getWidth() / 2,50);
    x=this.getX();
    y=this.getY();
  }
  Rectangle virtualBounds=new Rectangle();
  GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] gs=ge.getScreenDevices();
  for (int j=0; j < gs.length; j++) {
    GraphicsDevice gd=gs[j];
    GraphicsConfiguration[] gc=gd.getConfigurations();
    for (int i=0; i < gc.length; i++) {
      virtualBounds=virtualBounds.union(gc[i].getBounds());
    }
  }
  if (!(virtualBounds.contains(x,y) && virtualBounds.contains(x + width,y + height))) {
    if (x + width > virtualBounds.width) {
      x=virtualBounds.width - width;
      if (x < 20) {
        x=20;
        width=virtualBounds.width - 40;
      }
    }
    if (y + height > virtualBounds.height) {
      y=virtualBounds.height - height;
      if (y < 20) {
        y=20;
        height=virtualBounds.height - 40;
      }
    }
    this.setPreferredSize(new Dimension(width,height));
    this.setSize(width,height);
    this.setLocation(x,y);
  }
}
Program: 104337
Project: 104337
Buggy source:
/** 
 * Process the responses of sent messages
 * @param responseEvent the incoming event holding the response
 * @return whether this message needs further processing(true) or no(false)
 */
public boolean processResponse(ResponseEvent responseEvent,Map sentMsg){
  String content=null;
  Request req=responseEvent.getClientTransaction().getRequest();
  ContentTypeHeader ctheader=(ContentTypeHeader)req.getHeader(ContentTypeHeader.NAME);
  if (ctheader == null && !ctheader.getContentSubType().equalsIgnoreCase(CONTENT_SUBTYPE))   return true;
  int status=responseEvent.getResponse().getStatusCode();
  if (status >= 200 && status < 300) {
    logger.debug("String_Node_Str" + responseEvent.getResponse().getReasonPhrase());
    String key=((CallIdHeader)req.getHeader(CallIdHeader.NAME)).getCallId();
    sentMsg.remove(key);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Process the responses of sent messages
 * @param responseEvent the incoming event holding the response
 * @return whether this message needs further processing(true) or no(false)
 */
public boolean processResponse(ResponseEvent responseEvent,Map sentMsg){
  String content=null;
  Request req=responseEvent.getClientTransaction().getRequest();
  ContentTypeHeader ctheader=(ContentTypeHeader)req.getHeader(ContentTypeHeader.NAME);
  if (ctheader == null || !ctheader.getContentSubType().equalsIgnoreCase(CONTENT_SUBTYPE))   return true;
  int status=responseEvent.getResponse().getStatusCode();
  String key=((CallIdHeader)req.getHeader(CallIdHeader.NAME)).getCallId();
  if (status >= 200 && status < 300) {
    logger.debug("String_Node_Str" + responseEvent.getResponse().getReasonPhrase());
    sentMsg.remove(key);
    return false;
  }
 else   if (status >= 400 && status != 401 && status != 407) {
    logger.warn("String_Node_Str" + responseEvent.getResponse().getReasonPhrase());
    sentMsg.remove(key);
    return false;
  }
  return true;
}
Program: 104339
Project: 104339
Buggy source:
public void messageDelivered(MessageDeliveredEvent evt){
  Message msg=evt.getSourceMessage();
  Contact contact=evt.getDestinationContact();
  processMessage(contact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,msg.getContent(),msg.getContentType());
  processMessage(contact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ACTION_MESSAGE,Messages.getI18NString("String_Node_Str").getText(),"String_Node_Str");
  smsOpSet.removeMessageListener(this);
}

Fixed version (ground truth):
public void messageDelivered(MessageDeliveredEvent evt){
  Message msg=evt.getSourceMessage();
  if (sentSmsMessage == null || !sentSmsMessage.equals(msg))   return;
  sentSmsMessage=null;
  Contact contact=evt.getDestinationContact();
  processMessage(contact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,msg.getContent(),msg.getContentType());
  processMessage(contact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ACTION_MESSAGE,Messages.getI18NString("String_Node_Str").getText(),"String_Node_Str");
}
Program: 104340
Project: 104340
Buggy source:
public void messageDeliveryFailed(MessageDeliveryFailedEvent evt){
  logger.error(evt.getReason());
  String errorMsg=null;
  Message sourceMessage=(Message)evt.getSource();
  Contact sourceContact=evt.getDestinationContact();
  MetaContact metaContact=chatWindow.getMainFrame().getContactList().findMetaContactByContact(sourceContact);
  if (evt.getErrorCode() == MessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.NETWORK_FAILURE) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.PROVIDER_NOT_REGISTERED) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.INTERNAL_ERROR) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
  processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,sourceMessage.getContent(),sourceMessage.getContentType());
  processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ERROR_MESSAGE,errorMsg,"String_Node_Str");
  smsOpSet.removeMessageListener(this);
}

Fixed version (ground truth):
public void messageDeliveryFailed(MessageDeliveryFailedEvent evt){
  logger.error(evt.getReason());
  String errorMsg=null;
  Message sourceMessage=(Message)evt.getSource();
  if (sentSmsMessage == null || !sentSmsMessage.equals(sourceMessage))   return;
  sentSmsMessage=null;
  Contact sourceContact=evt.getDestinationContact();
  MetaContact metaContact=chatWindow.getMainFrame().getContactList().findMetaContactByContact(sourceContact);
  if (evt.getErrorCode() == MessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.NETWORK_FAILURE) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.PROVIDER_NOT_REGISTERED) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else   if (evt.getErrorCode() == MessageDeliveryFailedEvent.INTERNAL_ERROR) {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
 else {
    errorMsg=Messages.getI18NString("String_Node_Str").getText();
  }
  processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,sourceMessage.getContent(),sourceMessage.getContentType());
  processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ERROR_MESSAGE,errorMsg,"String_Node_Str");
}
Program: 104341
Project: 104341
Buggy source:
private void sendSmsMessage(String text){
  OperationSetSmsMessaging smsOpSet=null;
  Iterator protocolProviders=chatWindow.getMainFrame().getProtocolProviders();
  while (protocolProviders.hasNext()) {
    ProtocolProviderService protocolProvider=(ProtocolProviderService)protocolProviders.next();
    smsOpSet=(OperationSetSmsMessaging)protocolProvider.getOperationSet(OperationSetSmsMessaging.class);
    if (smsOpSet != null)     break;
  }
  if (smsOpSet == null) {
    logger.error("String_Node_Str");
    this.refreshWriteArea();
    this.processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,text,"String_Node_Str");
    this.processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ERROR_MESSAGE,Messages.getI18NString("String_Node_Str").getText(),"String_Node_Str");
    return;
  }
  smsOpSet.addMessageListener(new SmsMessageListener(smsOpSet));
  Message message=smsOpSet.createMessage(text);
  SendSmsDialog smsDialog=new SendSmsDialog(this,message,smsOpSet);
  smsDialog.setPreferredSize(new Dimension(400,200));
  smsDialog.setVisible(true);
}

Fixed version (ground truth):
private void sendSmsMessage(String text){
  OperationSetSmsMessaging smsOpSet=null;
  Iterator protocolProviders=chatWindow.getMainFrame().getProtocolProviders();
  while (protocolProviders.hasNext()) {
    ProtocolProviderService protocolProvider=(ProtocolProviderService)protocolProviders.next();
    smsOpSet=(OperationSetSmsMessaging)protocolProvider.getOperationSet(OperationSetSmsMessaging.class);
    if (smsOpSet != null)     break;
  }
  if (smsOpSet == null) {
    logger.error("String_Node_Str");
    this.refreshWriteArea();
    this.processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.OUTGOING_MESSAGE,text,"String_Node_Str");
    this.processMessage(metaContact.getDisplayName(),new Date(System.currentTimeMillis()),Constants.ERROR_MESSAGE,Messages.getI18NString("String_Node_Str").getText(),"String_Node_Str");
    return;
  }
  smsOpSet.addMessageListener(new SmsMessageListener(smsOpSet));
  sentSmsMessage=smsOpSet.createMessage(text);
  SendSmsDialog smsDialog=new SendSmsDialog(this,sentSmsMessage,smsOpSet);
  smsDialog.setPreferredSize(new Dimension(400,200));
  smsDialog.setVisible(true);
}
Program: 104343
Project: 104343
Buggy source:
void sendRequestMessage(Request mes,Contact to,Message message){
  CallIdHeader call=(CallIdHeader)mes.getHeader(CallIdHeader.NAME);
  String callid=call.getCallId();
  AuthorizationHeader authorization=sipProvider.getSipSecurityManager().getCachedAuthorizationHeader(callid);
  if (authorization != null)   mes.addHeader(authorization);
  ClientTransaction messageTransaction;
  SipProvider jainSipProvider=this.sipProvider.getDefaultJainSipProvider();
  try {
    messageTransaction=jainSipProvider.getNewClientTransaction(mes);
  }
 catch (  TransactionUnavailableException ex) {
    logger.error("String_Node_Str" + "String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.NETWORK_FAILURE,new Date());
    fireMessageEvent(evt);
    return;
  }
  try {
    messageTransaction.sendRequest();
  }
 catch (  SipException ex) {
    logger.error("String_Node_Str",ex);
    MessageDeliveryFailedEvent evt=new MessageDeliveryFailedEvent(message,to,MessageDeliveryFailedEvent.INTERNAL_ERROR,new Date());
    fireMessageEvent(evt);
    return;
  }
  String key=((CallIdHeader)mes.getHeader(CallIdHeader.NAME)).getCallId();
  this.sentMsg.put(key,message);
}

Fixed version (ground truth):
void sendRequestMessage(Request mes,Contact to,Message message) throws TransactionUnavailableException, SipException {
  CallIdHeader call=(CallIdHeader)mes.getHeader(CallIdHeader.NAME);
  String callid=call.getCallId();
  AuthorizationHeader authorization=sipProvider.getSipSecurityManager().getCachedAuthorizationHeader(callid);
  if (authorization != null)   mes.addHeader(authorization);
  ClientTransaction messageTransaction;
  SipProvider jainSipProvider=this.sipProvider.getDefaultJainSipProvider();
  messageTransaction=jainSipProvider.getNewClientTransaction(mes);
  messageTransaction.sendRequest();
  String key=((CallIdHeader)mes.getHeader(CallIdHeader.NAME)).getCallId();
  this.sentMsg.put(key,message);
}
Program: 104345
Project: 104345
Buggy source:
/** 
 * Indicates whether some other object is "equal to" this one. <p>
 * @param obj   the reference object with which to compare.
 * @return  <tt>true</tt> if this object is the same as the objargument; <tt>false</tt> otherwise.
 */
public boolean equals(Object obj){
  if (obj == null || !(obj instanceof ContactJabberImpl) || !(((ContactJabberImpl)obj).getAddress().equals(getAddress()) && ((ContactJabberImpl)obj).getProtocolProvider() == getProtocolProvider()))   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * Indicates whether some other object is "equal to" this one. <p>
 * @param obj   the reference object with which to compare.
 * @return  <tt>true</tt> if this object is the same as the objargument; <tt>false</tt> otherwise.
 */
public boolean equals(Object obj){
  if (obj == null || !(obj instanceof ContactJabberImpl) || !(((ContactJabberImpl)obj).getAddress().equalsIgnoreCase(getAddress()) && ((ContactJabberImpl)obj).getProtocolProvider() == getProtocolProvider()))   return false;
  return true;
}
Program: 104346
Project: 104346
Buggy source:
/** 
 * Returns the Contact with the specified id or null if no such id was found.
 * @param id the id of the contact to find.
 * @return the <tt>Contact</tt> carrying the specified<tt>screenName</tt> or <tt>null</tt> if no such contact exits.
 */
public ContactJabberImpl findContactById(String id){
  Iterator contactGroups=rootGroup.subgroups();
  ContactJabberImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupJabberImpl contactGroup=(ContactGroupJabberImpl)contactGroups.next();
    result=contactGroup.findContact(id);
    if (result != null)     return result;
  }
  Iterator rootContacts=rootGroup.contacts();
  while (rootContacts.hasNext()) {
    ContactJabberImpl item=(ContactJabberImpl)rootContacts.next();
    if (item.getAddress().equals(id))     return item;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the Contact with the specified id or null if no such id was found.
 * @param id the id of the contact to find.
 * @return the <tt>Contact</tt> carrying the specified<tt>screenName</tt> or <tt>null</tt> if no such contact exits.
 */
public ContactJabberImpl findContactById(String id){
  Iterator contactGroups=rootGroup.subgroups();
  ContactJabberImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupJabberImpl contactGroup=(ContactGroupJabberImpl)contactGroups.next();
    result=contactGroup.findContact(id);
    if (result != null)     return result;
  }
  Iterator rootContacts=rootGroup.contacts();
  while (rootContacts.hasNext()) {
    ContactJabberImpl item=(ContactJabberImpl)rootContacts.next();
    if (item.getAddress().equalsIgnoreCase(id))     return item;
  }
  return null;
}
Program: 104347
Project: 104347
Buggy source:
public DialButton(CallManager manager,ImageIcon iconImage){
  super(iconImage);
  this.callManager=manager;
  this.setOpaque(false);
  this.setToolTipText(Messages.getI18NString("String_Node_Str").getText());
  dialpadDialog=new CallParticipantDialpadDialog(callManager,callParticipant);
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (!dialpadDialog.isVisible()) {
        dialpadDialog.setLocation(callManager.getMainFrame().getX() + (callManager.getMainFrame().getWidth() - dialpadDialog.getWidth()) / 2,getLocationOnScreen().y + getHeight());
        dialpadDialog.setVisible(true);
      }
 else {
        dialpadDialog.setVisible(false);
      }
    }
  }
);
}

Fixed version (ground truth):
public DialButton(CallManager manager,ImageIcon iconImage){
  super(iconImage);
  this.callManager=manager;
  this.setOpaque(false);
  this.setToolTipText(Messages.getI18NString("String_Node_Str").getText());
  dialpadDialog=new CallParticipantDialpadDialog(callManager,callParticipant);
  this.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      if (!dialpadDialog.isVisible()) {
        dialpadDialog.setSize(callManager.getMainFrame().getWidth() - 20,dialpadDialog.getHeight());
        dialpadDialog.setLocation(callManager.getMainFrame().getX() + 10,getLocationOnScreen().y + getHeight());
        dialpadDialog.setVisible(true);
      }
 else {
        dialpadDialog.setVisible(false);
      }
    }
  }
);
}
Program: 104348
Project: 104348
Buggy source:
public void actionPerformed(ActionEvent e){
  if (!dialpadDialog.isVisible()) {
    dialpadDialog.setLocation(callManager.getMainFrame().getX() + (callManager.getMainFrame().getWidth() - dialpadDialog.getWidth()) / 2,getLocationOnScreen().y + getHeight());
    dialpadDialog.setVisible(true);
  }
 else {
    dialpadDialog.setVisible(false);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (!dialpadDialog.isVisible()) {
    dialpadDialog.setSize(callManager.getMainFrame().getWidth() - 20,dialpadDialog.getHeight());
    dialpadDialog.setLocation(callManager.getMainFrame().getX() + 10,getLocationOnScreen().y + getHeight());
    dialpadDialog.setVisible(true);
  }
 else {
    dialpadDialog.setVisible(false);
  }
}