nus-yam/ex-repair huggingface dataset:
Program: 103981
Project: 103981
Buggy source:
/** 
 * Removes the specified contact from this contact group
 * @param contact the contact to remove.
 */
void removeContact(ContactIcqImpl contact){
  buddies.remove(contact);
}

Fixed version (ground truth):
/** 
 * Removes the specified contact from this contact group
 * @param contact the contact to remove.
 */
void removeContact(ContactIcqImpl contact){
  for (Iterator<Map.Entry<String,Contact>> buddyIter=buddies.entrySet().iterator(); buddyIter.hasNext(); ) {
    if (buddyIter.next().getKey().equals(contact)) {
      buddyIter.remove();
      break;
    }
  }
}
Program: 103982
Project: 103982
Buggy source:
/** 
 * Creates an ICQ group using the specified <tt>joustSimGroup</tt> as a source. The newly created group will always return the name of the underlying joustSimGroup and would thus automatically adapt to changes. It would, however, not receive or try to poll for modifications of the buddies it contains and would therefore have to be updated manually by ServerStoredContactListImpl. <p> Note that we MUST NOT use the list of buddies obtained through the getBuddiesCopy() of the joustSimGroup arg as we'd later need to be able to directly compare ( == ) instances of buddies we've stored and others that are returned by the framework. <p>
 * @param joustSimGroup the JoustSIM Group correspoinding to the group
 * @param groupMembers the group members that we should add to the group.
 * @param ssclCallback a callback to the server stored contact listwe're creating.
 * @param isResolved a boolean indicating whether or not the group has beenresolved against the server.
 */
ContactGroupIcqImpl(MutableGroup joustSimGroup,List<Buddy> groupMembers,ServerStoredContactListIcqImpl ssclCallback,boolean isResolved){
  this.joustSimSourceGroup=joustSimGroup;
  this.isResolved=isResolved;
  this.ssclCallback=ssclCallback;
  initNameCopy();
  Iterator<Buddy> buddies=groupMembers.iterator();
  while (buddies.hasNext()) {
    Buddy buddy=buddies.next();
    if (ssclCallback.findContactByJoustSimBuddy(buddy) != null) {
      continue;
    }
    addContact(new ContactIcqImpl(buddy,ssclCallback,true,true));
  }
}

Fixed version (ground truth):
/** 
 * Creates an ICQ group using the specified <tt>joustSimGroup</tt> as a source. The newly created group will always return the name of the underlying joustSimGroup and would thus automatically adapt to changes. It would, however, not receive or try to poll for modifications of the buddies it contains and would therefore have to be updated manually by ServerStoredContactListImpl. <p> Note that we MUST NOT use the list of buddies obtained through the getBuddiesCopy() of the joustSimGroup arg as we'd later need to be able to directly compare ( == ) instances of buddies we've stored and others that are returned by the framework. <p>
 * @param joustSimGroup the JoustSIM Group corresponding to the group
 * @param groupMembers the group members that we should add to the group.
 * @param ssclCallback a callback to the server stored contact listwe're creating.
 * @param isResolved a boolean indicating whether or not the group has beenresolved against the server.
 */
ContactGroupIcqImpl(MutableGroup joustSimGroup,List<Buddy> groupMembers,ServerStoredContactListIcqImpl ssclCallback,boolean isResolved){
  this.joustSimSourceGroup=joustSimGroup;
  this.isResolved=isResolved;
  this.ssclCallback=ssclCallback;
  initNameCopy();
  Iterator<Buddy> buddies=groupMembers.iterator();
  while (buddies.hasNext()) {
    Buddy buddy=buddies.next();
    if (ssclCallback.findContactByJoustSimBuddy(buddy) != null) {
      continue;
    }
    addContact(new ContactIcqImpl(buddy,ssclCallback,true,true));
  }
}
Program: 103983
Project: 103983
Buggy source:
/** 
 * Returns the icq contact encapsulating with the spcieified screen name or null if no such contact was found.
 * @param screenName the screenName (or icq UIN) for the contact we'relooking for.
 * @return the <tt>ContactIcqImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactIcqImpl findContact(String screenName){
  if (screenName == null)   return null;
  String lcScreenName=screenName.toLowerCase();
  return (ContactIcqImpl)buddies.get(lcScreenName);
}

Fixed version (ground truth):
/** 
 * Returns the icq contact encapsulating with the specified screen name or null if no such contact was found.
 * @param screenName the screenName (or icq UIN) for the contact we'relooking for.
 * @return the <tt>ContactIcqImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactIcqImpl findContact(String screenName){
  if (screenName == null)   return null;
  String lcScreenName=screenName.toLowerCase();
  return (ContactIcqImpl)buddies.get(lcScreenName);
}
Program: 103984
Project: 103984
Buggy source:
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any memebers it will return an empty iterator.
 */
public Iterator<Contact> contacts(){
  return buddies.values().iterator();
}

Fixed version (ground truth):
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any members it will return an empty iterator.
 */
public Iterator<Contact> contacts(){
  return buddies.values().iterator();
}
Program: 103986
Project: 103986
Buggy source:
/** 
 * Fills the Account ID, Identity File and Known Hosts File fields in this panel with the data comming from the given protocolProvider.
 * @param protocolProvider The <tt>ProtocolProviderService</tt> to load thedata from.
 */
public void loadAccount(ProtocolProviderService protocolProvider){
  ProtocolProviderFactorySSH protocolProviderSSH=(ProtocolProviderFactorySSH)protocolProvider;
  AccountID accountID=protocolProvider.getAccountID();
  String identityFile=accountID.getAccountPropertyString(ProtocolProviderFactorySSH.IDENTITY_FILE);
  String knownHostsFile=accountID.getAccountPropertyString(ProtocolProviderFactorySSH.KNOWN_HOSTS_FILE);
  this.userIDField.setText(accountID.getUserID());
  this.identityFileField.setText(identityFile);
  this.knownHostsFileField.setText(knownHostsFile);
}

Fixed version (ground truth):
/** 
 * Fills the Account ID, Identity File and Known Hosts File fields in this panel with the data coming from the given protocolProvider.
 * @param protocolProvider The <tt>ProtocolProviderService</tt> to load thedata from.
 */
public void loadAccount(ProtocolProviderService protocolProvider){
  if (!(protocolProvider instanceof ProtocolProviderServiceSSHImpl))   throw new ClassCastException("String_Node_Str");
  AccountID accountID=protocolProvider.getAccountID();
  String identityFile=accountID.getAccountPropertyString(ProtocolProviderFactorySSH.IDENTITY_FILE);
  String knownHostsFile=accountID.getAccountPropertyString(ProtocolProviderFactorySSH.KNOWN_HOSTS_FILE);
  this.userIDField.setText(accountID.getUserID());
  this.identityFileField.setText(identityFile);
  this.knownHostsFileField.setText(knownHostsFile);
}
Program: 103987
Project: 103987
Buggy source:
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  AccountRegistrationWizard wizard=(AccountRegistrationWizard)value;
  if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
  }
 else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
  }
  this.setText(wizard.getProtocolName());
  byte[] icon=wizard.getIcon();
  if (icon != null && icon.length > 0) {
    this.setIcon(new ImageIcon(ImageLoader.getBytesInImage(icon)));
  }
 else {
    this.setIcon(null);
  }
  return this;
}

Fixed version (ground truth):
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  AccountRegistrationWizard wizard=(AccountRegistrationWizard)value;
  if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
  }
 else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
  }
  this.setText(wizard.getProtocolName());
  byte[] icon=wizard.getIcon();
  if (icon != null && icon.length > 0) {
    this.setIcon(new ImageIcon(icon));
  }
 else {
    this.setIcon(null);
  }
  return this;
}
Program: 103988
Project: 103988
Buggy source:
/** 
 * Clears all mouse over effects for the given smiley item. This method should be invoked when the mouse has exited the smiley area or when a smiley has been selected and the popup menu is closed.
 * @param smileyItem the item for which we clear mouse over effects.
 */
private void clearMouseOverEffects(JMenuItem smileyItem,Smiley smiley){
  ImageIcon imageIcon=new ImageIcon(ImageLoader.getImage(smiley.getImageID()));
  smileyItem.setIcon(imageIcon);
  smileyItem.setText(null);
  smileyTextLabel.setText("String_Node_Str");
  smileyDescriptionLabel.setText("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Clears all mouse over effects for the given smiley item. This method should be invoked when the mouse has exited the smiley area or when a smiley has been selected and the popup menu is closed.
 * @param smileyItem the item for which we clear mouse over effects.
 */
private void clearMouseOverEffects(JMenuItem smileyItem,Smiley smiley){
  ImageIcon imageIcon=new ImageIcon(ImageLoader.getImage(smiley.getImageID()));
  smileyItem.setIcon(imageIcon);
  smileyTextLabel.setText("String_Node_Str");
  smileyDescriptionLabel.setText("String_Node_Str");
}
Program: 103989
Project: 103989
Buggy source:
/** 
 * Changes the static image of the underlying smiley with a dynamic one. Also shows the description and smiley string in the description area.
 */
public void mouseEntered(MouseEvent e){
  JMenuItem smileyItem=(JMenuItem)e.getSource();
  Smiley smiley=smileysList.get(smileyItem);
  String smileyIconHtml="String_Node_Str" + ImageLoader.getSmiley(smiley.getDefaultString()).getImagePath() + "String_Node_Str";
  smileyItem.setIcon(null);
  smileyItem.setText(smileyIconHtml);
  smileyDescriptionLabel.setText(smiley.getDescription());
  smileyTextLabel.setText(smiley.getSmileyStrings()[0]);
}

Fixed version (ground truth):
/** 
 * Changes the static image of the underlying smiley with a dynamic one. Also shows the description and smiley string in the description area.
 */
public void mouseEntered(MouseEvent e){
  JMenuItem smileyItem=(JMenuItem)e.getSource();
  Smiley smiley=smileysList.get(smileyItem);
  ImageIcon imageIcon=GuiActivator.getResources().getImage(smiley.getImageID().getId());
  smileyItem.setIcon(imageIcon);
  smileyDescriptionLabel.setText(smiley.getDescription());
  smileyTextLabel.setText(smiley.getSmileyStrings()[0]);
}
Program: 103990
Project: 103990
Buggy source:
/** 
 * Loads the given <tt>ConfigurationForm</tt>.
 * @param configForm the <tt>ConfigurationForm</tt> to load
 */
public ConfigFormDescriptor(ConfigurationForm configForm){
  this.configForm=configForm;
  byte[] icon=null;
  try {
    icon=configForm.getIcon();
    configFormTitle=configForm.getTitle();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  if (icon != null)   configFormIcon=new ImageIcon(ImageLoader.getBytesInImage(icon));
}

Fixed version (ground truth):
/** 
 * Loads the given <tt>ConfigurationForm</tt>.
 * @param configForm the <tt>ConfigurationForm</tt> to load
 */
public ConfigFormDescriptor(ConfigurationForm configForm){
  this.configForm=configForm;
  byte[] icon=null;
  try {
    icon=configForm.getIcon();
    configFormTitle=configForm.getTitle();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  if (icon != null)   configFormIcon=new ImageIcon(icon);
}
Program: 103991
Project: 103991
Buggy source:
/** 
 * Creates a customized tooltip for this contact list.
 * @return The customized tooltip.
 */
public JToolTip createToolTip(){
  Point currentMouseLocation=MouseInfo.getPointerInfo().getLocation();
  SwingUtilities.convertPointFromScreen(currentMouseLocation,this);
  int index=this.locationToIndex(currentMouseLocation);
  Object element=getModel().getElementAt(index);
  ExtendedTooltip tip=new ExtendedTooltip();
  if (element instanceof MetaContact) {
    MetaContact metaContact=(MetaContact)element;
    byte[] avatarImage=metaContact.getAvatar();
    if (avatarImage != null && avatarImage.length > 0)     tip.setImage(new ImageIcon(avatarImage));
    tip.setTitle(metaContact.getDisplayName());
    Iterator<Contact> i=metaContact.getContacts();
    while (i.hasNext()) {
      Contact protocolContact=i.next();
      Image protocolStatusIcon=ImageLoader.getBytesInImage(protocolContact.getPresenceStatus().getStatusIcon());
      String contactAddress=protocolContact.getAddress();
      tip.addLine(new ImageIcon(protocolStatusIcon),contactAddress);
    }
  }
 else   if (element instanceof MetaContactGroup) {
    MetaContactGroup metaGroup=(MetaContactGroup)element;
    tip.setTitle(metaGroup.getGroupName());
  }
 else   if (element instanceof ChatContact) {
    ChatContact chatContact=(ChatContact)element;
    ImageIcon avatarImage=chatContact.getAvatar();
    if (avatarImage != null)     tip.setImage(avatarImage);
    tip.setTitle(chatContact.getName());
  }
  tip.setComponent(this);
  return tip;
}

Fixed version (ground truth):
/** 
 * Creates a customized tooltip for this contact list.
 * @return The customized tooltip.
 */
public JToolTip createToolTip(){
  Point currentMouseLocation=MouseInfo.getPointerInfo().getLocation();
  SwingUtilities.convertPointFromScreen(currentMouseLocation,this);
  int index=this.locationToIndex(currentMouseLocation);
  Object element=getModel().getElementAt(index);
  ExtendedTooltip tip=new ExtendedTooltip();
  if (element instanceof MetaContact) {
    MetaContact metaContact=(MetaContact)element;
    byte[] avatarImage=metaContact.getAvatar();
    if (avatarImage != null && avatarImage.length > 0)     tip.setImage(new ImageIcon(avatarImage));
    tip.setTitle(metaContact.getDisplayName());
    Iterator<Contact> i=metaContact.getContacts();
    while (i.hasNext()) {
      Contact protocolContact=i.next();
      ImageIcon protocolStatusIcon=new ImageIcon(protocolContact.getPresenceStatus().getStatusIcon());
      String contactAddress=protocolContact.getAddress();
      tip.addLine(protocolStatusIcon,contactAddress);
    }
  }
 else   if (element instanceof MetaContactGroup) {
    MetaContactGroup metaGroup=(MetaContactGroup)element;
    tip.setTitle(metaGroup.getGroupName());
  }
 else   if (element instanceof ChatContact) {
    ChatContact chatContact=(ChatContact)element;
    ImageIcon avatarImage=chatContact.getAvatar();
    if (avatarImage != null)     tip.setImage(avatarImage);
    tip.setTitle(chatContact.getName());
  }
  tip.setComponent(this);
  return tip;
}
Program: 103993
Project: 103993
Buggy source:
/** 
 * Sets the Password associated with this contact
 * @param password
 */
public void setPassword(String password){
  this.sshConfigurationForm.setPasswordField(password);
  savePersistentDetails();
}

Fixed version (ground truth):
/** 
 * Sets the Password associated with this contact
 * @param password
 */
public void setPassword(String password){
  this.sshConfigurationForm.setPasswordField(password);
  System.out.println("String_Node_Str");
  savePersistentDetails();
}
Program: 103994
Project: 103994
Buggy source:
/** 
 * Saves the details of contact in persistentData seperated by "service.gui.JANUARY" Passowrd is saved unsecurely using Base64 encoding
 */
public void savePersistentDetails(){
  persistentData=this.sshConfigurationForm.getHostName() + "String_Node_Str" + this.sshConfigurationForm.getUserName()+ "String_Node_Str"+ new String(Base64.encode(this.sshConfigurationForm.getPassword().getBytes()))+ "String_Node_Str"+ sshConfigurationForm.getPort()+ "String_Node_Str"+ sshConfigurationForm.getTerminalType()+ "String_Node_Str"+ sshConfigurationForm.getUpdateInterval();
}

Fixed version (ground truth):
/** 
 * Saves the details of contact in persistentData seperated by separator Passowrd is saved unsecurely using Base64 encoding
 */
public void savePersistentDetails(){
  persistentData=this.sshConfigurationForm.getHostName() + separator + this.sshConfigurationForm.getUserName()+ separator+ new String(Base64.encode(this.sshConfigurationForm.getPassword().getBytes()))+ separator+ sshConfigurationForm.getPort()+ separator+ sshConfigurationForm.getTerminalType()+ separator+ sshConfigurationForm.getUpdateInterval();
}
Program: 103997
Project: 103997
Buggy source:
public void actionPerformed(ActionEvent event){
  if (machineIDField.getText().equals("String_Node_Str")) {
    machineIDField.setText("String_Node_Str");
    return;
  }
  sshContact.savePersistentDetails();
  setVisible(false);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent event){
  if (machineIDField.getText().equals("String_Node_Str")) {
    machineIDField.setText("String_Node_Str");
    return;
  }
  sshContact.savePersistentDetails();
  ((OperationSetPersistentPresenceSSHImpl)sshContact.getParentPresenceOperationSet()).addContactToList(sshContact.getParentContactGroup(),sshContact);
  setVisible(false);
}
Program: 103998
Project: 103998
Buggy source:
/** 
 * Sets the Password associated with this contact
 * @param password
 */
public void setPassword(String password){
  this.sshConfigurationForm.setPasswordField(password);
  System.out.println("String_Node_Str");
  savePersistentDetails();
}

Fixed version (ground truth):
/** 
 * Sets the Password associated with this contact
 * @param password
 */
public void setPassword(String password){
  this.sshConfigurationForm.setPasswordField(password);
  savePersistentDetails();
}
Program: 103999
Project: 103999
Buggy source:
/** 
 * Sets the showOffline property.
 * @param isShowOffline TRUE to show all offline users, FALSE to hideoffline users.
 */
public void setShowOffline(boolean isShowOffline){
  Object selectedObject=null;
  int currentlySelectedIndex=this.getSelectedIndex();
  if (currentlySelectedIndex != -1) {
    selectedObject=listModel.getElementAt(currentlySelectedIndex);
  }
  int listSize=listModel.getSize();
  listModel.setShowOffline(isShowOffline);
  ConfigurationManager.setShowOffline(isShowOffline);
  int newListSize=listModel.getSize();
  if (!isShowOffline && listSize > 0) {
    if (newListSize > 0) {
      listModel.contentChanged(0,newListSize - 1);
      listModel.contentRemoved(newListSize - 1,listSize - 1);
    }
 else     listModel.contentRemoved(0,listSize - 1);
  }
 else   if (isShowOffline && newListSize > 0) {
    if (listSize > 0) {
      listModel.contentChanged(0,listSize - 1);
      listModel.contentAdded(listSize - 1,newListSize - 1);
    }
 else     listModel.contentAdded(0,newListSize - 1);
  }
  if (selectedObject != null) {
    if (selectedObject instanceof MetaContact) {
      this.setSelectedIndex(listModel.indexOf(selectedObject));
    }
 else {
      this.setSelectedIndex(listModel.indexOf(selectedObject));
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the showOffline property.
 * @param isShowOffline TRUE to show all offline users, FALSE to hideoffline users.
 */
public void setShowOffline(boolean isShowOffline){
  Object selectedObject=null;
  int currentlySelectedIndex=this.getSelectedIndex();
  if (currentlySelectedIndex != -1) {
    selectedObject=listModel.getElementAt(currentlySelectedIndex);
  }
  int listSize=listModel.getSize();
  listModel.setShowOffline(isShowOffline);
  ConfigurationManager.setShowOffline(isShowOffline);
  int newListSize=listModel.getSize();
  if (!isShowOffline && listSize > 0) {
    if (newListSize > 0) {
      listModel.contentChanged(0,newListSize - 1);
      listModel.contentRemoved(newListSize - 1,listSize - 1);
    }
 else     listModel.contentRemoved(0,listSize - 1);
  }
 else   if (isShowOffline && newListSize > 0) {
    if (listSize > 0) {
      listModel.contentChanged(0,listSize - 1);
      listModel.contentAdded(listSize - 1,newListSize - 1);
    }
 else     listModel.contentAdded(0,newListSize - 1);
  }
  if (selectedObject != null) {
    this.setSelectedIndex(listModel.indexOf(selectedObject));
  }
}
Program: 104000
Project: 104000
Buggy source:
/** 
 * Sends a <tt>WhiteboardObject</tt> to delete and delete the local <tt>WhiteboardObject</tt>
 * @param obj the <tt>WhiteboardObject</tt> to send and delete
 * @throws OperationFailedException if sendingthe WhiteboardObject fails for some reason.
 */
public void deleteWhiteboardObject(WhiteboardObject obj) throws OperationFailedException {
  Iterator participants=getWhiteboardParticipants();
  if (!participants.hasNext())   return;
  WhiteboardParticipantJabberImpl participant=(WhiteboardParticipantJabberImpl)participants.next();
  Contact contact=participant.getContact();
  try {
    assertConnected();
    org.jivesoftware.smack.packet.Message msg=new org.jivesoftware.smack.packet.Message();
    WhiteboardObjectPacketExtension messageJI=new WhiteboardObjectPacketExtension(obj.getID(),WhiteboardObjectPacketExtension.ACTION_DELETE);
    msg.addExtension(messageJI);
    msg.addExtension(new Version());
    MessageEventManager.addNotificationsRequests(msg,true,false,false,true);
    smackChat.sendMessage(msg);
    WhiteboardObjectDeliveredEvent msgDeliveredEvt=new WhiteboardObjectDeliveredEvent(this,obj,contact,new Date());
    fireMessageEvent(msgDeliveredEvt);
    int i=0;
    while (i < whiteboardObjects.size()) {
      WhiteboardObjectJabberImpl wbObj=(WhiteboardObjectJabberImpl)whiteboardObjects.get(i);
      if (wbObj.getID().equals(obj.getID()))       whiteboardObjects.remove(i);
 else       i++;
    }
  }
 catch (  XMPPException ex) {
    ex.printStackTrace();
    logger.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Sends a <tt>WhiteboardObject</tt> to delete and delete the local <tt>WhiteboardObject</tt>
 * @param obj the <tt>WhiteboardObject</tt> to send and delete
 * @throws OperationFailedException if sendingthe WhiteboardObject fails for some reason.
 */
public void deleteWhiteboardObject(WhiteboardObject obj) throws OperationFailedException {
  Iterator participants=getWhiteboardParticipants();
  if (!participants.hasNext())   return;
  WhiteboardParticipantJabberImpl participant=(WhiteboardParticipantJabberImpl)participants.next();
  Contact contact=participant.getContact();
  try {
    assertConnected();
    org.jivesoftware.smack.packet.Message msg=new org.jivesoftware.smack.packet.Message();
    WhiteboardObjectPacketExtension messageJI=new WhiteboardObjectPacketExtension(obj.getID(),WhiteboardObjectPacketExtension.ACTION_DELETE);
    msg.addExtension(messageJI);
    msg.addExtension(new Version());
    MessageEventManager.addNotificationsRequests(msg,true,false,false,true);
    smackChat.sendMessage(msg);
    WhiteboardObjectDeliveredEvent msgDeliveredEvt=new WhiteboardObjectDeliveredEvent(this,obj,contact,new Date());
    fireMessageEvent(msgDeliveredEvt);
    int i=0;
    while (i < whiteboardObjects.size()) {
      WhiteboardObjectJabberImpl wbObj=whiteboardObjects.get(i);
      if (wbObj.getID().equals(obj.getID()))       whiteboardObjects.remove(i);
 else       i++;
    }
  }
 catch (  XMPPException ex) {
    ex.printStackTrace();
    logger.error("String_Node_Str",ex);
  }
}
Program: 104004
Project: 104004
Buggy source:
/** 
 * Indicates whether some other object is "equal to" this account id. <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.
 * @see #hashCode()
 * @see java.util.Hashtable
 */
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null || !(getClass().isInstance(obj)) || !(userID.equals(((AccountID)obj).userID)))   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * Indicates whether some other object is "equal to" this account id. <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.
 * @see #hashCode()
 * @see java.util.Hashtable
 */
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  return (obj != null) && getClass().isInstance(obj) && userID.equals(((AccountID)obj).userID);
}
Program: 104005
Project: 104005
Buggy source:
/** 
 * Returns an empty iterator. Subgroups may only be present in the root group.
 * @return an empty iterator
 */
public Iterator subgroups(){
  return dummyGroupsList.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an empty iterator. Subgroups may only be present in the root group.
 * @return an empty iterator
 */
public Iterator<ContactGroup> subgroups(){
  return dummyGroupsList.iterator();
}
Program: 104006
Project: 104006
Buggy source:
/** 
 * Returns the icq contact encapsulating with the spcieified screen name or null if no such contact was found.
 * @param screenName the screenName (or icq UIN) for the contact we'relooking for.
 * @return the <tt>ContactIcqImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactIcqImpl findContact(String screenName){
  if (screenName == null)   return null;
  String lcScreenName=screenName.toLowerCase();
  return buddies.get(lcScreenName);
}

Fixed version (ground truth):
/** 
 * Returns the icq contact encapsulating with the spcieified screen name or null if no such contact was found.
 * @param screenName the screenName (or icq UIN) for the contact we'relooking for.
 * @return the <tt>ContactIcqImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactIcqImpl findContact(String screenName){
  if (screenName == null)   return null;
  String lcScreenName=screenName.toLowerCase();
  return (ContactIcqImpl)buddies.get(lcScreenName);
}
Program: 104007
Project: 104007
Buggy source:
/** 
 * Returns a string representation of this group, in the form IcqGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
 * @return  a String representation of the object.
 */
public String toString(){
  StringBuffer buff=new StringBuffer("String_Node_Str");
  buff.append(getGroupName());
  buff.append("String_Node_Str" + countContacts() + "String_Node_Str");
  Iterator contacts=contacts();
  while (contacts.hasNext()) {
    ContactIcqImpl contact=(ContactIcqImpl)contacts.next();
    buff.append(contact.toString());
    if (contacts.hasNext())     buff.append("String_Node_Str");
  }
  return buff.append("String_Node_Str").toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of this group, in the form IcqGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
 * @return  a String representation of the object.
 */
public String toString(){
  StringBuffer buff=new StringBuffer("String_Node_Str");
  buff.append(getGroupName());
  buff.append("String_Node_Str" + countContacts() + "String_Node_Str");
  Iterator<Contact> contacts=contacts();
  while (contacts.hasNext()) {
    Contact contact=contacts.next();
    buff.append(contact.toString());
    if (contacts.hasNext())     buff.append("String_Node_Str");
  }
  return buff.append("String_Node_Str").toString();
}
Program: 104008
Project: 104008
Buggy source:
/** 
 * Returns the index of contact in this group -1 if no such contact was found.
 * @param contact the contact whose index we're looking for.
 * @return the index of contact in this group.
 */
int findContactIndex(Contact contact){
  Iterator contacts=contacts();
  int i=0;
  while (contacts.hasNext()) {
    ContactIcqImpl item=(ContactIcqImpl)contacts.next();
    if (item == contact)     return i;
    i++;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the index of contact in this group -1 if no such contact was found.
 * @param contact the contact whose index we're looking for.
 * @return the index of contact in this group.
 */
int findContactIndex(Contact contact){
  Iterator<Contact> contacts=contacts();
  int i=0;
  while (contacts.hasNext()) {
    ContactIcqImpl item=(ContactIcqImpl)contacts.next();
    if (item == contact)     return i;
    i++;
  }
  return -1;
}
Program: 104009
Project: 104009
Buggy source:
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any memebers it will return an empty iterator.
 */
public Iterator contacts(){
  return buddies.values().iterator();
}

Fixed version (ground truth):
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any memebers it will return an empty iterator.
 */
public Iterator<Contact> contacts(){
  return buddies.values().iterator();
}
Program: 104010
Project: 104010
Buggy source:
/** 
 * Returns an iterator over the sub groups that this <tt>ContactGroup</tt> contains.
 * @return a java.util.Iterator over the <tt>ContactGroup</tt>children of this group (i.e. subgroups).
 */
public Iterator subgroups(){
  return subGroups.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an iterator over the sub groups that this <tt>ContactGroup</tt> contains.
 * @return a java.util.Iterator over the <tt>ContactGroup</tt>children of this group (i.e. subgroups).
 */
public Iterator<ContactGroup> subgroups(){
  return subGroups.iterator();
}
Program: 104011
Project: 104011
Buggy source:
/** 
 * Returns the subgroup with the specified name.
 * @param groupName the name of the <tt>ContactGroup</tt> to retrieve.
 * @return the <tt>ContactGroup</tt> with the specified index.
 */
public ContactGroup getGroup(String groupName){
  Iterator<ContactGroupIcqImpl> subgroups=subgroups();
  while (subgroups.hasNext()) {
    ContactGroupIcqImpl grp=subgroups.next();
    if (grp.getGroupName().equals(groupName))     return grp;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the subgroup with the specified name.
 * @param groupName the name of the <tt>ContactGroup</tt> to retrieve.
 * @return the <tt>ContactGroup</tt> with the specified index.
 */
public ContactGroup getGroup(String groupName){
  Iterator<ContactGroup> subgroups=subgroups();
  while (subgroups.hasNext()) {
    ContactGroup grp=subgroups.next();
    if (grp.getGroupName().equals(groupName))     return grp;
  }
  return null;
}
Program: 104012
Project: 104012
Buggy source:
/** 
 * Returns a string representation of the root contact group that contains all subgroups and subcontacts of this group.
 * @return  a string representation of this root contact group.
 */
public String toString(){
  StringBuffer buff=new StringBuffer(getGroupName());
  buff.append("String_Node_Str" + countSubgroups() + "String_Node_Str");
  Iterator<ContactGroupIcqImpl> subGroups=subgroups();
  while (subGroups.hasNext()) {
    ContactGroup group=(ContactGroup)subGroups.next();
    buff.append(group.toString());
    if (subGroups.hasNext())     buff.append("String_Node_Str");
  }
  return buff.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of the root contact group that contains all subgroups and subcontacts of this group.
 * @return  a string representation of this root contact group.
 */
public String toString(){
  StringBuffer buff=new StringBuffer(getGroupName());
  buff.append("String_Node_Str" + countSubgroups() + "String_Node_Str");
  Iterator<ContactGroup> subGroups=subgroups();
  while (subGroups.hasNext()) {
    ContactGroup group=subGroups.next();
    buff.append(group.toString());
    if (subGroups.hasNext())     buff.append("String_Node_Str");
  }
  return buff.toString();
}
Program: 104013
Project: 104013
Buggy source:
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>
 */
public Iterator contacts(){
  return dummyContacts.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>
 */
public Iterator<Contact> contacts(){
  return dummyContacts.iterator();
}
Program: 104014
Project: 104014
Buggy source:
/** 
 * Returns the Contact with the specified screenname (or icq UIN) or null if no such screenname was found.
 * @param screenName the screen name (or ICQ UIN) 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 ContactIcqImpl findContactByScreenName(String screenName){
  Iterator<ContactGroupIcqImpl> contactGroups=rootGroup.subgroups();
  ContactIcqImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=contactGroups.next();
    result=contactGroup.findContact(screenName);
    if (result != null)     return result;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the Contact with the specified screenname (or icq UIN) or null if no such screenname was found.
 * @param screenName the screen name (or ICQ UIN) 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 ContactIcqImpl findContactByScreenName(String screenName){
  Iterator<ContactGroup> contactGroups=rootGroup.subgroups();
  ContactIcqImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=(ContactGroupIcqImpl)contactGroups.next();
    result=contactGroup.findContact(screenName);
    if (result != null)     return result;
  }
  return null;
}
Program: 104016
Project: 104016
Buggy source:
ContactGroupIcqImpl findGroup(Buddy buddy){
  Iterator<ContactGroupIcqImpl> iter=rootGroup.subgroups();
  while (iter.hasNext()) {
    ContactGroupIcqImpl elem=iter.next();
    if (!elem.isPersistent() || !elem.isResolved())     continue;
    Iterator bs=elem.getJoustSimSourceGroup().getBuddiesCopy().iterator();
    while (bs.hasNext()) {
      Buddy b=(Buddy)bs.next();
      if (b == buddy)       return elem;
    }
  }
  return null;
}

Fixed version (ground truth):
ContactGroupIcqImpl findGroup(Buddy buddy){
  Iterator<ContactGroup> iter=rootGroup.subgroups();
  while (iter.hasNext()) {
    ContactGroupIcqImpl elem=(ContactGroupIcqImpl)iter.next();
    if (!elem.isPersistent() || !elem.isResolved())     continue;
    Iterator bs=elem.getJoustSimSourceGroup().getBuddiesCopy().iterator();
    while (bs.hasNext()) {
      Buddy b=(Buddy)bs.next();
      if (b == buddy)       return elem;
    }
  }
  return null;
}
Program: 104017
Project: 104017
Buggy source:
/** 
 * Returns the index of the ContactGroup containing the specified joust sim group.
 * @param joustSimGroup the joust sim group we're looking for.
 * @return the index of the ContactGroup containing the specifiedjoustSimGroup or -1 if no containing ContactGroup exists.
 */
public int findContactGroupIndex(Group joustSimGroup){
  Iterator<Group> contactGroups=rootGroup.subgroups();
  int index=0;
  for (; contactGroups.hasNext(); index++) {
    ContactGroupIcqImpl contactGroup=(ContactGroupIcqImpl)contactGroups.next();
    if (joustSimGroup == contactGroup.getJoustSimSourceGroup())     return index;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the index of the ContactGroup containing the specified joust sim group.
 * @param joustSimGroup the joust sim group we're looking for.
 * @return the index of the ContactGroup containing the specifiedjoustSimGroup or -1 if no containing ContactGroup exists.
 */
public int findContactGroupIndex(Group joustSimGroup){
  Iterator<ContactGroup> contactGroups=rootGroup.subgroups();
  int index=0;
  for (; contactGroups.hasNext(); index++) {
    ContactGroupIcqImpl contactGroup=(ContactGroupIcqImpl)contactGroups.next();
    if (joustSimGroup == contactGroup.getJoustSimSourceGroup())     return index;
  }
  return -1;
}
Program: 104018
Project: 104018
Buggy source:
/** 
 * Returns the ContactGroup containing the specified contact or null if no such group or contact exist.
 * @param child the contact whose parent group we're looking for.
 * @return the <tt>ContactGroup</tt> containing the specified<tt>contact</tt> or <tt>null</tt> if no such groupo or contact exist.
 */
public ContactGroupIcqImpl findContactGroup(ContactIcqImpl child){
  Iterator<ContactGroupIcqImpl> contactGroups=rootGroup.subgroups();
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=contactGroups.next();
    if (contactGroup.findContact(child.getJoustSimBuddy()) != null)     return contactGroup;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the ContactGroup containing the specified contact or null if no such group or contact exist.
 * @param child the contact whose parent group we're looking for.
 * @return the <tt>ContactGroup</tt> containing the specified<tt>contact</tt> or <tt>null</tt> if no such groupo or contact exist.
 */
public ContactGroupIcqImpl findContactGroup(ContactIcqImpl child){
  Iterator<ContactGroup> contactGroups=rootGroup.subgroups();
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=(ContactGroupIcqImpl)contactGroups.next();
    if (contactGroup.findContact(child.getJoustSimBuddy()) != null)     return contactGroup;
  }
  return null;
}
Program: 104019
Project: 104019
Buggy source:
/** 
 * Returns the Contact with the specified screenname (or icq UIN) or null if no such screenname was found.
 * @param screenName the screen name (or ICQ UIN) 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 ContactIcqImpl findContactByJoustSimBuddy(Buddy buddy){
  Iterator<ContactGroupIcqImpl> contactGroups=rootGroup.subgroups();
  String screenName=buddy.getScreenname().getFormatted();
  ContactIcqImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=contactGroups.next();
    result=contactGroup.findContact(screenName);
    if (result != null)     return result;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the Contact with the specified screenname (or icq UIN) or null if no such screenname was found.
 * @param screenName the screen name (or ICQ UIN) 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 ContactIcqImpl findContactByJoustSimBuddy(Buddy buddy){
  Iterator<ContactGroup> contactGroups=rootGroup.subgroups();
  String screenName=buddy.getScreenname().getFormatted();
  ContactIcqImpl result=null;
  while (contactGroups.hasNext()) {
    ContactGroupIcqImpl contactGroup=(ContactGroupIcqImpl)contactGroups.next();
    result=contactGroup.findContact(screenName);
    if (result != null)     return result;
  }
  return null;
}
Program: 104020
Project: 104020
Buggy source:
/** 
 * Returns the contact encapsulating with the spcieified name or null if no such contact was found.
 * @param id the id for the contact we're looking for.
 * @return the <tt>ContactMsnImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactMsnImpl findContact(String id){
  Iterator contacts=contacts();
  while (contacts.hasNext()) {
    ContactMsnImpl item=(ContactMsnImpl)contacts.next();
    if (item.getAddress().equals(id))     return item;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the contact encapsulating with the spcieified name or null if no such contact was found.
 * @param id the id for the contact we're looking for.
 * @return the <tt>ContactMsnImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactMsnImpl findContact(String id){
  if (id == null)   return null;
  return (ContactMsnImpl)buddies.get(id.toLowerCase());
}
Program: 104021
Project: 104021
Buggy source:
/** 
 * Returns an empty iterator. Subgroups may only be present in the root group.
 * @return an empty iterator
 */
public Iterator subgroups(){
  return dummyGroupsList.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an empty iterator. Subgroups may only be present in the root group.
 * @return an empty iterator
 */
public Iterator<ContactGroup> subgroups(){
  return dummyGroupsList.iterator();
}
Program: 104022
Project: 104022
Buggy source:
/** 
 * Returns a string representation of this group, in the form MsnGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
 * @return  a String representation of the object.
 */
public String toString(){
  StringBuffer buff=new StringBuffer("String_Node_Str");
  buff.append(getGroupName());
  buff.append("String_Node_Str" + countContacts() + "String_Node_Str");
  Iterator contacts=contacts();
  while (contacts.hasNext()) {
    ContactMsnImpl contact=(ContactMsnImpl)contacts.next();
    buff.append(contact.toString());
    if (contacts.hasNext())     buff.append("String_Node_Str");
  }
  return buff.append("String_Node_Str").toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of this group, in the form MsnGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
 * @return  a String representation of the object.
 */
public String toString(){
  StringBuffer buff=new StringBuffer("String_Node_Str");
  buff.append(getGroupName());
  buff.append("String_Node_Str" + countContacts() + "String_Node_Str");
  Iterator<Contact> contacts=contacts();
  while (contacts.hasNext()) {
    Contact contact=contacts.next();
    buff.append(contact.toString());
    if (contacts.hasNext())     buff.append("String_Node_Str");
  }
  return buff.append("String_Node_Str").toString();
}
Program: 104023
Project: 104023
Buggy source:
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any memebers it will return an empty iterator.
 */
public Iterator contacts(){
  return buddies.values().iterator();
}

Fixed version (ground truth):
/** 
 * Returns an Iterator over all contacts, member of this <tt>ContactGroup</tt>.
 * @return a java.util.Iterator over all contacts inside this<tt>ContactGroup</tt>. In case the group doesn't contain any memebers it will return an empty iterator.
 */
public Iterator<Contact> contacts(){
  return buddies.values().iterator();
}
Program: 104025
Project: 104025
Buggy source:
/** 
 * Return required control from the Control[] array if exists, that is
 */
public Object getControl(String controlType){
  try {
    Class cls=Class.forName(controlType);
    Object cs[]=getControls();
    for (int i=0; i < cs.length; i++) {
      if (cls.isInstance(cs[i]))       return cs[i];
    }
    return null;
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return required control from the Control[] array if exists, that is
 */
public Object getControl(String controlType){
  try {
    Class<?> cls=Class.forName(controlType);
    Object cs[]=getControls();
    for (int i=0; i < cs.length; i++) {
      if (cls.isInstance(cs[i]))       return cs[i];
    }
    return null;
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 104026
Project: 104026
Buggy source:
/** 
 * Creates a connector specific for use in case of ZRTP key management
 * @param addr local RTP session listen address
 * @param cryptoProvider the cryptography services provider selection stringshould be obtained from a resource file or by querying 
 * @return the TransformConnector used for ZRTP processing
 * @throws InvalidSessionAddressException
 */
public static TransformConnector createZRTPConnector(SessionAddress addr,CallSession callSession) throws InvalidSessionAddressException {
  ZRTPTransformEngine engine=new ZRTPTransformEngine();
  TransformConnector connector=new ZrtpTransformConnector(addr,engine);
  engine.setConnector(connector);
  return connector;
}

Fixed version (ground truth):
/** 
 * Creates a connector specific for use in case of ZRTP key management
 * @param addr local RTP session listen address
 * @param cryptoProvider the cryptography services provider selection stringshould be obtained from a resource file or by querying 
 * @return the TransformConnector used for ZRTP processing
 * @throws InvalidSessionAddressException
 */
public static TransformConnector createZRTPConnector(SessionAddress addr) throws InvalidSessionAddressException {
  ZRTPTransformEngine engine=new ZRTPTransformEngine();
  TransformConnector connector=new ZrtpTransformConnector(addr,engine);
  engine.setConnector(connector);
  return connector;
}
Program: 104027
Project: 104027
Buggy source:
public int write(byte[] buffer,int offset,int length){
  RawPacket pkt=this.transformer.transform(new RawPacket(buffer,offset,length));
  for (int i=0; i < this.remoteAddrs.size(); ++i) {
    InetAddress remoteAddr=(InetAddress)this.remoteAddrs.elementAt(i);
    int remotePort=((Integer)this.remotePorts.elementAt(i)).intValue();
    try {
      this.socket.send(new DatagramPacket(pkt.getBuffer(),pkt.getOffset(),pkt.getLength(),remoteAddr,remotePort));
    }
 catch (    Exception e) {
      return -1;
    }
  }
  return length;
}

Fixed version (ground truth):
public int write(byte[] buffer,int offset,int length){
  RawPacket pkt=this.transformer.transform(new RawPacket(buffer,offset,length));
  for (int i=0; i < this.remoteAddrs.size(); ++i) {
    InetAddress remoteAddr=this.remoteAddrs.elementAt(i);
    int remotePort=(this.remotePorts.elementAt(i)).intValue();
    try {
      this.socket.send(new DatagramPacket(pkt.getBuffer(),pkt.getOffset(),pkt.getLength(),remoteAddr,remotePort));
    }
 catch (    Exception e) {
      return -1;
    }
  }
  return length;
}
Program: 104028
Project: 104028
Buggy source:
/** 
 * Get RTP header length from a RTP packet
 * @param pkt the source RTP packet
 * @return RTP header length from source RTP packet
 */
public static int GetRTPHeaderLength(RawPacket pkt){
  boolean hasExtension=((pkt.readByte(0) & (0x01 << 2)) != 0);
  if (hasExtension) {
    return -1;
  }
  int csrcNum=(int)(pkt.readByte(0) & 0xF);
  return 12 + 4 * csrcNum;
}

Fixed version (ground truth):
/** 
 * Get RTP header length from a RTP packet
 * @param pkt the source RTP packet
 * @return RTP header length from source RTP packet
 */
public static int GetRTPHeaderLength(RawPacket pkt){
  boolean hasExtension=((pkt.readByte(0) & (0x01 << 2)) != 0);
  if (hasExtension) {
    return -1;
  }
  int csrcNum=pkt.readByte(0) & 0xF;
  return 12 + 4 * csrcNum;
}
Program: 104029
Project: 104029
Buggy source:
/** 
 * Get RTP padding size from a RTP packet
 * @param pkt the source RTP packet
 * @return RTP padding size from source RTP packet
 */
public static int GetRTPPaddingSize(RawPacket pkt){
  if ((pkt.readByte(0) & (0x01 << 2)) == 0) {
    return 0;
  }
 else {
    return (int)pkt.readByte(pkt.getLength() - 1);
  }
}

Fixed version (ground truth):
/** 
 * Get RTP padding size from a RTP packet
 * @param pkt the source RTP packet
 * @return RTP padding size from source RTP packet
 */
public static int GetRTPPaddingSize(RawPacket pkt){
  if ((pkt.readByte(0) & (0x01 << 2)) == 0) {
    return 0;
  }
 else {
    return pkt.readByte(pkt.getLength() - 1);
  }
}
Program: 104030
Project: 104030
Buggy source:
/** 
 * Constructs a SRTCPTransformer object
 * @param engine The associated SRTPTransformEngine object
 */
public SRTCPTransformer(SRTPTransformEngine engine){
  this.engine=engine;
}

Fixed version (ground truth):
/** 
 * Constructs a SRTCPTransformer object
 * @param engine The associated SRTPTransformEngine object
 */
public SRTCPTransformer(SRTPTransformEngine engine){
}