nus-yam/ex-repair huggingface dataset:
Program: 102988
Project: 102988
Buggy source:
/** 
 * The OTRv3OutgoingSessionSwitcher constructor
 */
public OTRv3OutgoingSessionSwitcher(Container container,PluginComponentFactory parentFactory){
  this.parentFactory=parentFactory;
  setPreferredSize(new Dimension(30,28));
  setMaximumSize(new Dimension(30,28));
  setMinimumSize(new Dimension(30,28));
  this.menu.setPreferredSize(new Dimension(30,45));
  this.menu.setMaximumSize(new Dimension(30,45));
  this.add(menu);
  this.setBorder(null);
  this.menu.setBorder(null);
  this.menu.setOpaque(false);
  this.setOpaque(false);
  this.menu.setVisible(false);
  buildMenu(contact);
  new OtrWeakListener<OTRv3OutgoingSessionSwitcher>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  try {
    finishedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    verifiedLockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    unverifiedLockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    unlockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
  }
 catch (  IOException e) {
    logger.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * The OTRv3OutgoingSessionSwitcher constructor
 */
public OTRv3OutgoingSessionSwitcher(Container container,PluginComponentFactory parentFactory){
  this.parentFactory=parentFactory;
  setPreferredSize(new Dimension(30,28));
  setMaximumSize(new Dimension(30,28));
  setMinimumSize(new Dimension(30,28));
  this.menu.setPreferredSize(new Dimension(30,45));
  this.menu.setMaximumSize(new Dimension(30,45));
  this.add(menu);
  this.setBorder(null);
  this.menu.setBorder(null);
  this.menu.setOpaque(false);
  this.setOpaque(false);
  this.menu.setVisible(false);
  new OtrWeakListener<OTRv3OutgoingSessionSwitcher>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  try {
    finishedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    verifiedLockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    unverifiedLockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
    unlockedPadlockImage=new ImageIcon(ImageIO.read(OtrActivator.resourceService.getImageURL("String_Node_Str")));
  }
 catch (  IOException e) {
    logger.debug("String_Node_Str");
  }
  buildMenu(contact);
}
Program: 102989
Project: 102989
Buggy source:
/** 
 * Shows chat room open automatically configuration dialog.
 * @param chatRoomId the chat room id of the chat room associated with the dialog 
 * @param pps the protocol provider service of the chat room
 */
public void showChatRoomAutoOpenConfigDialog(ProtocolProviderService pps,String chatRoomId){
  new ChatRoomAutoOpenConfigDialog(pps,chatRoomId);
}

Fixed version (ground truth):
/** 
 * Shows chat room open automatically configuration dialog.
 * @param chatRoomId the chat room id of the chat room associated with the dialog 
 * @param pps the protocol provider service of the chat room
 */
public void showChatRoomAutoOpenConfigDialog(ProtocolProviderService pps,String chatRoomId){
  ChatRoomAutoOpenConfigDialog.showChatRoomAutoOpenConfigDialog(pps,chatRoomId);
}
Program: 102990
Project: 102990
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  Object source=e.getSource();
  if (source instanceof JButton) {
    if (source.equals(okButton)) {
      MUCService.setChatRoomAutoOpenOption(pps,chatRoomId,value);
    }
    this.dispose();
  }
 else   if (source instanceof JRadioButton) {
    if (source.equals(openOnActivity)) {
      value=MUCService.OPEN_ON_ACTIVITY;
    }
 else     if (source.equals(openOnImportantMessage)) {
      value=MUCService.OPEN_ON_IMPORTANT_MESSAGE;
    }
 else {
      value=MUCService.OPEN_ON_MESSAGE;
    }
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  Object source=e.getSource();
  if (source instanceof JButton) {
    if (source.equals(okButton)) {
      MUCService.setChatRoomAutoOpenOption(pps,chatRoomId,value);
    }
    this.dispose();
  }
 else   if (source instanceof JRadioButton) {
    if (source.equals(openOnActivity)) {
      value=MUCService.OPEN_ON_ACTIVITY;
    }
 else     if (source.equals(openOnMessage)) {
      value=MUCService.OPEN_ON_MESSAGE;
    }
 else {
      value=MUCService.OPEN_ON_IMPORTANT_MESSAGE;
    }
  }
}
Program: 102991
Project: 102991
Buggy source:
@Override public void dispose(){
  GuiActivator.getConfigurationService().removePropertyChangeListener(MessageHistoryService.PNAME_IS_MESSAGE_HISTORY_ENABLED,propertyListener);
  GuiActivator.getConfigurationService().removePropertyChangeListener(MessageHistoryService.PNAME_IS_MESSAGE_HISTORY_PER_CONTACT_ENABLED_PREFIX + "String_Node_Str" + chatRoomId,propertyListener);
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  clearListeners();
  super.dispose();
}
Program: 102993
Project: 102993
Buggy source:
@Override public String getText(SourceContact actionSource){
  if (!name.equals("String_Node_Str"))   return text;
  String openAutomaticallyValue=MUCService.getChatRoomAutoOpenOption(((ChatRoomSourceContact)actionSource).getProvider(),((ChatRoomSourceContact)actionSource).getChatRoomID());
  if (openAutomaticallyValue == null)   openAutomaticallyValue=MUCService.OPEN_ON_MESSAGE;
  String openAutomaticallyKey=MUCService.autoOpenConfigValuesTexts.get(openAutomaticallyValue);
  return text + "String_Node_Str" + resources.getI18NString(openAutomaticallyKey)+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getText(SourceContact actionSource){
  if (!name.equals("String_Node_Str"))   return text;
  String openAutomaticallyValue=MUCService.getChatRoomAutoOpenOption(((ChatRoomSourceContact)actionSource).getProvider(),((ChatRoomSourceContact)actionSource).getChatRoomID());
  if (openAutomaticallyValue == null)   openAutomaticallyValue=MUCService.OPEN_ON_IMPORTANT_MESSAGE;
  String openAutomaticallyKey=MUCService.autoOpenConfigValuesTexts.get(openAutomaticallyValue);
  return "String_Node_Str" + text + "String_Node_Str"+ resources.getI18NString(openAutomaticallyKey)+ "String_Node_Str";
}
Program: 102994
Project: 102994
Buggy source:
/** 
 * The OtrContactMenu constructor.
 * @param otrContact the OtrContact this menu refers to.
 * @param inMacOSXScreenMenuBar <tt>true</tt> if the new menu is to bedisplayed in the Mac OS X screen menu bar; <tt>false</tt>, otherwise
 * @param menu the parent menu
 */
public OtrContactMenu(OtrContact otrContact,boolean inMacOSXScreenMenuBar,JMenu menu,boolean isSeparateMenu){
  this.contact=otrContact;
  this.inMacOSXScreenMenuBar=inMacOSXScreenMenuBar;
  this.parentMenu=menu;
  String resourceName=otrContact.resource != null ? "String_Node_Str" + otrContact.resource.getResourceName() : "String_Node_Str";
  separateMenu=isSeparateMenu ? new SIPCommMenu(otrContact.contact.getDisplayName() + resourceName) : null;
  new OtrWeakListener<OtrContactMenu>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(this.contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact));
  OtrPolicy policy=OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact);
  if (policy.getAllowV1() && policy.getAllowV2() && !policy.getAllowV3()) {
    policy.setAllowV3(true);
    OtrActivator.scOtrEngine.setContactPolicy(contact.contact,policy);
  }
  policy=OtrActivator.scOtrEngine.getGlobalPolicy();
  if (policy.getAllowV1() && policy.getAllowV2() && !policy.getAllowV3()) {
    policy.setAllowV3(true);
    OtrActivator.scOtrEngine.setGlobalPolicy(policy);
  }
  buildMenu();
}

Fixed version (ground truth):
/** 
 * The OtrContactMenu constructor.
 * @param otrContact the OtrContact this menu refers to.
 * @param inMacOSXScreenMenuBar <tt>true</tt> if the new menu is to bedisplayed in the Mac OS X screen menu bar; <tt>false</tt>, otherwise
 * @param menu the parent menu
 */
public OtrContactMenu(OtrContact otrContact,boolean inMacOSXScreenMenuBar,JMenu menu,boolean isSeparateMenu){
  this.contact=otrContact;
  this.inMacOSXScreenMenuBar=inMacOSXScreenMenuBar;
  this.parentMenu=menu;
  String resourceName=otrContact.resource != null ? "String_Node_Str" + otrContact.resource.getResourceName() : "String_Node_Str";
  separateMenu=isSeparateMenu ? new SIPCommMenu(otrContact.contact.getDisplayName() + resourceName) : null;
  new OtrWeakListener<OtrContactMenu>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(this.contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact));
  updateOldOtrPoliciesIfNeeded(otrContact);
  buildMenu();
}
Program: 102995
Project: 102995
Buggy source:
/** 
 * Sends <tt>message</tt> as a message correction through this transport, specifying the mime type (html or plain text) and the id of the message to replace.
 * @param message The message to send.
 * @param mimeType The mime type of the message to send: text/html ortext/plain.
 * @param correctedMessageUID The ID of the message being corrected bythis message.
 */
public void correctInstantMessage(String message,String mimeType,String correctedMessageUID){
  if (!allowsMessageCorrections()) {
    return;
  }
  OperationSetMessageCorrection mcOpSet=contact.getProtocolProvider().getOperationSet(OperationSetMessageCorrection.class);
  Message msg;
  if (mimeType.equals(OperationSetBasicInstantMessaging.HTML_MIME_TYPE) && mcOpSet.isContentTypeSupported(OperationSetBasicInstantMessaging.HTML_MIME_TYPE)) {
    msg=mcOpSet.createMessage(message,OperationSetBasicInstantMessaging.HTML_MIME_TYPE,"String_Node_Str","String_Node_Str");
  }
 else {
    msg=mcOpSet.createMessage(message);
  }
  mcOpSet.correctMessage(contact,msg,correctedMessageUID);
}

Fixed version (ground truth):
/** 
 * Sends <tt>message</tt> as a message correction through this transport, specifying the mime type (html or plain text) and the id of the message to replace.
 * @param message The message to send.
 * @param mimeType The mime type of the message to send: text/html ortext/plain.
 * @param correctedMessageUID The ID of the message being corrected bythis message.
 */
public void correctInstantMessage(String message,String mimeType,String correctedMessageUID){
  if (!allowsMessageCorrections()) {
    return;
  }
  OperationSetMessageCorrection mcOpSet=contact.getProtocolProvider().getOperationSet(OperationSetMessageCorrection.class);
  Message msg;
  if (mimeType.equals(OperationSetBasicInstantMessaging.HTML_MIME_TYPE) && mcOpSet.isContentTypeSupported(OperationSetBasicInstantMessaging.HTML_MIME_TYPE)) {
    msg=mcOpSet.createMessage(message,OperationSetBasicInstantMessaging.HTML_MIME_TYPE,"String_Node_Str","String_Node_Str");
  }
 else {
    msg=mcOpSet.createMessage(message);
  }
  mcOpSet.correctMessage(contact,contactResource,msg,correctedMessageUID);
}
Program: 102996
Project: 102996
Buggy source:
/** 
 * Replaces the message with ID <tt>correctedMessageUID</tt> sent to the contact <tt>to</tt> with the message <tt>message</tt>
 * @param to The contact to send the message to.
 * @param message The new message.
 * @param correctedMessageUID The ID of the message being replaced.
 */
public void correctMessage(Contact to,Message message,String correctedMessageUID){
  PacketExtension[] exts=new PacketExtension[1];
  exts[0]=new MessageCorrectionExtension(correctedMessageUID);
  MessageDeliveredEvent msgDelivered=sendMessage(to,null,message,exts);
  msgDelivered.setCorrectedMessageUID(correctedMessageUID);
  fireMessageEvent(msgDelivered);
}

Fixed version (ground truth):
/** 
 * Replaces the message with ID <tt>correctedMessageUID</tt> sent to the contact <tt>to</tt> with the message <tt>message</tt>
 * @param to The contact to send the message to.
 * @param message The new message.
 * @param correctedMessageUID The ID of the message being replaced.
 */
public void correctMessage(Contact to,ContactResource resource,Message message,String correctedMessageUID){
  PacketExtension[] exts=new PacketExtension[1];
  exts[0]=new MessageCorrectionExtension(correctedMessageUID);
  MessageDeliveredEvent msgDelivered=sendMessage(to,resource,message,exts);
  msgDelivered.setCorrectedMessageUID(correctedMessageUID);
  fireMessageEvent(msgDelivered);
}
Program: 102997
Project: 102997
Buggy source:
/** 
 * Replaces the message with ID <tt>correctedMessageUID</tt> sent to the contact <tt>to</tt> with the message <tt>message</tt>
 * @param to The contact to send the message to.
 * @param message The new message.
 * @param correctedMessageUID The ID of the message being replaced.
 */
public void correctMessage(Contact to,Message message,String correctedMessageUID);

Fixed version (ground truth):
/** 
 * Replaces the message with ID <tt>correctedMessageUID</tt> sent to the contact <tt>to</tt> with the message <tt>message</tt>
 * @param to The contact to send the message to.
 * @param resource The ContactResource to send the message to.
 * @param message The new message.
 * @param correctedMessageUID The ID of the message being replaced.
 */
public void correctMessage(Contact to,ContactResource resource,Message message,String correctedMessageUID);
Program: 102998
Project: 102998
Buggy source:
@Override public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt){
  ChatRoom sourceChatRoom=evt.getSourceChatRoom();
  ChatRoomWrapper chatRoomWrapper=GuiActivator.getMUCService().findChatRoomWrapperFromChatRoom(sourceChatRoom);
  ChatWindowManager chatWindowManager=GuiActivator.getUIService().getChatWindowManager();
  ChatPanel chatPanel=chatWindowManager.getMultiChat(chatRoomWrapper,true);
  chatWindowManager.openChat(chatPanel,true);
}

Fixed version (ground truth):
@Override public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt){
  if (evt.isInitial())   return;
  ChatRoom sourceChatRoom=evt.getSourceChatRoom();
  ChatRoomWrapper chatRoomWrapper=GuiActivator.getMUCService().findChatRoomWrapperFromChatRoom(sourceChatRoom);
  ChatWindowManager chatWindowManager=GuiActivator.getUIService().getChatWindowManager();
  ChatPanel chatPanel=chatWindowManager.getMultiChat(chatRoomWrapper,true);
  chatWindowManager.openChat(chatPanel,true);
}
Program: 102999
Project: 102999
Buggy source:
/** 
 * Processes a <tt>Presence</tt> packet addressed to our own occupant JID.
 * @param presence the packet to process.
 */
private void processOwnPresence(Presence presence){
  MUCUser mucUser=getMUCUserExtension(presence);
  if (mucUser != null) {
    String affiliation=mucUser.getItem().getAffiliation();
    String role=mucUser.getItem().getRole();
    if (mucUser.getStatus() != null && "String_Node_Str".equals(mucUser.getStatus().getCode())) {
      try {
        multiUserChat.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
      }
 catch (      XMPPException e) {
        logger.error("String_Node_Str",e);
      }
      opSetMuc.addSmackInvitationRejectionListener(multiUserChat,chatRoom);
      if (affiliation.equalsIgnoreCase(ChatRoomMemberRole.OWNER.getRoleName().toLowerCase())) {
        setLocalUserRole(ChatRoomMemberRole.OWNER);
      }
 else       setLocalUserRole(ChatRoomMemberRole.MODERATOR);
    }
 else {
      ChatRoomMemberRole jitsiRole=ChatRoomJabberImpl.smackRoleToScRole(role,affiliation);
      if (jitsiRole == ChatRoomMemberRole.MODERATOR || jitsiRole == ChatRoomMemberRole.OWNER || jitsiRole == ChatRoomMemberRole.ADMINISTRATOR) {
        setLocalUserRole(jitsiRole);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Processes a <tt>Presence</tt> packet addressed to our own occupant JID.
 * @param presence the packet to process.
 */
private void processOwnPresence(Presence presence){
  MUCUser mucUser=getMUCUserExtension(presence);
  if (mucUser != null) {
    String affiliation=mucUser.getItem().getAffiliation();
    String role=mucUser.getItem().getRole();
    if (mucUser.getStatus() != null && "String_Node_Str".equals(mucUser.getStatus().getCode())) {
      try {
        multiUserChat.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
      }
 catch (      XMPPException e) {
        logger.error("String_Node_Str",e);
      }
      opSetMuc.addSmackInvitationRejectionListener(multiUserChat,chatRoom);
      if (affiliation.equalsIgnoreCase(ChatRoomMemberRole.OWNER.getRoleName().toLowerCase())) {
        setLocalUserRole(ChatRoomMemberRole.OWNER,true);
      }
 else       setLocalUserRole(ChatRoomMemberRole.MODERATOR,true);
    }
 else {
      ChatRoomMemberRole jitsiRole=ChatRoomJabberImpl.smackRoleToScRole(role,affiliation);
      if (jitsiRole == ChatRoomMemberRole.MODERATOR || jitsiRole == ChatRoomMemberRole.OWNER || jitsiRole == ChatRoomMemberRole.ADMINISTRATOR) {
        setLocalUserRole(jitsiRole,true);
      }
    }
  }
}
Program: 103000
Project: 103000
Buggy source:
/** 
 * Sets the new rolefor the local user in the context of this chatroom.
 * @param role the new role to be set for the local user
 */
public void setLocalUserRole(ChatRoomMemberRole role){
  fireLocalUserRoleEvent(getUserRole(),role);
  this.role=role;
}

Fixed version (ground truth):
/** 
 * Sets the new rolefor the local user in the context of this chatroom.
 * @param role the new role to be set for the local user
 * @param isInitial if <tt>true</tt> this is initial role set.
 */
public void setLocalUserRole(ChatRoomMemberRole role,boolean isInitial){
  fireLocalUserRoleEvent(getUserRole(),role,isInitial);
  this.role=role;
}
Program: 103001
Project: 103001
Buggy source:
/** 
 * Creates the corresponding ChatRoomLocalUserRoleChangeEvent and notifies all <tt>ChatRoomLocalUserRoleListener</tt>s that local user's role has been changed in this <tt>ChatRoom</tt>.
 * @param previousRole the previous role that local user had
 * @param newRole the new role the local user gets
 */
private void fireLocalUserRoleEvent(ChatRoomMemberRole previousRole,ChatRoomMemberRole newRole){
  ChatRoomLocalUserRoleChangeEvent evt=new ChatRoomLocalUserRoleChangeEvent(this,previousRole,newRole);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + evt);
  Iterable<ChatRoomLocalUserRoleListener> listeners;
synchronized (localUserRoleListeners) {
    listeners=new ArrayList<ChatRoomLocalUserRoleListener>(localUserRoleListeners);
  }
  for (  ChatRoomLocalUserRoleListener listener : listeners)   listener.localUserRoleChanged(evt);
}

Fixed version (ground truth):
/** 
 * Creates the corresponding ChatRoomLocalUserRoleChangeEvent and notifies all <tt>ChatRoomLocalUserRoleListener</tt>s that local user's role has been changed in this <tt>ChatRoom</tt>.
 * @param previousRole the previous role that local user had
 * @param newRole the new role the local user gets
 * @param isInitial if <tt>true</tt> this is initial role set.
 */
private void fireLocalUserRoleEvent(ChatRoomMemberRole previousRole,ChatRoomMemberRole newRole,boolean isInitial){
  ChatRoomLocalUserRoleChangeEvent evt=new ChatRoomLocalUserRoleChangeEvent(this,previousRole,newRole,isInitial);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + evt);
  Iterable<ChatRoomLocalUserRoleListener> listeners;
synchronized (localUserRoleListeners) {
    listeners=new ArrayList<ChatRoomLocalUserRoleListener>(localUserRoleListeners);
  }
  for (  ChatRoomLocalUserRoleListener listener : listeners)   listener.localUserRoleChanged(evt);
}
Program: 103002
Project: 103002
Buggy source:
/** 
 * Creates a <tt>ChatRoomLocalUserRoleChangeEvent</tt> representing that a change in local participant role in the source chat room has occured.
 * @param sourceRoom the <tt>ChatRoom</tt> that produced the event
 * @param previousRole the previous role that local participant had
 * @param newRole the new role that local participant get
 */
public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,ChatRoomMemberRole previousRole,ChatRoomMemberRole newRole){
  super(sourceRoom);
  this.previousRole=previousRole;
  this.newRole=newRole;
}

Fixed version (ground truth):
/** 
 * Creates a <tt>ChatRoomLocalUserRoleChangeEvent</tt> representing that a change in local participant role in the source chat room has occured.
 * @param sourceRoom the <tt>ChatRoom</tt> that produced the event
 * @param previousRole the previous role that local participant had
 * @param newRole the new role that local participant get
 * @param isInitial if <tt>true</tt> this is initial role set.
 */
public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,ChatRoomMemberRole previousRole,ChatRoomMemberRole newRole,boolean isInitial){
  super(sourceRoom);
  this.previousRole=previousRole;
  this.newRole=newRole;
  this.isInitial=isInitial;
}
Program: 103003
Project: 103003
Buggy source:
/** 
 * The OtrContactMenu constructor.
 * @param otrContact the OtrContact this menu refers to.
 * @param inMacOSXScreenMenuBar <tt>true</tt> if the new menu is to bedisplayed in the Mac OS X screen menu bar; <tt>false</tt>, otherwise
 * @param menu the parent menu
 */
public OtrContactMenu(OtrContact otrContact,boolean inMacOSXScreenMenuBar,JMenu menu,boolean isSeparateMenu){
  this.contact=otrContact;
  this.inMacOSXScreenMenuBar=inMacOSXScreenMenuBar;
  this.parentMenu=menu;
  String resourceName=otrContact.resource != null ? "String_Node_Str" + otrContact.resource.getResourceName() : "String_Node_Str";
  separateMenu=isSeparateMenu ? new SIPCommMenu(otrContact.contact.getDisplayName() + resourceName) : null;
  new OtrWeakListener<OtrContactMenu>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(this.contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact));
  buildMenu();
}

Fixed version (ground truth):
/** 
 * The OtrContactMenu constructor.
 * @param otrContact the OtrContact this menu refers to.
 * @param inMacOSXScreenMenuBar <tt>true</tt> if the new menu is to bedisplayed in the Mac OS X screen menu bar; <tt>false</tt>, otherwise
 * @param menu the parent menu
 */
public OtrContactMenu(OtrContact otrContact,boolean inMacOSXScreenMenuBar,JMenu menu,boolean isSeparateMenu){
  this.contact=otrContact;
  this.inMacOSXScreenMenuBar=inMacOSXScreenMenuBar;
  this.parentMenu=menu;
  String resourceName=otrContact.resource != null ? "String_Node_Str" + otrContact.resource.getResourceName() : "String_Node_Str";
  separateMenu=isSeparateMenu ? new SIPCommMenu(otrContact.contact.getDisplayName() + resourceName) : null;
  new OtrWeakListener<OtrContactMenu>(this,OtrActivator.scOtrEngine,OtrActivator.scOtrKeyManager);
  OtrPolicy policy=OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact);
  if (policy.getAllowV1() && policy.getAllowV2())   policy.setAllowV3(true);
 else   policy.setAllowV3(false);
  OtrActivator.scOtrEngine.setContactPolicy(contact.contact,policy);
  policy=OtrActivator.scOtrEngine.getGlobalPolicy();
  if (policy.getAllowV1() && policy.getAllowV2())   policy.setAllowV3(true);
 else   policy.setAllowV3(false);
  OtrActivator.scOtrEngine.setGlobalPolicy(policy);
  setSessionStatus(OtrActivator.scOtrEngine.getSessionStatus(this.contact));
  setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(otrContact.contact));
  buildMenu();
}
Program: 103004
Project: 103004
Buggy source:
/** 
 * Creates an instance of <tt>CallHistoryContactQuery</tt> based on the given <tt>callHistoryQuery</tt>.
 * @param callHistoryQuery the query used to track the call history
 */
public CallHistoryContactQuery(CallHistoryQuery callHistoryQuery){
  this.callHistoryQuery=callHistoryQuery;
  callHistoryQuery.addQueryListener(new CallHistoryQueryListener(){
    public void callRecordReceived(    CallRecordEvent event){
      if (getStatus() == ContactQuery.QUERY_CANCELED)       return;
      SourceContact contact=new CallHistorySourceContact(CallHistoryContactSource.this,event.getCallRecord());
      sourceContacts.add(contact);
      fireQueryEvent(contact);
    }
    public void queryStatusChanged(    CallHistoryQueryStatusEvent event){
      status=event.getEventType();
      fireQueryStatusEvent(status);
    }
  }
);
  Iterator<CallRecord> callRecords=callHistoryQuery.getCallRecords().iterator();
  while (callRecords.hasNext()) {
    SourceContact contact=new CallHistorySourceContact(CallHistoryContactSource.this,callRecords.next());
    sourceContacts.add(contact);
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>CallHistoryContactQuery</tt> based on the given <tt>callHistoryQuery</tt>.
 * @param callHistoryQuery the query used to track the call history
 */
public CallHistoryContactQuery(CallHistoryQuery callHistoryQuery){
  this.callHistoryQuery=callHistoryQuery;
}
Program: 103006
Project: 103006
Buggy source:
/** 
 * Applies this filter and stores the result in the given <tt>treeModel</tt>.
 * @param filterQuery the <tt>FilterQuery</tt> that tracks the results ofthis filtering
 */
public void applyFilter(FilterQuery filterQuery){
  NotificationContactSource notificationSource=TreeContactList.getNotificationContactSource();
  if (notificationSource != null)   addMatching(notificationSource);
  Collection<UIContactSource> contactSources=GuiActivator.getContactList().getContactSources(ContactSourceService.HISTORY_TYPE);
  for (  UIContactSource contactSource : contactSources) {
    ContactQuery query=contactSource.getContactSourceService().queryContactSource("String_Node_Str",50);
    filterQuery.addContactQuery(query);
    addMatching(query.getQueryResults(),contactSource);
    filterQuery.removeQuery(query);
  }
  filterQuery.close();
}

Fixed version (ground truth):
/** 
 * Applies this filter and stores the result in the given <tt>treeModel</tt>.
 * @param filterQuery the <tt>FilterQuery</tt> that tracks the results ofthis filtering
 */
public void applyFilter(FilterQuery filterQuery){
  NotificationContactSource notificationSource=TreeContactList.getNotificationContactSource();
  if (notificationSource != null)   addMatching(notificationSource);
  Collection<UIContactSource> contactSources=GuiActivator.getContactList().getContactSources(ContactSourceService.HISTORY_TYPE);
  for (  UIContactSource contactSource : contactSources) {
    ContactQuery query=contactSource.getContactSourceService().createContactQuery("String_Node_Str",50);
    query.start();
    filterQuery.addContactQuery(query);
    addMatching(query.getQueryResults(),contactSource);
    filterQuery.removeQuery(query);
  }
  filterQuery.close();
}
Program: 103007
Project: 103007
Buggy source:
/** 
 * Adds matching notification contacts to the result tree model.
 * @param notifSource
 */
private void addMatching(NotificationContactSource notifSource){
  Iterator<? extends UIGroup> notifGroups=notifSource.getNotificationGroups();
  while (notifGroups.hasNext()) {
    UIGroup uiGroup=notifGroups.next();
    Iterator<? extends UIContact> notfications=notifSource.getNotifications(uiGroup);
    while (notfications.hasNext()) {
      GuiActivator.getContactList().addContact(notfications.next(),uiGroup,false,true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds matching <tt>sourceContacts</tt> to the result tree model.
 * @param sourceContacts the list of <tt>SourceContact</tt>s to add
 * @param uiSource the <tt>ExternalContactSource</tt>, which contactswe're adding
 */
private void addMatching(List<SourceContact> sourceContacts,UIContactSource uiSource){
  Iterator<SourceContact> contactsIter=sourceContacts.iterator();
  while (contactsIter.hasNext()) {
    GuiActivator.getContactList().addContact(uiSource.createUIContact(contactsIter.next()),uiSource.getUIGroup(),false,true);
  }
}
Program: 103009
Project: 103009
Buggy source:
/** 
 * Removes the UI group associated with the root meta contact group.
 */
private void removeMetaUIRootGroup(){
  MetaContactGroup rootGroup=GuiActivator.getContactListService().getRoot();
  UIGroup uiGroup=MetaContactListSource.getUIGroup(rootGroup);
  if (uiGroup == null)   return;
  GroupNode parentNode=treeModel.getRoot();
  Iterator<MetaContact> i=rootGroup.getChildContacts();
  while (i.hasNext()) {
    MetaContact contact=i.next();
    UIContact uiContact=MetaContactListSource.getUIContact(contact);
    removeContact(uiContact);
    uiContact=MetaContactListSource.createUIContact(contact);
    if (currentFilter.isMatching(uiContact))     addContact(uiContact,treeModel.getRoot().getGroupDescriptor(),true,true);
 else     MetaContactListSource.removeUIContact(contact);
  }
  parentNode.removeContactGroup((UIGroupImpl)uiGroup);
}

Fixed version (ground truth):
/** 
 * Removes the UI group associated with the root meta contact group.
 */
private void removeMetaUIRootGroup(){
  MetaContactGroup rootGroup=GuiActivator.getContactListService().getRoot();
  UIGroup uiGroup;
synchronized (rootGroup) {
    uiGroup=MetaContactListSource.getUIGroup(rootGroup);
    if (uiGroup == null)     return;
  }
  GroupNode parentNode=treeModel.getRoot();
  Iterator<MetaContact> i=rootGroup.getChildContacts();
  while (i.hasNext()) {
    MetaContact contact=i.next();
    UIContact uiContact;
synchronized (contact) {
      uiContact=MetaContactListSource.getUIContact(contact);
      if (uiContact == null)       continue;
      removeContact(uiContact);
      uiContact=MetaContactListSource.createUIContact(contact);
    }
    if (currentFilter.isMatching(uiContact))     addContact(uiContact,treeModel.getRoot().getGroupDescriptor(),true,true);
 else     MetaContactListSource.removeUIContact(contact);
  }
  parentNode.removeContactGroup((UIGroupImpl)uiGroup);
}
Program: 103010
Project: 103010
Buggy source:
/** 
 * Creates UI group for the root meta contact group.
 */
private void createMetaUIRootGroup(){
  MetaContactGroup rootGroup=GuiActivator.getContactListService().getRoot();
  UIGroup uiGroup=MetaContactListSource.getUIGroup(rootGroup);
  if (uiGroup != null)   return;
  uiGroup=MetaContactListSource.createUIGroup(rootGroup);
  treeModel.getRoot().sortedAddContactGroup((UIGroupImpl)uiGroup);
  Iterator<MetaContact> i=rootGroup.getChildContacts();
  while (i.hasNext()) {
    MetaContact contact=i.next();
    UIContact uiContact=MetaContactListSource.getUIContact(contact);
    removeContact(uiContact);
    uiContact=MetaContactListSource.createUIContact(contact);
    if (currentFilter.isMatching(uiContact))     addContact(uiContact,uiGroup,true,true);
 else     MetaContactListSource.removeUIContact(contact);
  }
}

Fixed version (ground truth):
/** 
 * Creates UI group for the root meta contact group.
 */
private void createMetaUIRootGroup(){
  MetaContactGroup rootGroup=GuiActivator.getContactListService().getRoot();
  UIGroup uiGroup;
synchronized (rootGroup) {
    uiGroup=MetaContactListSource.getUIGroup(rootGroup);
    if (uiGroup != null)     return;
    uiGroup=MetaContactListSource.createUIGroup(rootGroup);
  }
  treeModel.getRoot().sortedAddContactGroup((UIGroupImpl)uiGroup);
  Iterator<MetaContact> i=rootGroup.getChildContacts();
  while (i.hasNext()) {
    MetaContact contact=i.next();
    UIContact uiContact;
synchronized (contact) {
      uiContact=MetaContactListSource.getUIContact(contact);
      if (uiContact == null)       continue;
      removeContact(uiContact);
      uiContact=MetaContactListSource.createUIContact(contact);
    }
    if (currentFilter.isMatching(uiContact))     addContact(uiContact,uiGroup,true,true);
 else     MetaContactListSource.removeUIContact(contact);
  }
}
Program: 103013
Project: 103013
Buggy source:
/** 
 * Creates an instance of <tt>MetaContactDetail</tt> by specifying the underlying protocol <tt>Contact</tt>.
 * @param contact the protocol contact, on which this implementationis based
 */
public MetaContactDetail(Contact contact){
  super(contact.getAddress(),contact.getDisplayName(),new ImageIcon(contact.getPresenceStatus().getStatusIcon()),contact);
  this.contact=contact;
  ProtocolProviderService parentProvider=contact.getProtocolProvider();
  Iterator<Class<? extends OperationSet>> opSetClasses=parentProvider.getSupportedOperationSetClasses().iterator();
  while (opSetClasses.hasNext()) {
    Class<? extends OperationSet> opSetClass=opSetClasses.next();
    addPreferredProtocolProvider(opSetClass,parentProvider);
    addPreferredProtocol(opSetClass,parentProvider.getProtocolName());
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>MetaContactDetail</tt> by specifying the underlying protocol <tt>Contact</tt>.
 * @param contact the protocol contact, on which this implementationis based
 */
public MetaContactDetail(Contact contact){
  super(contact.getAddress(),contact.getDisplayName(),getContactPresenceStatusIcon(contact),contact);
  this.contact=contact;
  ProtocolProviderService parentProvider=contact.getProtocolProvider();
  Iterator<Class<? extends OperationSet>> opSetClasses=parentProvider.getSupportedOperationSetClasses().iterator();
  while (opSetClasses.hasNext()) {
    Class<? extends OperationSet> opSetClass=opSetClasses.next();
    addPreferredProtocolProvider(opSetClass,parentProvider);
    addPreferredProtocol(opSetClass,parentProvider.getProtocolName());
  }
}
Program: 103014
Project: 103014
Buggy source:
/** 
 * Returns the icon for the provider.
 * @param providerService the provider
 * @param customProviderImage set custom provider image
 * @return the image.
 */
private static Image getIconForProvider(ProtocolProviderService providerService,Image customProviderImage,ImageObserver imageObserver){
  Image left=null;
  if (isAutoAnswerEnabled(providerService))   left=ImageLoader.getImage(ImageLoader.AUTO_ANSWER_CHECK);
  if (customProviderImage == null)   customProviderImage=ImageUtils.getBytesInImage(providerService.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16));
  return ImageUtils.getComposedImage(left,customProviderImage,imageObserver);
}

Fixed version (ground truth):
/** 
 * Returns the icon for the provider.
 * @param providerService the provider
 * @param customProviderImage set custom provider image
 * @return the image.
 */
private static Image getIconForProvider(ProtocolProviderService providerService,Image customProviderImage,ImageObserver imageObserver){
  Image left=isAutoAnswerEnabled(providerService) ? ImageLoader.getImage(ImageLoader.AUTO_ANSWER_CHECK) : null;
  if (customProviderImage == null) {
    byte[] bytes=providerService.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16);
    if (bytes != null)     customProviderImage=ImageUtils.getBytesInImage(bytes);
  }
  return ImageUtils.getComposedImage(left,customProviderImage,imageObserver);
}
Program: 103015
Project: 103015
Buggy source:
/** 
 * Creates the menu item.
 * @param provider the provider.
 * @param displayName the display name of the item.
 * @param onlineImage the icon to display
 * @param parentMenu the parent menu.
 */
private AutoAnswerMenuItem(ProtocolProviderService provider,String displayName,Image onlineImage,SIPCommMenu parentMenu){
  super(displayName,new ImageIcon(onlineImage));
  this.providerService=provider;
  this.parentMenu=parentMenu;
  this.addActionListener(this);
}

Fixed version (ground truth):
/** 
 * Creates the menu item.
 * @param provider the provider.
 * @param displayName the display name of the item.
 * @param onlineImage the icon to display
 * @param parentMenu the parent menu.
 */
private AutoAnswerMenuItem(ProtocolProviderService provider,String displayName,Image onlineImage,SIPCommMenu parentMenu){
  super(displayName,(onlineImage == null) ? null : new ImageIcon(onlineImage));
  this.providerService=provider;
  this.parentMenu=parentMenu;
  this.addActionListener(this);
}
Program: 103016
Project: 103016
Buggy source:
/** 
 * Adds an item to the "choice list" of this selector box.
 * @param text The text of the item.
 * @param icon The icon of the item.
 * @param actionListener The <tt>ActionListener</tt>, which handles thecase, when the item is selected.
 */
@Override public void addItem(String text,Icon icon,ActionListener actionListener){
  JCheckBoxMenuItem item=new JCheckBoxMenuItem(text,icon);
  item.setName(text);
  group.add(item);
  item.addActionListener(actionListener);
  this.add(item);
}

Fixed version (ground truth):
/** 
 * Adds an item to the "choice list" of this selector box.
 * @param text The text of the item.
 * @param icon The icon of the item.
 * @param actionListener The <tt>ActionListener</tt>, which handles thecase, when the item is selected.
 */
@Override public void addItem(String text,Icon icon,ActionListener actionListener){
  JCheckBoxMenuItem item=new JCheckBoxMenuItem(text,icon);
  item.setName(text);
  group.add(item);
  item.addActionListener(actionListener);
  add(item);
}
Program: 103018
Project: 103018
Buggy source:
/** 
 * Loads resources for this component.
 */
@Override public void loadSkin(){
  super.loadSkin();
  setIcon(new ImageIcon(ImageUtils.getBytesInImage(protocolProvider.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16))));
  if (onlineItem != null)   onlineItem.setIcon(getIcon());
  if (offlineItem != null)   offlineItem.setIcon(new ImageIcon(LightGrayFilter.createDisabledImage(ImageUtils.getBytesInImage(protocolProvider.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16)))));
}

Fixed version (ground truth):
/** 
 * Loads resources for this component.
 */
@Override public void loadSkin(){
  super.loadSkin();
  Image image=getProtocolImage(protocolProvider,ProtocolIcon.ICON_SIZE_16x16);
  if (image != null)   setIcon(new ImageIcon(image));
  if (onlineItem != null)   onlineItem.setIcon(getIcon());
  if ((offlineItem != null) && (image != null)) {
    offlineItem.setIcon(new ImageIcon(LightGrayFilter.createDisabledImage(image)));
  }
}
Program: 103019
Project: 103019
Buggy source:
private JCheckBoxMenuItem createMenuItem(String textKey,Icon icon,String name){
  JCheckBoxMenuItem menuItem=new JCheckBoxMenuItem(GuiActivator.getResources().getI18NString(textKey),icon);
  menuItem.setName(name);
  menuItem.addActionListener(this);
  this.add(menuItem);
  return menuItem;
}

Fixed version (ground truth):
private JCheckBoxMenuItem createMenuItem(String textKey,Icon icon,String name){
  JCheckBoxMenuItem menuItem=new JCheckBoxMenuItem(GuiActivator.getResources().getI18NString(textKey),icon);
  menuItem.setName(name);
  menuItem.addActionListener(this);
  add(menuItem);
  return menuItem;
}
Program: 103020
Project: 103020
Buggy source:
/** 
 * Creates an instance of <tt>SimpleStatusMenu</tt>.
 * @param protocolProvider the protocol provider
 * @param displayName the display name for the menu
 * @param onlineImage the image used for the online state
 */
private SimpleStatusMenu(ProtocolProviderService protocolProvider,String displayName,Image onlineImage){
  super(displayName,new ImageIcon(onlineImage),protocolProvider);
  this.setToolTipText("String_Node_Str" + displayName + "String_Node_Str");
  JLabel titleLabel=new JLabel(displayName);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  onlineItem=createMenuItem("String_Node_Str",getIcon(),GlobalStatusEnum.ONLINE_STATUS);
  offlineItem=createMenuItem("String_Node_Str",new ImageIcon(LightGrayFilter.createDisabledImage(onlineImage)),GlobalStatusEnum.OFFLINE_STATUS);
  group.add(onlineItem);
  group.add(offlineItem);
  updateStatus(null);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>SimpleStatusMenu</tt>.
 * @param protocolProvider the protocol provider
 * @param displayName the display name for the menu
 * @param onlineImage the image used for the online state
 */
private SimpleStatusMenu(ProtocolProviderService protocolProvider,String displayName,Image onlineImage){
  super(displayName,(onlineImage == null) ? null : new ImageIcon(onlineImage),protocolProvider);
  setToolTipText("String_Node_Str" + displayName + "String_Node_Str");
  JLabel titleLabel=new JLabel(displayName);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  add(titleLabel);
  addSeparator();
  onlineItem=createMenuItem("String_Node_Str",getIcon(),GlobalStatusEnum.ONLINE_STATUS);
  offlineItem=createMenuItem("String_Node_Str",(onlineImage == null) ? null : new ImageIcon(LightGrayFilter.createDisabledImage(onlineImage)),GlobalStatusEnum.OFFLINE_STATUS);
  group.add(onlineItem);
  group.add(offlineItem);
  updateStatus(null);
}
Program: 103021
Project: 103021
Buggy source:
/** 
 * Obtains the indexed status image for the given protocol provider.
 * @param pps the protocol provider for which to create the image
 * @return the indexed status image
 */
public static ImageIcon getAccountStatusImage(ProtocolProviderService pps){
  ImageIcon statusIcon;
  OperationSetPresence presence=pps.getOperationSet(OperationSetPresence.class);
  Image statusImage;
  byte[] protocolStatusIcon=null;
  if (presence != null)   protocolStatusIcon=presence.getPresenceStatus().getStatusIcon();
  if (presence != null && protocolStatusIcon != null) {
    statusImage=ImageUtils.getBytesInImage(protocolStatusIcon);
  }
 else {
    statusImage=ImageUtils.getBytesInImage(pps.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16));
    if (!pps.isRegistered()) {
      statusImage=LightGrayFilter.createDisabledImage(statusImage);
    }
  }
  statusIcon=new ImageIcon(getIndexedProtocolImage(statusImage,pps));
  return statusIcon;
}

Fixed version (ground truth):
/** 
 * Obtains the indexed status image for the given protocol provider.
 * @param pps the protocol provider for which to create the image
 * @return the indexed status image
 */
public static ImageIcon getAccountStatusImage(ProtocolProviderService pps){
  OperationSetPresence presence=pps.getOperationSet(OperationSetPresence.class);
  byte[] protocolStatusIcon=(presence == null) ? null : presence.getPresenceStatus().getStatusIcon();
  Image statusImage;
  if (presence != null && protocolStatusIcon != null) {
    statusImage=ImageUtils.getBytesInImage(protocolStatusIcon);
  }
 else {
    byte[] bytes=pps.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16);
    statusImage=(bytes == null) ? null : ImageUtils.getBytesInImage(bytes);
    if (!pps.isRegistered() && (statusImage != null)) {
      statusImage=LightGrayFilter.createDisabledImage(statusImage);
    }
  }
  return (statusImage == null) ? null : new ImageIcon(getIndexedProtocolImage(statusImage,pps));
}
Program: 103022
Project: 103022
Buggy source:
public void updateStatus(PresenceStatus presenceStatus){
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + provider.getAccountID().getAccountAddress() + "String_Node_Str"+ presenceStatus.getStatusName());
  if (menu instanceof AbstractButton)   ((AbstractButton)menu).setIcon(new ImageIcon(presenceStatus.getStatusIcon()));
  if (menu instanceof Menu) {
    Menu theMenu=(Menu)menu;
    for (int i=0; i < theMenu.getItemCount(); i++) {
      MenuItem item=theMenu.getItem(i);
      if (item instanceof CheckboxMenuItem) {
        if (item.getLabel().equals(presenceStatus.getStatusName())) {
          ((CheckboxMenuItem)item).setState(true);
        }
 else {
          ((CheckboxMenuItem)item).setState(false);
        }
      }
    }
  }
 else   if (menu instanceof JMenu) {
    JMenu theMenu=(JMenu)menu;
    for (int i=0; i < theMenu.getItemCount(); i++) {
      JMenuItem item=theMenu.getItem(i);
      if (item instanceof JCheckBoxMenuItem) {
        if (item.getText().equals(presenceStatus.getStatusName()))         item.setSelected(true);
 else         item.setSelected(false);
      }
    }
  }
}

Fixed version (ground truth):
public void updateStatus(PresenceStatus presenceStatus){
  String presenceStatusName=presenceStatus.getStatusName();
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str" + provider.getAccountID().getAccountAddress() + "String_Node_Str"+ presenceStatusName);
  }
  if (menu instanceof AbstractButton) {
    byte[] bytes=presenceStatus.getStatusIcon();
    if (bytes != null)     ((AbstractButton)menu).setIcon(new ImageIcon());
  }
  if (menu instanceof Menu) {
    Menu theMenu=(Menu)menu;
    for (int i=0, count=theMenu.getItemCount(); i < count; i++) {
      MenuItem item=theMenu.getItem(i);
      if (item instanceof CheckboxMenuItem) {
        ((CheckboxMenuItem)item).setState(item.getLabel().equals(presenceStatusName));
      }
    }
  }
 else   if (menu instanceof JMenu) {
    JMenu theMenu=(JMenu)menu;
    for (int i=0, count=theMenu.getItemCount(); i < count; i++) {
      JMenuItem item=theMenu.getItem(i);
      if (item instanceof JCheckBoxMenuItem)       item.setSelected(item.getText().equals(presenceStatusName));
    }
  }
}
Program: 103023
Project: 103023
Buggy source:
/** 
 * Creates a new <tt>Call</tt> and invites a specific <tt>CallPeer</tt> to it given by her <tt>String</tt> URI.
 * @param uri the address of the callee who we should invite to a new<tt>Call</tt>
 * @param calleeResource the specific resource to which the invite should besent
 * @param conference the <tt>CallConference</tt> in which the newly-created<tt>Call</tt> is to participate
 * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> isavailable in the <tt>Call</tt> as a <tt>CallPeer</tt>
 * @throws OperationFailedException with the corresponding code if we failto create the call
 */
public Call createCall(String uri,String calleeResource,CallConference conference) throws OperationFailedException {
  CallJabberImpl call=new CallJabberImpl(jabberTelephony);
  if (conference != null)   call.setConference(conference);
  String fullCalleeUri=(!StringUtils.isNullOrEmpty(calleeResource)) ? uri + "String_Node_Str" + calleeResource : uri;
  CallPeer callPeer=jabberTelephony.createOutgoingCall(call,uri,fullCalleeUri,null);
  if (callPeer == null) {
    throw new OperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.INTERNAL_ERROR);
  }
  Call callOfCallPeer=callPeer.getCall();
  if (callOfCallPeer == call)   return call;
 else {
    if (conference != null)     callOfCallPeer.setConference(conference);
    return callOfCallPeer;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new <tt>Call</tt> and invites a specific <tt>CallPeer</tt> to it given by her <tt>String</tt> URI.
 * @param uri the address of the callee who we should invite to a new<tt>Call</tt>
 * @param calleeResource the specific resource to which the invite should besent
 * @param conference the <tt>CallConference</tt> in which the newly-created<tt>Call</tt> is to participate
 * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> isavailable in the <tt>Call</tt> as a <tt>CallPeer</tt>
 * @throws OperationFailedException with the corresponding code if we failto create the call
 */
public Call createCall(String uri,String calleeResource,CallConference conference) throws OperationFailedException {
  CallJabberImpl call=new CallJabberImpl(jabberTelephony);
  if (conference != null)   call.setConference(conference);
  String fullCalleeUri=StringUtils.isNullOrEmpty(calleeResource) ? uri : uri + "String_Node_Str" + calleeResource;
  CallPeer callPeer=jabberTelephony.createOutgoingCall(call,uri,fullCalleeUri,null);
  if (callPeer == null) {
    throw new OperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.INTERNAL_ERROR);
  }
  Call callOfCallPeer=callPeer.getCall();
  if ((callOfCallPeer != call) && (conference != null))   callOfCallPeer.setConference(conference);
  return callOfCallPeer;
}