nus-yam/ex-repair huggingface dataset:
Program: 104072
Project: 104072
Buggy source:
/** 
 * Creates a room with the named <tt>roomName</tt> and according to the specified <tt>roomProperties</tt> on the server that this protocol provider is currently connected to. Note the roomProperties also contain users that we like to invite to the chatRoom, this is required in the yahoo protocol.
 * @param roomName the name of the <tt>ChatRoom</tt> to create.
 * @param roomProperties properties specifying how the room should be created.
 * @throws OperationFailedException if the room couldn't be created for some reason (e.g. room already exists; user already joined to an existent room or user has no permissions to create a chat room).
 * @throws OperationNotSupportedException if chat room creation is not supported by this server
 * @return ChatRoom the chat room that we've just created.
 */
public ChatRoom createChatRoom(String roomName,Hashtable<String,Object> roomProperties) throws OperationFailedException, OperationNotSupportedException {
  ChatRoom chatRoom=null;
  try {
    YahooConference conference=yahooProvider.getYahooSession().createConference(new String[]{},"String_Node_Str",yahooProvider.getYahooSession().getLoginIdentity());
    chatRoom=findRoom(conference);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str" + e);
  }
  return chatRoom;
}

Fixed version (ground truth):
/** 
 * Creates a room with the named <tt>roomName</tt> and according to the specified <tt>roomProperties</tt> on the server that this protocol provider is currently connected to. Note the roomProperties also contain users that we like to invite to the chatRoom, this is required in the yahoo protocol.
 * @param roomName the name of the <tt>ChatRoom</tt> to create.
 * @param roomProperties properties specifying how the room should be created.
 * @throws OperationFailedException if the room couldn't be created for some reason (e.g. room already exists; user already joined to an existent room or user has no permissions to create a chat room).
 * @throws OperationNotSupportedException if chat room creation is not supported by this server
 * @return ChatRoom the chat room that we've just created.
 */
public ChatRoom createChatRoom(String roomName,Map<String,Object> roomProperties) throws OperationFailedException, OperationNotSupportedException {
  ChatRoom chatRoom=null;
  try {
    YahooConference conference=yahooProvider.getYahooSession().createConference(new String[]{},"String_Node_Str",yahooProvider.getYahooSession().getLoginIdentity());
    chatRoom=findRoom(conference);
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str" + e);
  }
  return chatRoom;
}
Program: 104073
Project: 104073
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: 104074
Project: 104074
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>ContactJabberImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactJabberImpl findContact(String id){
  if (id == null)   return null;
  return buddies.get(id.toLowerCase());
}

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>ContactJabberImpl</tt> corresponding to the specifiedscrenname or null if no such contact existed.
 */
ContactJabberImpl findContact(String id){
  if (id == null)   return null;
  return (ContactJabberImpl)buddies.get(id.toLowerCase());
}
Program: 104075
Project: 104075
Buggy source:
/** 
 * Returns a string representation of this group, in the form JabberGroup.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()) {
    ContactJabberImpl contact=(ContactJabberImpl)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 JabberGroup.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()) {
    ContactJabberImpl contact=(ContactJabberImpl)contacts.next();
    buff.append(contact.toString());
    if (contacts.hasNext())     buff.append("String_Node_Str");
  }
  return buff.append("String_Node_Str").toString();
}
Program: 104076
Project: 104076
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: 104078
Project: 104078
Buggy source:
/** 
 * Notify all provider presence listeners of the corresponding event change
 * @param oldStatus the status our stack had so far
 * @param newStatus the status we have from now on
 */
void fireProviderPresenceStatusChangeEvent(PresenceStatus oldStatus,PresenceStatus newStatus){
  if (oldStatus.equals(newStatus)) {
    logger.debug("String_Node_Str" + oldStatus);
    return;
  }
  ProviderPresenceStatusChangeEvent evt=new ProviderPresenceStatusChangeEvent(parentProvider,oldStatus,newStatus);
  currentStatus=newStatus;
  logger.debug("String_Node_Str" + providerPresenceStatusListeners.size() + "String_Node_Str"+ evt);
  Iterator listeners=null;
synchronized (providerPresenceStatusListeners) {
    listeners=new ArrayList(providerPresenceStatusListeners).iterator();
  }
  while (listeners.hasNext()) {
    ProviderPresenceStatusListener listener=(ProviderPresenceStatusListener)listeners.next();
    listener.providerStatusChanged(evt);
  }
}

Fixed version (ground truth):
/** 
 * Notify all provider presence listeners of the corresponding event change
 * @param oldStatus the status our stack had so far
 * @param newStatus the status we have from now on
 */
void fireProviderPresenceStatusChangeEvent(PresenceStatus oldStatus,PresenceStatus newStatus){
  if (oldStatus.equals(newStatus)) {
    logger.debug("String_Node_Str" + oldStatus);
    return;
  }
  ProviderPresenceStatusChangeEvent evt=new ProviderPresenceStatusChangeEvent(parentProvider,oldStatus,newStatus);
  currentStatus=newStatus;
  logger.debug("String_Node_Str" + providerPresenceStatusListeners.size() + "String_Node_Str"+ evt);
  Iterator<ProviderPresenceStatusListener> listeners=null;
synchronized (providerPresenceStatusListeners) {
    listeners=new ArrayList<ProviderPresenceStatusListener>(providerPresenceStatusListeners).iterator();
  }
  while (listeners.hasNext()) {
    ProviderPresenceStatusListener listener=listeners.next();
    listener.providerStatusChanged(evt);
  }
}
Program: 104079
Project: 104079
Buggy source:
/** 
 * Notify all provider presence listeners that a new status message has been set.
 * @param oldStatusMessage the status message our stack had so far
 * @param newStatusMessage the status message we have from now on
 */
private void fireProviderStatusMessageChangeEvent(String oldStatusMessage,String newStatusMessage){
  PropertyChangeEvent evt=new PropertyChangeEvent(parentProvider,ProviderPresenceStatusListener.STATUS_MESSAGE,oldStatusMessage,newStatusMessage);
  logger.debug("String_Node_Str" + providerPresenceStatusListeners.size() + "String_Node_Str"+ evt);
  Iterator listeners=null;
synchronized (providerPresenceStatusListeners) {
    listeners=new ArrayList(providerPresenceStatusListeners).iterator();
  }
  while (listeners.hasNext()) {
    ProviderPresenceStatusListener listener=(ProviderPresenceStatusListener)listeners.next();
    listener.providerStatusMessageChanged(evt);
  }
}

Fixed version (ground truth):
/** 
 * Notify all provider presence listeners that a new status message has been set.
 * @param oldStatusMessage the status message our stack had so far
 * @param newStatusMessage the status message we have from now on
 */
private void fireProviderStatusMessageChangeEvent(String oldStatusMessage,String newStatusMessage){
  PropertyChangeEvent evt=new PropertyChangeEvent(parentProvider,ProviderPresenceStatusListener.STATUS_MESSAGE,oldStatusMessage,newStatusMessage);
  logger.debug("String_Node_Str" + providerPresenceStatusListeners.size() + "String_Node_Str"+ evt);
  Iterator<ProviderPresenceStatusListener> listeners=null;
synchronized (providerPresenceStatusListeners) {
    listeners=new ArrayList<ProviderPresenceStatusListener>(providerPresenceStatusListeners).iterator();
  }
  while (listeners.hasNext()) {
    ProviderPresenceStatusListener listener=(ProviderPresenceStatusListener)listeners.next();
    listener.providerStatusMessageChanged(evt);
  }
}
Program: 104082
Project: 104082
Buggy source:
public void run(){
  OperationSetServerStoredAccountInfo accountInfoOpSet=(OperationSetServerStoredAccountInfo)protocolProvider.getOperationSet(OperationSetServerStoredAccountInfo.class);
  if (accountInfoOpSet != null) {
    byte[] accountImage=AccountInfoUtils.getImage(accountInfoOpSet);
    if (accountImage != null) {
      accountImageLabel.setImageIcon(new ImageIcon(accountImage));
    }
    String firstName=AccountInfoUtils.getFirstName(accountInfoOpSet);
    String lastName=AccountInfoUtils.getLastName(accountInfoOpSet);
    String accountName="String_Node_Str";
    if (firstName != null) {
      accountName+=firstName;
    }
    if (lastName != null) {
      accountName+="String_Node_Str" + lastName;
    }
    if (accountName.length() == 0) {
      String displayName=AccountInfoUtils.getDisplayName(accountInfoOpSet);
      if (displayName != null)       accountName=displayName;
    }
    if (accountName.length() > 0) {
      accountNameLabel.setText(accountName);
    }
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
public void run(){
  OperationSetServerStoredAccountInfo accountInfoOpSet=(OperationSetServerStoredAccountInfo)protocolProvider.getOperationSet(OperationSetServerStoredAccountInfo.class);
  if (accountInfoOpSet != null) {
    byte[] accountImage=AccountInfoUtils.getImage(accountInfoOpSet);
    if (accountImage != null) {
      if (accountImage.length > 0)       accountImageLabel.setImageIcon(new ImageIcon(accountImage));
    }
    String firstName=AccountInfoUtils.getFirstName(accountInfoOpSet);
    String lastName=AccountInfoUtils.getLastName(accountInfoOpSet);
    String accountName="String_Node_Str";
    if (firstName != null) {
      accountName+=firstName;
    }
    if (lastName != null) {
      accountName+="String_Node_Str" + lastName;
    }
    if (accountName.length() == 0) {
      String displayName=AccountInfoUtils.getDisplayName(accountInfoOpSet);
      if (displayName != null)       accountName=displayName;
    }
    if (accountName.length() > 0) {
      accountNameLabel.setText(accountName);
    }
    revalidate();
    repaint();
  }
}
Program: 104083
Project: 104083
Buggy source:
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  final ProtocolProviderService protocolProvider=evt.getProvider();
  this.updateStatus(protocolProvider);
  if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    new Thread(new Runnable(){
      public void run(){
        OperationSetServerStoredAccountInfo accountInfoOpSet=(OperationSetServerStoredAccountInfo)protocolProvider.getOperationSet(OperationSetServerStoredAccountInfo.class);
        if (accountInfoOpSet != null) {
          byte[] accountImage=AccountInfoUtils.getImage(accountInfoOpSet);
          if (accountImage != null) {
            accountImageLabel.setImageIcon(new ImageIcon(accountImage));
          }
          String firstName=AccountInfoUtils.getFirstName(accountInfoOpSet);
          String lastName=AccountInfoUtils.getLastName(accountInfoOpSet);
          String accountName="String_Node_Str";
          if (firstName != null) {
            accountName+=firstName;
          }
          if (lastName != null) {
            accountName+="String_Node_Str" + lastName;
          }
          if (accountName.length() == 0) {
            String displayName=AccountInfoUtils.getDisplayName(accountInfoOpSet);
            if (displayName != null)             accountName=displayName;
          }
          if (accountName.length() > 0) {
            accountNameLabel.setText(accountName);
          }
          revalidate();
          repaint();
        }
      }
    }
).start();
  }
}

Fixed version (ground truth):
public void registrationStateChanged(RegistrationStateChangeEvent evt){
  final ProtocolProviderService protocolProvider=evt.getProvider();
  this.updateStatus(protocolProvider);
  if (evt.getNewState().equals(RegistrationState.REGISTERED)) {
    new Thread(new Runnable(){
      public void run(){
        OperationSetServerStoredAccountInfo accountInfoOpSet=(OperationSetServerStoredAccountInfo)protocolProvider.getOperationSet(OperationSetServerStoredAccountInfo.class);
        if (accountInfoOpSet != null) {
          byte[] accountImage=AccountInfoUtils.getImage(accountInfoOpSet);
          if (accountImage != null) {
            if (accountImage.length > 0)             accountImageLabel.setImageIcon(new ImageIcon(accountImage));
          }
          String firstName=AccountInfoUtils.getFirstName(accountInfoOpSet);
          String lastName=AccountInfoUtils.getLastName(accountInfoOpSet);
          String accountName="String_Node_Str";
          if (firstName != null) {
            accountName+=firstName;
          }
          if (lastName != null) {
            accountName+="String_Node_Str" + lastName;
          }
          if (accountName.length() == 0) {
            String displayName=AccountInfoUtils.getDisplayName(accountInfoOpSet);
            if (displayName != null)             accountName=displayName;
          }
          if (accountName.length() > 0) {
            accountNameLabel.setText(accountName);
          }
          revalidate();
          repaint();
        }
      }
    }
).start();
  }
}
Program: 104084
Project: 104084
Buggy source:
public void buddyIconUpdated(IconService iconService,Screenname screenname,ExtraInfoData extraInfoData,ByteBlock byteBlock){
  if (byteBlock != null) {
    if (screenname.getFormatted().equals(uin)) {
synchronized (this) {
        accountImage=new ImageDetail("String_Node_Str",byteBlock.toByteArray());
        this.notifyAll();
      }
    }
  }
}

Fixed version (ground truth):
public void buddyIconUpdated(IconService iconService,Screenname screenname,ExtraInfoData extraInfoData,ByteBlock byteBlock){
  if (byteBlock != null) {
    if (screenname.getFormatted().equals(uin)) {
synchronized (this) {
        byte[] img=byteBlock.toByteArray();
        if (img != null && img.length > 0)         accountImage=new ImageDetail("String_Node_Str",img);
        this.notifyAll();
      }
    }
  }
}
Program: 104085
Project: 104085
Buggy source:
public void run(){
  try {
    Collection copyContactsForUpdate=null;
    while (true) {
synchronized (contactsForUpdate) {
        if (contactsForUpdate.isEmpty())         contactsForUpdate.wait();
        copyContactsForUpdate=new Vector(contactsForUpdate);
        contactsForUpdate.clear();
      }
      Iterator iter=copyContactsForUpdate.iterator();
      while (iter.hasNext()) {
        ContactIcqImpl contact=(ContactIcqImpl)iter.next();
        String oldNickname=contact.getDisplayName();
        String nickName=getParentProvider().getInfoRetreiver().getNickName(contact.getUIN());
        if (nickName != null) {
          contact.setNickname(nickName);
          parentOperationSet.fireContactPropertyChangeEvent(ContactPropertyChangeEvent.PROPERTY_DISPLAY_NAME,contact,oldNickname,nickName);
        }
 else         contact.setNickname(oldNickname);
      }
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Collection copyContactsForUpdate=null;
    while (true) {
synchronized (contactsForUpdate) {
        if (contactsForUpdate.isEmpty())         contactsForUpdate.wait();
        copyContactsForUpdate=new Vector(contactsForUpdate);
        contactsForUpdate.clear();
      }
      Iterator iter=copyContactsForUpdate.iterator();
      while (iter.hasNext()) {
        ContactIcqImpl contact=(ContactIcqImpl)iter.next();
        String oldNickname=contact.getDisplayName();
        String nickName=null;
        try {
          nickName=getParentProvider().getInfoRetreiver().getNickName(contact.getUIN());
        }
 catch (        Exception e) {
          continue;
        }
        if (nickName != null) {
          contact.setNickname(nickName);
          parentOperationSet.fireContactPropertyChangeEvent(ContactPropertyChangeEvent.PROPERTY_DISPLAY_NAME,contact,oldNickname,nickName);
        }
 else         contact.setNickname(oldNickname);
      }
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
}
Program: 104087
Project: 104087
Buggy source:
/** 
 * Moves the corresponding node from its old parent to the node corresponding to the new parent meta group.
 * @param evt the MetaContactListEvent containing the corresponding contact
 */
public void metaContactMoved(MetaContactMovedEvent evt){
  Element metaContactNode=findMetaContactNode(evt.getSourceMetaContact().getMetaUID());
  Element newParentNode=findMetaContactGroupNode(evt.getNewParent().getMetaUID());
  if (metaContactNode == null) {
    logger.error("String_Node_Str" + evt.getSourceMetaContact());
    return;
  }
  if (newParentNode == null) {
    logger.error("String_Node_Str" + evt.getNewParent());
    return;
  }
  metaContactNode.getParentNode().removeChild(metaContactNode);
  updateParentsForMetaContactNode(metaContactNode,evt.getNewParent());
  Element childContacts=XMLUtils.findChild(newParentNode,CHILD_CONTACTS_NODE_NAME);
  childContacts.appendChild(metaContactNode);
  try {
    scheduleContactListStorage();
  }
 catch (  IOException ex) {
    logger.error("String_Node_Str" + evt.getSourceMetaContact(),ex);
  }
}

Fixed version (ground truth):
/** 
 * Moves the corresponding node from its old parent to the node corresponding to the new parent meta group.
 * @param evt the MetaContactListEvent containing the corresponding contact
 */
public void metaContactMoved(MetaContactMovedEvent evt){
  Element metaContactNode=findMetaContactNode(evt.getSourceMetaContact().getMetaUID());
  Element newParentNode=findMetaContactGroupNode(evt.getNewParent().getMetaUID());
  if (newParentNode == null) {
    logger.error("String_Node_Str" + evt.getNewParent());
    return;
  }
  if (metaContactNode == null) {
    metaContactNode=createMetaContactNode(evt.getSourceMetaContact());
  }
 else {
    metaContactNode.getParentNode().removeChild(metaContactNode);
  }
  updateParentsForMetaContactNode(metaContactNode,evt.getNewParent());
  Element childContacts=XMLUtils.findChild(newParentNode,CHILD_CONTACTS_NODE_NAME);
  childContacts.appendChild(metaContactNode);
  try {
    scheduleContactListStorage();
  }
 catch (  IOException ex) {
    logger.error("String_Node_Str" + evt.getSourceMetaContact(),ex);
  }
}
Program: 104091
Project: 104091
Buggy source:
/** 
 * Try to find a contact registered using a string to identify him.
 * @param contactID A string with which the contact may havebeen registered
 * @return A valid contact if it has been found, null otherwise
 */
Contact resolveContactID(String contactID){
  Contact res=this.findContactByID(contactID);
  if (res == null) {
    if (contactID.startsWith("String_Node_Str")) {
      res=this.findContactByID(contactID.substring(4));
    }
    if (res == null) {
      if (contactID.indexOf('@') > -1) {
        res=this.findContactByID(contactID.substring(0,contactID.indexOf('@')));
        if (res == null) {
          if (contactID.startsWith("String_Node_Str")) {
            res=this.findContactByID(contactID.substring(4,contactID.indexOf('@')));
          }
        }
      }
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Try to find a contact registered using a string to identify him.
 * @param contactID A string with which the contact may havebeen registered
 * @return A valid contact if it has been found, null otherwise
 */
Contact resolveContactID(String contactID){
  Contact res=this.findContactByID(contactID);
  if (res == null) {
    if (contactID.startsWith("String_Node_Str")) {
      res=this.findContactByID(contactID.substring(4));
    }
    if (res == null) {
      if (contactID.indexOf('@') > -1) {
        res=this.findContactByID(contactID.substring(0,contactID.indexOf('@')));
        if (res == null) {
          if (contactID.startsWith("String_Node_Str")) {
            res=this.findContactByID(contactID.substring(4,contactID.indexOf('@')));
          }
        }
      }
    }
    if (res == null) {
      int ix=contactID.indexOf("String_Node_Str",4);
      if (ix == -1)       ix=contactID.indexOf("String_Node_Str",4);
      if (ix > 0)       res=this.findContactByID(contactID.substring(4,contactID.indexOf("String_Node_Str",4)));
    }
  }
  return res;
}
Program: 104094
Project: 104094
Buggy source:
private void initPluginComponents(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + Container.CONTAINER_ID + "String_Node_Str"+ Container.CONTAINER_CHAT_TOOL_BAR.getID()+ "String_Node_Str";
  try {
    serRefs=GuiActivator.bundleContext.getServiceReferences(PluginComponent.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException exc) {
    logger.error("String_Node_Str",exc);
  }
  if (serRefs != null) {
    for (int i=0; i < serRefs.length; i++) {
      PluginComponent component=(PluginComponent)GuiActivator.bundleContext.getService(serRefs[i]);
      ;
      this.add((Component)component.getComponent());
      this.revalidate();
      this.repaint();
    }
  }
  GuiActivator.getUIService().addPluginComponentListener(this);
}

Fixed version (ground truth):
private void initPluginComponents(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + Container.CONTAINER_ID + "String_Node_Str"+ Container.CONTAINER_CHAT_TOOL_BAR.getID()+ "String_Node_Str";
  try {
    serRefs=GuiActivator.bundleContext.getServiceReferences(PluginComponent.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException exc) {
    logger.error("String_Node_Str",exc);
  }
  if (serRefs != null) {
    for (int i=0; i < serRefs.length; i++) {
      PluginComponent component=(PluginComponent)GuiActivator.bundleContext.getService(serRefs[i]);
      this.add((Component)component.getComponent());
      this.revalidate();
      this.repaint();
    }
  }
  GuiActivator.getUIService().addPluginComponentListener(this);
}
Program: 104095
Project: 104095
Buggy source:
/** 
 * Creates an instance and constructs the <tt>MainToolBar</tt>.
 * @param messageWindow The parent <tt>ChatWindow</tt>.
 */
public MainToolBar(ChatWindow messageWindow){
  this.messageWindow=messageWindow;
  this.setOpaque(false);
  this.setLayout(new FlowLayout(FlowLayout.LEFT,3,0));
  this.add(inviteButton);
  this.add(historyButton);
  this.add(optionsButton);
  this.sendFileButton.setName("String_Node_Str");
  this.sendFileButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.historyButton.setName("String_Node_Str");
  this.historyButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str") + "String_Node_Str");
  this.inviteButton.setName("String_Node_Str");
  this.inviteButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.optionsButton.setName("String_Node_Str");
  this.optionsButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.sendFileButton.addActionListener(this);
  this.historyButton.addActionListener(this);
  this.inviteButton.addActionListener(this);
  this.optionsButton.addActionListener(this);
  this.initPluginComponents();
}

Fixed version (ground truth):
/** 
 * Creates an instance and constructs the <tt>MainToolBar</tt>.
 * @param messageWindow The parent <tt>ChatWindow</tt>.
 */
public MainToolBar(ChatWindow messageWindow){
  this.messageWindow=messageWindow;
  this.setOpaque(false);
  this.setLayout(new FlowLayout(FlowLayout.LEFT,3,0));
  this.add(inviteButton);
  this.add(historyButton);
  this.add(optionsButton);
  this.add(previousButton);
  this.add(nextButton);
  this.previousButton.setName("String_Node_Str");
  this.previousButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.nextButton.setName("String_Node_Str");
  this.nextButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.sendFileButton.setName("String_Node_Str");
  this.sendFileButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.historyButton.setName("String_Node_Str");
  this.historyButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str") + "String_Node_Str");
  this.inviteButton.setName("String_Node_Str");
  this.inviteButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.optionsButton.setName("String_Node_Str");
  this.optionsButton.setToolTipText(GuiActivator.getResources().getI18NString("String_Node_Str"));
  this.previousButton.addActionListener(this);
  this.nextButton.addActionListener(this);
  this.sendFileButton.addActionListener(this);
  this.historyButton.addActionListener(this);
  this.inviteButton.addActionListener(this);
  this.optionsButton.addActionListener(this);
  this.initPluginComponents();
}
Program: 104096
Project: 104096
Buggy source:
/** 
 * Disables/Enables history arrow buttons depending on whether the current page is the first, the last page or a middle page.
 */
public void changeHistoryButtonsState(ChatPanel chatPanel){
}

Fixed version (ground truth):
/** 
 * Disables/Enables history arrow buttons depending on whether the current page is the first, the last page or a middle page.
 */
public void changeHistoryButtonsState(ChatPanel chatPanel){
  ChatConversationPanel convPanel=chatPanel.getChatConversationPanel();
  long firstMsgInHistory=chatPanel.getFirstHistoryMsgTimestamp();
  long lastMsgInHistory=chatPanel.getLastHistoryMsgTimestamp();
  Date firstMsgInPage=convPanel.getPageFirstMsgTimestamp();
  Date lastMsgInPage=convPanel.getPageLastMsgTimestamp();
  if (firstMsgInHistory == 0 || lastMsgInHistory == 0) {
    previousButton.setEnabled(false);
    nextButton.setEnabled(false);
    return;
  }
  if (firstMsgInHistory < firstMsgInPage.getTime())   previousButton.setEnabled(true);
 else   previousButton.setEnabled(false);
  if (lastMsgInPage.getTime() > 0 && (lastMsgInHistory > lastMsgInPage.getTime())) {
    nextButton.setEnabled(true);
  }
 else {
    nextButton.setEnabled(false);
  }
}
Program: 104097
Project: 104097
Buggy source:
/** 
 * Passes the message to the contained <code>ChatConversationPanel</code> for processing and appends it at the end of the conversationPanel document.
 * @param contactName The name of the contact sending the message.
 * @param date The time at which the message is sent or received.
 * @param messageType The type of the message. One of OUTGOING_MESSAGEor INCOMING_MESSAGE.
 * @param message The message text.
 */
public void processMessage(String contactName,long date,String messageType,String message,String contentType){
  String processedMessage=this.conversationPanel.processMessage(contactName,date,messageType,message,contentType);
  this.conversationPanel.appendMessageToEnd(processedMessage);
}

Fixed version (ground truth):
/** 
 * Passes the message to the contained <code>ChatConversationPanel</code> for processing and appends it at the end of the conversationPanel document.
 * @param contactName The name of the contact sending the message.
 * @param date The time at which the message is sent or received.
 * @param messageType The type of the message. One of OUTGOING_MESSAGEor INCOMING_MESSAGE.
 * @param message The message text.
 */
public void processMessage(String contactName,long date,String messageType,String message,String contentType){
  String processedMessage=this.conversationPanel.processMessage(contactName,date,messageType,message,contentType);
  this.conversationPanel.appendMessageToEnd(processedMessage);
  this.lastHistoryMsgTimestamp=date;
}
Program: 104099
Project: 104099
Buggy source:
/** 
 * Creates the corresponding ChatRoomMemberPresenceChangeEvent and notifies all <tt>ChatRoomMemberPresenceListener</tt>s that a ChatRoomMember has joined or left this <tt>ChatRoom</tt>.
 * @param member the <tt>ChatRoomMember</tt> that this event is about 
 * @param actorMember a member that act in the event (for example the kickerin a member kicked event)
 * @param eventID the identifier of the event
 * @param eventReason the reason of the event
 */
public void fireMemberPresenceEvent(ChatRoomMember member,ChatRoomMember actorMember,String eventID,String eventReason){
  ChatRoomMemberPresenceChangeEvent evt=null;
  if (actorMember != null)   evt=new ChatRoomMemberPresenceChangeEvent(this,member,actorMember,eventID,eventReason);
 else   evt=new ChatRoomMemberPresenceChangeEvent(this,member,eventID,eventReason);
  logger.trace("String_Node_Str" + evt);
  Iterator<ChatRoomMemberPresenceListener> listeners=null;
synchronized (memberListeners) {
    listeners=new ArrayList<ChatRoomMemberPresenceListener>(memberListeners).iterator();
  }
  while (listeners.hasNext()) {
    ChatRoomMemberPresenceListener listener=(ChatRoomMemberPresenceListener)listeners.next();
    listener.memberPresenceChanged(evt);
  }
}

Fixed version (ground truth):
/** 
 * Creates the corresponding ChatRoomMemberPresenceChangeEvent and notifies all <tt>ChatRoomMemberPresenceListener</tt>s that a ChatRoomMember has joined or left this <tt>ChatRoom</tt>.
 * @param member the <tt>ChatRoomMember</tt> that this event is about 
 * @param actorMember a member that act in the event (for example the kickerin a member kicked event)
 * @param eventID the identifier of the event
 * @param eventReason the reason of the event
 */
public void fireMemberPresenceEvent(ChatRoomMember member,ChatRoomMember actorMember,String eventID,String eventReason){
  ChatRoomMemberPresenceChangeEvent evt;
  if (actorMember != null)   evt=new ChatRoomMemberPresenceChangeEvent(this,member,actorMember,eventID,eventReason);
 else   evt=new ChatRoomMemberPresenceChangeEvent(this,member,eventID,eventReason);
  logger.trace("String_Node_Str" + evt);
  List<ChatRoomMemberPresenceListener> listeners;
synchronized (memberListeners) {
    listeners=new ArrayList<ChatRoomMemberPresenceListener>(memberListeners);
  }
  for (  ChatRoomMemberPresenceListener listener : listeners)   listener.memberPresenceChanged(evt);
}
Program: 104100
Project: 104100
Buggy source:
/** 
 * This method is called when we receive a user list from the server after joining a channel.
 * @param channel The name of the channel.
 * @param users An array of User objects belonging to this channel.
 * @see User
 */
protected void onUserList(String channel,User[] users){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + channel);
  ChatRoomIrcImpl chatRoom=ircMUCOpSet.getChatRoom(channel);
  chatRoom.clearChatRoomMemberList();
  for (int i=0; i < users.length; i++) {
    User user=users[i];
    ChatRoomMemberRole newMemberRole;
    if (user.getPrefix().equalsIgnoreCase("String_Node_Str")) {
      newMemberRole=ChatRoomMemberRole.ADMINISTRATOR;
    }
 else     if (user.getPrefix().equalsIgnoreCase("String_Node_Str")) {
      newMemberRole=ChatRoomMemberRole.MODERATOR;
    }
 else     if (user.getPrefix().equalsIgnoreCase("String_Node_Str")) {
      newMemberRole=ChatRoomMemberRole.MEMBER;
    }
 else {
      newMemberRole=ChatRoomMemberRole.GUEST;
    }
    ChatRoomMemberIrcImpl newMember=new ChatRoomMemberIrcImpl(parentProvider,chatRoom,user.getNick(),null,null,newMemberRole);
    chatRoom.addChatRoomMember(user.getNick(),newMember);
    chatRoom.fireMemberPresenceEvent(newMember,null,ChatRoomMemberPresenceChangeEvent.MEMBER_JOINED,null);
  }
}

Fixed version (ground truth):
/** 
 * This method is called when we receive a user list from the server after joining a channel.
 * @param channel The name of the channel.
 * @param users An array of User objects belonging to this channel.
 * @see User
 */
protected void onUserList(String channel,User[] users){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + channel);
  ChatRoomIrcImpl chatRoom=ircMUCOpSet.getChatRoom(channel);
  chatRoom.clearChatRoomMemberList();
  for (  User user : users) {
    String userPrefix=user.getPrefix();
    ChatRoomMemberRole newMemberRole;
    if ("String_Node_Str".equalsIgnoreCase(userPrefix))     newMemberRole=ChatRoomMemberRole.ADMINISTRATOR;
 else     if ("String_Node_Str".equalsIgnoreCase(userPrefix))     newMemberRole=ChatRoomMemberRole.MODERATOR;
 else     if ("String_Node_Str".equalsIgnoreCase(userPrefix))     newMemberRole=ChatRoomMemberRole.MEMBER;
 else     newMemberRole=ChatRoomMemberRole.GUEST;
    ChatRoomMemberIrcImpl newMember=new ChatRoomMemberIrcImpl(parentProvider,chatRoom,user.getNick(),null,null,newMemberRole);
    chatRoom.addChatRoomMember(user.getNick(),newMember);
    chatRoom.fireMemberPresenceEvent(newMember,null,ChatRoomMemberPresenceChangeEvent.MEMBER_JOINED,ChatRoomMemberPresenceChangeEvent.REASON_USER_LIST);
  }
}
Program: 104101
Project: 104101
Buggy source:
/** 
 * Returns the list of chat rooms on this server.
 * @return the list of chat rooms on this server
 */
public List getServerChatRoomList(){
  return serverChatRoomList;
}

Fixed version (ground truth):
/** 
 * Returns the list of chat rooms on this server.
 * @return the list of chat rooms on this server
 */
public List<String> getServerChatRoomList(){
  return serverChatRoomList;
}
Program: 104102
Project: 104102
Buggy source:
/** 
 * Returns the <tt>List</tt> of <tt>ChatRoom</tt>s currently available on the server that this protocol provider is connected to.
 * @return a <tt>java.util.List</tt> of <tt>ChatRoom</tt>s that arecurrently available on the server that this protocol provider is connected to.
 * @throws OperationFailedException if we failed retrieving this list fromthe server.
 */
public List getExistingChatRooms() throws OperationFailedException {
  return ircProvider.getIrcStack().getServerChatRoomList();
}

Fixed version (ground truth):
/** 
 * Returns the <tt>List</tt> of <tt>ChatRoom</tt>s currently available on the server that this protocol provider is connected to.
 * @return a <tt>java.util.List</tt> of <tt>ChatRoom</tt>s that arecurrently available on the server that this protocol provider is connected to.
 * @throws OperationFailedException if we failed retrieving this list fromthe server.
 */
public List<String> getExistingChatRooms() throws OperationFailedException {
  return ircProvider.getIrcStack().getServerChatRoomList();
}
Program: 104103
Project: 104103
Buggy source:
/** 
 * Delivers a <tt>LocalUserChatRoomPresenceChangeEvent</tt> to all registered <tt>LocalUserChatRoomPresenceListener</tt>s.
 * @param chatRoom the <tt>ChatRoom</tt> which has been joined, left, etc.
 * @param eventType the type of this event; one of LOCAL_USER_JOINED,LOCAL_USER_LEFT, etc.
 * @param reason the reason
 */
protected void fireLocalUserPresenceEvent(ChatRoom chatRoom,String eventType,String reason){
  LocalUserChatRoomPresenceChangeEvent evt=new LocalUserChatRoomPresenceChangeEvent(this,chatRoom,eventType,reason);
  Iterator listeners=null;
synchronized (localUserPresenceListeners) {
    listeners=new ArrayList(localUserPresenceListeners).iterator();
  }
  while (listeners.hasNext()) {
    LocalUserChatRoomPresenceListener listener=(LocalUserChatRoomPresenceListener)listeners.next();
    listener.localUserPresenceChanged(evt);
  }
}

Fixed version (ground truth):
/** 
 * Delivers a <tt>LocalUserChatRoomPresenceChangeEvent</tt> to all registered <tt>LocalUserChatRoomPresenceListener</tt>s.
 * @param chatRoom the <tt>ChatRoom</tt> which has been joined, left, etc.
 * @param eventType the type of this event; one of LOCAL_USER_JOINED,LOCAL_USER_LEFT, etc.
 * @param reason the reason
 */
protected void fireLocalUserPresenceEvent(ChatRoom chatRoom,String eventType,String reason){
  LocalUserChatRoomPresenceChangeEvent evt=new LocalUserChatRoomPresenceChangeEvent(this,chatRoom,eventType,reason);
  logger.trace("String_Node_Str" + evt);
  List<LocalUserChatRoomPresenceListener> listeners;
synchronized (localUserPresenceListeners) {
    listeners=new ArrayList<LocalUserChatRoomPresenceListener>(localUserPresenceListeners);
  }
  for (  LocalUserChatRoomPresenceListener listener : listeners)   listener.localUserPresenceChanged(evt);
}
Program: 104104
Project: 104104
Buggy source:
/** 
 * Returns a reference to a chatRoom named <tt>roomName</tt>. The room is created if it doesn't exists <p>
 * @param roomName the name of the <tt>ChatRoom</tt> that we're looking for.
 * @return the <tt>ChatRoom</tt> named <tt>roomName</tt>.
 */
public ChatRoom findRoom(String roomName){
  ChatRoom room=(ChatRoom)chatRoomCache.get(roomName);
  if (room != null) {
    return room;
  }
 else {
    return createLocalChatRoomInstance(roomName);
  }
}

Fixed version (ground truth):
/** 
 * Returns a reference to a chatRoom named <tt>roomName</tt>. The room is created if it doesn't exists <p>
 * @param roomName the name of the <tt>ChatRoom</tt> that we're looking for.
 * @return the <tt>ChatRoom</tt> named <tt>roomName</tt>.
 */
public ChatRoom findRoom(String roomName){
  ChatRoom room=chatRoomCache.get(roomName);
  return (room != null) ? room : createLocalChatRoomInstance(roomName);
}
Program: 104106
Project: 104106
Buggy source:
public void groupSelected(ContactListEvent evt){
  this.moveDialog.dispose();
  MetaContactGroup sourceGroup=evt.getSourceGroup();
  guiContactList.removeExcContactListListener(this);
  if (moveAllContacts) {
    mainFrame.getContactList().moveMetaContact(contactItem,sourceGroup);
  }
 else   if (contactToMove != null) {
    new MoveSubcontactThread(sourceGroup).start();
  }
}

Fixed version (ground truth):
public void groupSelected(ContactListEvent evt){
  this.moveDialog.dispose();
  MetaContactGroup sourceGroup=evt.getSourceGroup();
  guiContactList.removeExcContactListListener(this);
  if (moveAllContacts) {
    mainFrame.getContactList().moveMetaContact(contactItem,sourceGroup);
  }
 else   if (contactToMove != null) {
    new MoveSubcontactThread(sourceGroup).start();
  }
  guiContactList.setDisableOpenClose(false);
}
Program: 104108
Project: 104108
Buggy source:
public ManageButtonsPanel(JTable pluginTable){
  this.pluginTable=pluginTable;
  this.setLayout(new BorderLayout());
  this.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  String showSystemBundlesProp=PluginManagerActivator.getConfigurationService().getString("String_Node_Str");
  if (showSystemBundlesProp != null) {
    boolean isShowSystemBundles=new Boolean(showSystemBundlesProp).booleanValue();
    this.showSysBundlesCheckBox.setSelected(isShowSystemBundles);
    ((PluginTableModel)pluginTable.getModel()).setShowSystemBundles(isShowSystemBundles);
  }
  this.showSysBundlesCheckBox.addChangeListener(new ShowSystemBundlesChangeListener());
  this.buttonsPanel.add(newButton);
  this.buttonsPanel.add(activateButton);
  this.buttonsPanel.add(deactivateButton);
  this.buttonsPanel.add(uninstallButton);
  this.buttonsPanel.add(updateButton);
  this.buttonsPanel.add(showSysBundlesCheckBox);
  this.add(buttonsPanel,BorderLayout.NORTH);
  this.newButton.addActionListener(this);
  this.activateButton.addActionListener(this);
  this.deactivateButton.addActionListener(this);
  this.uninstallButton.addActionListener(this);
  this.updateButton.addActionListener(this);
}

Fixed version (ground truth):
public ManageButtonsPanel(JTable pluginTable){
  this.pluginTable=pluginTable;
  this.setLayout(new BorderLayout());
  this.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  String showSystemBundlesProp=PluginManagerActivator.getConfigurationService().getString("String_Node_Str");
  if (showSystemBundlesProp != null) {
    boolean isShowSystemBundles=new Boolean(showSystemBundlesProp).booleanValue();
    this.showSysBundlesCheckBox.setSelected(isShowSystemBundles);
    ((PluginTableModel)pluginTable.getModel()).setShowSystemBundles(isShowSystemBundles);
  }
  this.showSysBundlesCheckBox.addChangeListener(new ShowSystemBundlesChangeListener());
  this.buttonsPanel.add(newButton);
  this.buttonsPanel.add(activateButton);
  this.buttonsPanel.add(deactivateButton);
  this.buttonsPanel.add(uninstallButton);
  this.buttonsPanel.add(updateButton);
  this.buttonsPanel.add(showSysBundlesCheckBox);
  this.add(buttonsPanel,BorderLayout.NORTH);
  this.newButton.addActionListener(this);
  this.activateButton.addActionListener(this);
  this.deactivateButton.addActionListener(this);
  this.uninstallButton.addActionListener(this);
  this.updateButton.addActionListener(this);
  enableActivateButton(false);
  enableDeactivateButton(false);
  enableUninstallButton(false);
}
Program: 104109
Project: 104109
Buggy source:
public void stateChanged(ChangeEvent e){
  if (currentValue == showSysBundlesCheckBox.isSelected()) {
    return;
  }
  currentValue=showSysBundlesCheckBox.isSelected();
  PluginManagerActivator.getConfigurationService().setProperty("String_Node_Str",new Boolean(showSysBundlesCheckBox.isSelected()));
  PluginTableModel tableModel=(PluginTableModel)pluginTable.getModel();
  tableModel.setShowSystemBundles(showSysBundlesCheckBox.isSelected());
  tableModel.update();
}

Fixed version (ground truth):
public void stateChanged(ChangeEvent e){
  if (currentValue == showSysBundlesCheckBox.isSelected()) {
    return;
  }
  currentValue=showSysBundlesCheckBox.isSelected();
  PluginManagerActivator.getConfigurationService().setProperty("String_Node_Str",new Boolean(showSysBundlesCheckBox.isSelected()));
  PluginTableModel tableModel=(PluginTableModel)pluginTable.getModel();
  tableModel.setShowSystemBundles(showSysBundlesCheckBox.isSelected());
  tableModel.update();
  enableActivateButton(false);
  enableDeactivateButton(false);
  enableUninstallButton(false);
}
Program: 104110
Project: 104110
Buggy source:
public void keyPressed(KeyEvent e){
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  if (contactList.getModel().getSize() <= 0)   return;
  int keyCode=e.getKeyCode();
  if (keyCode == KeyEvent.VK_LEFT) {
    closeGroup();
  }
 else   if (keyCode == KeyEvent.VK_RIGHT) {
    openGroup();
  }
 else   if (keyCode == KeyEvent.VK_ENTER) {
    openOrCloseGroup();
  }
}
Program: 104112
Project: 104112
Buggy source:
public void actionPerformed(ActionEvent e){
  Object selectedValue=contactList.getSelectedValue();
  if (selectedValue instanceof MetaContact) {
    MetaContact contact=(MetaContact)selectedValue;
    SwingUtilities.invokeLater(new RunMessageWindow(contact));
  }
 else   if (selectedValue instanceof MetaContactGroup) {
    MetaContactGroup group=(MetaContactGroup)selectedValue;
    ContactListModel model=(ContactListModel)contactList.getModel();
    if (model.isGroupClosed(group)) {
      model.openGroup(group);
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  Object selectedValue=contactList.getSelectedValue();
  if (selectedValue instanceof MetaContact) {
    MetaContact contact=(MetaContact)selectedValue;
    SwingUtilities.invokeLater(new RunMessageWindow(contact));
  }
}
Program: 104113
Project: 104113
Buggy source:
/** 
 * Put the JAIN-SIP stack in a state where it cannot receive any data and frees the network ports used. That is to say remove JAIN-SIP <tt>ListeningPoint</tt>s and <tt>SipProvider</tt>s.
 */
private void stopListening(){
  try {
    this.secureJainSipProvider.removeSipListener(this);
    this.stack.deleteSipProvider(this.secureJainSipProvider);
    this.secureJainSipProvider=null;
    this.clearJainSipProvider.removeSipListener(this);
    this.stack.deleteSipProvider(this.clearJainSipProvider);
    this.clearJainSipProvider=null;
    Iterator<ListeningPoint> it=this.stack.getListeningPoints();
    while (it.hasNext()) {
      this.stack.deleteListeningPoint(it.next());
      it=this.stack.getListeningPoints();
    }
    this.stack.stop();
    logger.trace("String_Node_Str");
  }
 catch (  ObjectInUseException ex) {
    logger.fatal("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Put the JAIN-SIP stack in a state where it cannot receive any data and frees the network ports used. That is to say remove JAIN-SIP <tt>ListeningPoint</tt>s and <tt>SipProvider</tt>s.
 */
private void stopListening(){
  try {
    this.secureJainSipProvider.removeSipListener(this);
    this.stack.deleteSipProvider(this.secureJainSipProvider);
    this.secureJainSipProvider=null;
    this.clearJainSipProvider.removeSipListener(this);
    this.stack.deleteSipProvider(this.clearJainSipProvider);
    this.clearJainSipProvider=null;
    Iterator<ListeningPoint> it=this.stack.getListeningPoints();
    Vector<ListeningPoint> lpointsToRemove=new Vector<ListeningPoint>();
    while (it.hasNext()) {
      lpointsToRemove.add(it.next());
    }
    it=lpointsToRemove.iterator();
    while (it.hasNext()) {
      this.stack.deleteListeningPoint(it.next());
    }
    this.stack.stop();
    logger.trace("String_Node_Str");
  }
 catch (  ObjectInUseException ex) {
    logger.fatal("String_Node_Str",ex);
  }
}
Program: 104114
Project: 104114
Buggy source:
/** 
 * Creates a rounded corner scaled image.
 * @param imageBytes The bytes of the image to be scaled.
 * @param width The maximum width of the scaled image.
 * @param height The maximum height of the scaled image.
 * @return The rounded corner scaled image.
 */
public static ImageIcon getScaledRoundedIcon(byte[] imageBytes,int width,int height){
  if (imageBytes == null || !(imageBytes.length > 0))   return null;
  ImageIcon imageIcon=null;
  try {
    InputStream in=new ByteArrayInputStream(imageBytes);
    BufferedImage image=ImageIO.read(in);
    if (image != null)     imageIcon=getScaledRoundedIcon(image,width,height);
 else     logger.trace("String_Node_Str");
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
  }
  return imageIcon;
}

Fixed version (ground truth):
/** 
 * Creates a rounded corner scaled image.
 * @param imageBytes The bytes of the image to be scaled.
 * @param width The maximum width of the scaled image.
 * @param height The maximum height of the scaled image.
 * @return The rounded corner scaled image.
 */
public static ImageIcon getScaledRoundedIcon(byte[] imageBytes,int width,int height){
  if (imageBytes == null || !(imageBytes.length > 0))   return null;
  ImageIcon imageIcon=null;
  try {
    Image image=null;
    try {
      image=ImageIO.read(new ByteArrayInputStream(imageBytes));
    }
 catch (    Exception e) {
      try {
        image=Toolkit.getDefaultToolkit().createImage(imageBytes);
      }
 catch (      Exception e1) {
        throw e;
      }
    }
    if (image != null)     imageIcon=getScaledRoundedIcon(image,width,height);
 else     logger.trace("String_Node_Str");
  }
 catch (  Exception e) {
    logger.debug("String_Node_Str",e);
  }
  return imageIcon;
}