nus-yam/ex-repair huggingface dataset:
Program: 103620
Project: 103620
Buggy source:
/** 
 * Dispatches the given mouse <tt>event</tt> to the underlying buttons.
 * @param event the <tt>MouseEvent</tt> to dispatch
 */
private void dispatchEventToCheckBox(MouseEvent event){
  int mouseIndex=this.locationToIndex(event.getPoint());
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + mouseIndex);
  if (mouseIndex < 0)   return;
  Object value=getModel().getElementAt(mouseIndex);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + value);
  AccountListCellRenderer renderer=(AccountListCellRenderer)getCellRenderer().getListCellRendererComponent(this,value,mouseIndex,true,true);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + renderer.getBounds());
  Rectangle r=this.getCellBounds(mouseIndex,mouseIndex);
  int translatedX=event.getX() - r.x;
  int translatedY=event.getY() - r.y;
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + translatedX + "String_Node_Str"+ translatedY);
  Component mouseComponent=renderer.findComponentAt(translatedX,translatedY);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + mouseComponent);
  if (mouseComponent instanceof JCheckBox) {
    JCheckBox checkBox=((JCheckBox)mouseComponent);
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + !checkBox.isSelected());
    checkBox.setSelected(!checkBox.isSelected());
    enableAccount((Account)value,checkBox.isSelected());
    this.repaint();
  }
}

Fixed version (ground truth):
/** 
 * Dispatches the given mouse <tt>event</tt> to the underlying buttons.
 * @param event the <tt>MouseEvent</tt> to dispatch
 */
private void dispatchEventToCheckBox(MouseEvent event){
  int mouseIndex=this.locationToIndex(event.getPoint());
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + mouseIndex);
  if (mouseIndex < 0)   return;
  Account account=(Account)getModel().getElementAt(mouseIndex);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + account);
  AccountListCellRenderer renderer=(AccountListCellRenderer)getCellRenderer().getListCellRendererComponent(this,account,mouseIndex,true,true);
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + renderer.getBounds());
  Rectangle r=this.getCellBounds(mouseIndex,mouseIndex);
  int translatedX=event.getX() - r.x;
  int translatedY=event.getY() - r.y;
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + translatedX + "String_Node_Str"+ translatedY);
  if (renderer.isOverCheckBox(translatedX,translatedY)) {
    JCheckBox checkBox=account.getEnableCheckBox();
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + !checkBox.isSelected());
    checkBox.setSelected(!checkBox.isSelected());
    enableAccount(account,checkBox.isSelected());
    this.repaint();
  }
}
Program: 103621
Project: 103621
Buggy source:
/** 
 * Returns the renderer component for the cell given by all the parameters.
 * @param list the parent list
 * @param value the value of the cell
 * @param index the index of the cell
 * @param isSelected indicates if the cell is selected
 * @param cellHasFocus indicates if the cell has the focus
 * @return the component rendering the cell
 */
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  this.account=(Account)value;
  Icon accountIcon=account.getIcon();
  if (accountIcon != null)   accountLabel.setIcon(accountIcon);
  accountLabel.setText(account.getName());
  Icon statusIcon=account.getStatusIcon();
  if (statusIcon != null)   statusLabel.setIcon(statusIcon);
  String statusName=account.getStatusName();
  if (statusName != null)   statusLabel.setText(statusName);
  setEnabled(list.isEnabled());
  setFont(list.getFont());
  if (!account.isEnabled()) {
    accountLabel.setForeground(Color.GRAY);
    statusLabel.setForeground(Color.GRAY);
  }
 else {
    accountLabel.setForeground(Color.BLACK);
    statusLabel.setForeground(Color.BLACK);
  }
  this.index=index;
  this.isSelected=isSelected;
  this.setBounds(0,0,list.getWidth(),getPreferredSize().height);
  this.addCheckBox();
  return this;
}

Fixed version (ground truth):
/** 
 * Returns the renderer component for the cell given by all the parameters.
 * @param list the parent list
 * @param value the value of the cell
 * @param index the index of the cell
 * @param isSelected indicates if the cell is selected
 * @param cellHasFocus indicates if the cell has the focus
 * @return the component rendering the cell
 */
public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  this.account=(Account)value;
  Icon accountIcon=account.getIcon();
  if (accountIcon != null)   accountLabel.setIcon(accountIcon);
  accountLabel.setText(account.getName());
  Icon statusIcon=account.getStatusIcon();
  if (statusIcon != null)   statusLabel.setIcon(statusIcon);
  String statusName=account.getStatusName();
  if (statusName != null)   statusLabel.setText(statusName);
  setEnabled(list.isEnabled());
  setFont(list.getFont());
  if (!account.isEnabled()) {
    accountLabel.setForeground(Color.GRAY);
    statusLabel.setForeground(Color.GRAY);
  }
 else {
    accountLabel.setForeground(Color.BLACK);
    statusLabel.setForeground(Color.BLACK);
  }
  this.index=index;
  this.isSelected=isSelected;
  this.setBounds(0,0,list.getWidth(),getPreferredSize().height);
  this.addCheckBox(account);
  return this;
}
Program: 103622
Project: 103622
Buggy source:
/** 
 * Adds a check box component to this renderer.
 */
private void addCheckBox(){
  for (  Component c : getComponents()) {
    if (c instanceof JCheckBox)     remove(c);
  }
  final JCheckBox checkBox=new JCheckBox();
  checkBox.setBounds(5,5,45,45);
  constraints.anchor=GridBagConstraints.WEST;
  constraints.gridx=0;
  constraints.gridy=0;
  constraints.weightx=0f;
  add(checkBox,constraints);
  checkBox.setSelected(account.isEnabled());
}

Fixed version (ground truth):
/** 
 * Adds a check box component to this renderer.
 * @param account the account for which we're adding a check box
 */
private void addCheckBox(Account account){
  for (  Component c : getComponents()) {
    if (c instanceof JCheckBox)     remove(c);
  }
  JCheckBox checkBox=account.getEnableCheckBox();
  if (checkBox == null) {
    checkBox=new JCheckBox();
    account.setEnableCheckBox(checkBox);
  }
  constraints.anchor=GridBagConstraints.WEST;
  constraints.gridx=0;
  constraints.gridy=0;
  constraints.weightx=0f;
  add(checkBox,constraints);
  checkBox.setSelected(account.isEnabled());
}
Program: 103623
Project: 103623
Buggy source:
/** 
 * Creates an instance of the <tt>AudioConfigurationPanel</tt>.
 */
public AudioConfigurationPanel(){
  super(new BorderLayout());
  this.setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
  add(MediaConfiguration.createAudioConfigPanel(),BorderLayout.NORTH);
}

Fixed version (ground truth):
/** 
 * Creates an instance of the <tt>AudioConfigurationPanel</tt>.
 */
public AudioConfigurationPanel(){
  super(new BorderLayout());
  add(MediaConfiguration.createAudioConfigPanel(),BorderLayout.NORTH);
}
Program: 103625
Project: 103625
Buggy source:
/** 
 * Creates an instance of the <tt>VideoConfigurationPanel</tt>.
 */
public VideoConfigurationPanel(){
  super(new BorderLayout());
  this.setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
  add(MediaConfiguration.createVideoConfigPanel(),BorderLayout.NORTH);
}

Fixed version (ground truth):
/** 
 * Creates an instance of the <tt>VideoConfigurationPanel</tt>.
 */
public VideoConfigurationPanel(){
  super(new BorderLayout());
  add(MediaConfiguration.createVideoConfigPanel(),BorderLayout.NORTH);
}
Program: 103626
Project: 103626
Buggy source:
/** 
 * Disposes the chat window.
 * @param chatWindow the <tt>ChatWindow</tt> to dispose of
 */
private void disposeChatWindow(ChatWindow chatWindow){
  for (  ChatPanel chatPanel : chatPanels)   chatPanel.dispose();
synchronized (chatPanels) {
    chatPanels.clear();
  }
  if (chatWindow.getChatCount() > 0)   chatWindow.removeAllChats();
  GuiActivator.getUIService().unregisterExportedWindow(chatWindow);
  chatWindow.dispose();
  GuiActivator.getContactList().deactivateAll();
}

Fixed version (ground truth):
/** 
 * Disposes the chat window.
 * @param chatWindow the <tt>ChatWindow</tt> to dispose of
 */
private void disposeChatWindow(ChatWindow chatWindow){
  List<ChatPanel> chatPanelsToDispose=chatWindow.getChatPanels();
  for (  ChatPanel chatPanel : chatPanelsToDispose)   chatPanel.dispose();
synchronized (chatPanels) {
    chatPanels.removeAll(chatPanelsToDispose);
  }
  if (chatWindow.getChatCount() > 0)   chatWindow.removeAllChats();
  GuiActivator.getUIService().unregisterExportedWindow(chatWindow);
  chatWindow.dispose();
  GuiActivator.getContactList().deactivateAll();
}
Program: 103628
Project: 103628
Buggy source:
public void itemStateChanged(ItemEvent e){
  if (e.getStateChange() == ItemEvent.SELECTED) {
    if (DeviceConfiguration.AUDIO_SYSTEM_PORTAUDIO.equals(e.getItem())) {
      createPortAudioControls(portAudioPanel);
    }
 else {
      portAudioPanel.removeAll();
      portAudioPanel.revalidate();
      portAudioPanel.repaint();
    }
  }
}

Fixed version (ground truth):
public void itemStateChanged(ItemEvent e){
  if (e.getStateChange() == ItemEvent.SELECTED) {
    if (DeviceConfiguration.AUDIO_SYSTEM_PORTAUDIO.equals(e.getItem())) {
      createPortAudioControls(portAudioPanel);
    }
 else {
      portAudioPanel.removeAll();
    }
    portAudioPanel.revalidate();
    portAudioPanel.repaint();
  }
}
Program: 103630
Project: 103630
Buggy source:
/** 
 * Shows on the right the configuration form given by the given <tt>ConfigFormDescriptor</tt>.
 * @param configFormDescriptor the descriptor of the for we will be showing.
 */
public void showFormContent(ConfigFormDescriptor configFormDescriptor){
  this.centerPanel.removeAll();
  JComponent configFormPanel=(JComponent)configFormDescriptor.getConfigFormPanel();
  configFormPanel.setOpaque(false);
  centerPanel.add(configFormPanel,BorderLayout.CENTER);
  centerPanel.revalidate();
  centerPanel.setPreferredSize(new Dimension(550,configFormPanel.getPreferredSize().height));
  centerPanel.repaint();
  pack();
}

Fixed version (ground truth):
/** 
 * Shows on the right the configuration form given by the given <tt>ConfigFormDescriptor</tt>.
 * @param configFormDescriptor the descriptor of the for we will be showing.
 */
public void showFormContent(ConfigFormDescriptor configFormDescriptor){
  this.centerPanel.removeAll();
  JComponent configFormPanel=(JComponent)configFormDescriptor.getConfigFormPanel();
  configFormPanel.setOpaque(false);
  centerPanel.add(configFormPanel,BorderLayout.CENTER);
  centerPanel.revalidate();
  centerPanel.setPreferredSize(new Dimension(550,configFormPanel.getPreferredSize().height + 2 * BORDER_SIZE));
  pack();
}
Program: 103634
Project: 103634
Buggy source:
/** 
 * Compares the two formats for order. Returns a negative integer, zero, or a positive integer as the first format has been assigned a preference higher, equal to, or greater than the one of the second. <p>
 * @param enc1 the first format to compare for preference.
 * @param enc2 the second format to compare for preference.
 * @return a negative integer, zero, or a positive integer as the firstformat has been assigned a preference higher, equal to, or greater than the one of the second.
 */
private int compareEncodingPreferences(MediaFormat enc1,MediaFormat enc2){
  Integer pref1=encodingPreferences.get(enc1);
  int pref1IntValue=(pref1 == null) ? 0 : pref1;
  Integer pref2=encodingPreferences.get(enc2);
  int pref2IntValue=(pref2 == null) ? 0 : pref2;
  int res=pref2IntValue - pref1IntValue;
  if (res == 0)   return enc1.getEncoding().compareTo(enc2.getEncoding());
  return res;
}

Fixed version (ground truth):
/** 
 * Compares the two formats for order. Returns a negative integer, zero, or a positive integer as the first format has been assigned a preference higher, equal to, or greater than the one of the second.
 * @param enc1 the first format to compare for preference.
 * @param enc2 the second format to compare for preference
 * @return a negative integer, zero, or a positive integer as the firstformat has been assigned a preference higher, equal to, or greater than the one of the second
 */
private int compareEncodingPreferences(MediaFormat enc1,MediaFormat enc2){
  Integer pref1=encodingPreferences.get(enc1);
  int pref1IntValue=(pref1 == null) ? 0 : pref1;
  Integer pref2=encodingPreferences.get(enc2);
  int pref2IntValue=(pref2 == null) ? 0 : pref2;
  int res=pref2IntValue - pref1IntValue;
  if (res == 0) {
    res=enc1.getEncoding().compareTo(enc2.getEncoding());
  }
  return res;
}
Program: 103635
Project: 103635
Buggy source:
/** 
 * Schedules an update if necessary.
 */
private void updateContactListView(){
  String filterString=getText();
  FilterQuery filterQuery=null;
  if (filterString != null && filterString.length() > 0) {
    TreeContactList.searchFilter.setFilterString(filterString);
    filterQuery=GuiActivator.getContactList().applyFilter(TreeContactList.searchFilter);
  }
 else {
    filterQuery=GuiActivator.getContactList().applyDefaultFilter();
  }
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + filterString + "String_Node_Str"+ filterQuery);
  if (filterQuery != null && !filterQuery.isCanceled()) {
    if (filterQuery.isSucceeded())     enableUnknownContactView(false);
 else     filterQuery.setQueryListener(this);
  }
 else   enableUnknownContactView(GuiActivator.getContactList().isEmpty());
}

Fixed version (ground truth):
/** 
 * Schedules an update if necessary.
 */
private void updateContactListView(){
  String filterString=getText();
  FilterQuery filterQuery=null;
  boolean isDefaultFilter=false;
  if (filterString != null && filterString.length() > 0) {
    TreeContactList.searchFilter.setFilterString(filterString);
    filterQuery=GuiActivator.getContactList().applyFilter(TreeContactList.searchFilter);
  }
 else {
    filterQuery=GuiActivator.getContactList().applyDefaultFilter();
    isDefaultFilter=true;
  }
  if (filterQuery != null && !filterQuery.isCanceled()) {
    if (isDefaultFilter || filterQuery.isSucceeded())     enableUnknownContactView(false);
 else     filterQuery.setQueryListener(this);
  }
 else   enableUnknownContactView(GuiActivator.getContactList().isEmpty());
}
Program: 103637
Project: 103637
Buggy source:
/** 
 * Starts the transfer of media data from this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while starting the transfer ofmedia data from this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doStart()
 */
@Override protected void doStart() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  device.open();
  device.setDelegate(grabber);
  super.doStart();
}

Fixed version (ground truth):
/** 
 * Starts the transfer of media data from this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while starting the transfer ofmedia data from this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doStart()
 */
@Override protected void doStart() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  device.open();
  if (nativeFormat != null) {
    device.setFormat(nativeFormat);
  }
  device.setDelegate(grabber);
  super.doStart();
}
Program: 103638
Project: 103638
Buggy source:
/** 
 * Opens a connection to the media source specified by the <tt>MediaLocator</tt> of this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while opening the connectionto the media source specified by the <tt>MediaLocator</tt> of this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doConnect()
 */
@Override protected void doConnect() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  if (manager == null) {
    manager=DSManager.getInstance();
  }
  super.doConnect();
}

Fixed version (ground truth):
/** 
 * Opens a connection to the media source specified by the <tt>MediaLocator</tt> of this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while opening the connectionto the media source specified by the <tt>MediaLocator</tt> of this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doConnect()
 */
@Override protected void doConnect() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  if (manager == null) {
    manager=DSManager.getInstance();
    setLocator(getLocator());
  }
  super.doConnect();
}
Program: 103639
Project: 103639
Buggy source:
/** 
 * Create a new <tt>PushBufferStream</tt> which is to be at a specific zero-based index in the list of streams of this <tt>PushBufferDataSource</tt>. The <tt>Format</tt>-related information of the new instance is to be abstracted by a specific <tt>FormatControl</tt>.
 * @param streamIndex the zero-based index of the <tt>PushBufferStream</tt>in the list of streams of this <tt>PushBufferDataSource</tt>
 * @param formatControl the <tt>FormatControl</tt> which is to abstract the<tt>Format</tt>-related information of the new instance
 * @return a new <tt>PushBufferStream</tt> which is to be at the specified<tt>streamIndex</tt> in the list of streams of this <tt>PushBufferDataSource</tt> and which has its <tt>Format</tt>-related information abstracted by the specified <tt>formatControl</tt>
 * @see AbstractPushBufferCaptureDevice#createStream(int,FormatControl)
 */
protected AbstractPushBufferStream createStream(int streamIndex,FormatControl formatControl){
  DirectShowStream stream=new DirectShowStream(formatControl);
  device.setDelegate(stream.grabber);
  return stream;
}

Fixed version (ground truth):
/** 
 * Create a new <tt>PushBufferStream</tt> which is to be at a specific zero-based index in the list of streams of this <tt>PushBufferDataSource</tt>. The <tt>Format</tt>-related information of the new instance is to be abstracted by a specific <tt>FormatControl</tt>.
 * @param streamIndex the zero-based index of the <tt>PushBufferStream</tt>in the list of streams of this <tt>PushBufferDataSource</tt>
 * @param formatControl the <tt>FormatControl</tt> which is to abstract the<tt>Format</tt>-related information of the new instance
 * @return a new <tt>PushBufferStream</tt> which is to be at the specified<tt>streamIndex</tt> in the list of streams of this <tt>PushBufferDataSource</tt> and which has its <tt>Format</tt>-related information abstracted by the specified <tt>formatControl</tt>
 * @see AbstractPushBufferCaptureDevice#createStream(int,FormatControl)
 */
protected AbstractPushBufferStream createStream(int streamIndex,FormatControl formatControl){
  DirectShowStream stream=new DirectShowStream(formatControl);
  grabber=stream.grabber;
  return stream;
}
Program: 103640
Project: 103640
Buggy source:
/** 
 * Starts the transfer of media data from this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while starting the transfer ofmedia data from this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doStart()
 */
@Override protected void doStart() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  device.open();
  super.doStart();
}

Fixed version (ground truth):
/** 
 * Starts the transfer of media data from this <tt>DataSource</tt>.
 * @throws IOException if anything goes wrong while starting the transfer ofmedia data from this <tt>DataSource</tt>
 * @see AbstractPushBufferCaptureDevice#doStart()
 */
@Override protected void doStart() throws IOException {
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  device.open();
  device.setDelegate(grabber);
  super.doStart();
}
Program: 103641
Project: 103641
Buggy source:
/** 
 * Sets the <tt>MediaLocator</tt> which specifies the media source of this <tt>DataSource</tt>.
 * @param locator the <tt>MediaLocator</tt> which specifies the media sourceof this <tt>DataSource</tt>
 * @see DataSource#setLocator(MediaLocator)
 */
@Override public void setLocator(MediaLocator locator){
  DSCaptureDevice device=null;
  super.setLocator(locator);
  locator=getLocator();
  if ((locator != null) && DirectShowAuto.LOCATOR_PROTOCOL.equalsIgnoreCase(locator.getProtocol())) {
    DSCaptureDevice[] devices=manager.getCaptureDevices();
    for (int i=0; i < devices.length; i++) {
      if (devices[i].getName().equals(locator.getRemainder())) {
        device=devices[i];
        break;
      }
    }
  }
 else {
    device=null;
  }
  setDevice(device);
}

Fixed version (ground truth):
/** 
 * Sets the <tt>MediaLocator</tt> which specifies the media source of this <tt>DataSource</tt>.
 * @param locator the <tt>MediaLocator</tt> which specifies the media sourceof this <tt>DataSource</tt>
 * @see DataSource#setLocator(MediaLocator)
 */
@Override public void setLocator(MediaLocator locator){
  DSCaptureDevice device=null;
  if (getLocator() == null) {
    super.setLocator(locator);
  }
  locator=getLocator();
  if ((locator != null) && DirectShowAuto.LOCATOR_PROTOCOL.equalsIgnoreCase(locator.getProtocol())) {
    DSCaptureDevice[] devices=manager.getCaptureDevices();
    for (int i=0; i < devices.length; i++) {
      if (devices[i].getName().equals(locator.getRemainder())) {
        device=devices[i];
        break;
      }
    }
  }
 else {
    device=null;
  }
  setDevice(device);
}
Program: 103642
Project: 103642
Buggy source:
/** 
 * Connects and logins again to the server.
 * @param authReasonCode indicates the reason of the re-authentication.
 */
void reregister(int authReasonCode){
  try {
    logger.trace("String_Node_Str");
    this.unregister(false);
    this.abortConnecting=false;
    this.abortConnectingAndReconnect=false;
    connectAndLogin(authority,authReasonCode);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_INTERNAL_ERROR,null);
  }
catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    int reason=RegistrationStateChangeEvent.REASON_NOT_SPECIFIED;
    if (ex.getWrappedThrowable() instanceof UnknownHostException)     reason=RegistrationStateChangeEvent.REASON_SERVER_NOT_FOUND;
    fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,reason,null);
  }
}

Fixed version (ground truth):
/** 
 * Connects and logins again to the server.
 * @param authReasonCode indicates the reason of the re-authentication.
 */
void reregister(int authReasonCode){
  try {
    logger.trace("String_Node_Str");
    this.unregister(false);
    this.abortConnecting=false;
    connectAndLogin(authority,authReasonCode);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_INTERNAL_ERROR,null);
  }
catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    fireRegistrationStateChanged(ex);
  }
}
Program: 103643
Project: 103643
Buggy source:
/** 
 * Check whether a certificate is trusted, if not as user whether he trust it.
 * @param chain the certificate chain.
 * @param authType authentication type like: RSA.
 * @throws CertificateException not trusted.
 */
public void checkServerTrusted(X509Certificate[] chain,String authType) throws CertificateException {
  if (certChecked)   return;
  abortConnecting=true;
  try {
    certChecked=true;
    tm.checkServerTrusted(chain,authType);
  }
 catch (  CertificateException e) {
    fireRegistrationStateChanged(getRegistrationState(),RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_USER_REQUEST,"String_Node_Str");
    throw e;
  }
  if (abortConnecting) {
    abortConnectingAndReconnect=true;
    return;
  }
 else {
    new Thread(new Runnable(){
      public void run(){
        reregister(SecurityAuthority.CONNECTION_FAILED);
      }
    }
).start();
    return;
  }
}

Fixed version (ground truth):
/** 
 * Check whether a certificate is trusted, if not as user whether he trust it.
 * @param chain the certificate chain.
 * @param authType authentication type like: RSA.
 * @throws CertificateException not trusted.
 */
public void checkServerTrusted(X509Certificate[] chain,String authType) throws CertificateException {
  if (certChecked)   return;
  abortConnecting=true;
  try {
    certChecked=true;
    tm.checkServerTrusted(chain,authType);
  }
 catch (  CertificateException e) {
    fireRegistrationStateChanged(getRegistrationState(),RegistrationState.UNREGISTERED,RegistrationStateChangeEvent.REASON_USER_REQUEST,"String_Node_Str");
    throw e;
  }
  if (abortConnecting) {
    abortConnecting=false;
    return;
  }
 else {
    new Thread(new Runnable(){
      public void run(){
        reregister(SecurityAuthority.CONNECTION_FAILED);
      }
    }
).start();
    return;
  }
}
Program: 103644
Project: 103644
Buggy source:
/** 
 * Unregister and fire the event if requested
 * @param fireEvent boolean
 */
private void unregister(boolean fireEvent){
synchronized (initializationLock) {
    RegistrationState currRegState=getRegistrationState();
    if (connection != null)     connection.disconnect();
    if (fireEvent) {
      fireRegistrationStateChanged(currRegState,RegistrationState.UNREGISTERED,RegistrationStateChangeEvent.REASON_USER_REQUEST,null);
    }
  }
}

Fixed version (ground truth):
/** 
 * Unregister and fire the event if requested
 * @param fireEvent boolean
 */
private void unregister(boolean fireEvent){
synchronized (initializationLock) {
    RegistrationState currRegState=getRegistrationState();
    if (connection != null && connection.isConnected())     connection.disconnect();
    if (fireEvent) {
      fireRegistrationStateChanged(currRegState,RegistrationState.UNREGISTERED,RegistrationStateChangeEvent.REASON_USER_REQUEST,null);
    }
  }
}
Program: 103646
Project: 103646
Buggy source:
/** 
 * Starts the registration process. Connection details such as registration server, user name/number are provided through the configuration service through implementation specific properties.
 * @param authority the security authority that will be used for resolvingany security challenges that may be returned during the registration or at any moment while we're registered.
 * @throws OperationFailedException with the corresponding code it theregistration fails for some reason (e.g. a networking error or an implementation problem).
 */
public void register(final SecurityAuthority authority) throws OperationFailedException {
  if (authority == null)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  this.authority=authority;
  try {
    abortConnecting=false;
    abortConnectingAndReconnect=false;
    connectAndLogin(authority,SecurityAuthority.AUTHENTICATION_REQUIRED);
  }
 catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    int reason=RegistrationStateChangeEvent.REASON_NOT_SPECIFIED;
    RegistrationState regState=RegistrationState.UNREGISTERED;
    Throwable wrappedEx=ex.getWrappedThrowable();
    if (wrappedEx instanceof UnknownHostException || wrappedEx instanceof ConnectException) {
      reason=RegistrationStateChangeEvent.REASON_SERVER_NOT_FOUND;
      regState=RegistrationState.CONNECTION_FAILED;
    }
 else     if ((connection.getSASLAuthentication() != null && connection.getSASLAuthentication().isAuthenticated()) || !connection.isAuthenticated()) {
      JabberActivator.getProtocolProviderFactory().storePassword(getAccountID(),null);
      reason=RegistrationStateChangeEvent.REASON_AUTHENTICATION_FAILED;
      regState=RegistrationState.AUTHENTICATION_FAILED;
      reregister(SecurityAuthority.WRONG_PASSWORD);
    }
    fireRegistrationStateChanged(getRegistrationState(),regState,reason,null);
  }
}

Fixed version (ground truth):
/** 
 * Starts the registration process. Connection details such as registration server, user name/number are provided through the configuration service through implementation specific properties.
 * @param authority the security authority that will be used for resolvingany security challenges that may be returned during the registration or at any moment while we're registered.
 * @throws OperationFailedException with the corresponding code it theregistration fails for some reason (e.g. a networking error or an implementation problem).
 */
public void register(final SecurityAuthority authority) throws OperationFailedException {
  if (authority == null)   throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  this.authority=authority;
  try {
    abortConnecting=false;
    connectAndLogin(authority,SecurityAuthority.AUTHENTICATION_REQUIRED);
  }
 catch (  XMPPException ex) {
    logger.error("String_Node_Str",ex);
    fireRegistrationStateChanged(ex);
  }
}
Program: 103649
Project: 103649
Buggy source:
/** 
 * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle.
 * @param context The execution context of the bundle being stopped.
 * @throws Exception If this method throws an exception, the bundle isstill marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.
 */
public void stop(BundleContext context) throws Exception {
  dictProviderFactory.stop();
  dictPpFactoryServReg.unregister();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle.
 * @param context The execution context of the bundle being stopped.
 * @throws Exception If this method throws an exception, the bundle isstill marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.
 */
public void stop(BundleContext context) throws Exception {
  dictProviderFactory.stop();
  dictPpFactoryServReg.unregister();
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
}
Program: 103650
Project: 103650
Buggy source:
/** 
 * Called when this bundle is started. In here we'll export the dict ProtocolProviderFactory implementation so that it could be possible to register accounts with it in SIP Communicator.
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this bundle ismarked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.
 */
public void start(BundleContext context) throws Exception {
  bundleContext=context;
  Hashtable<String,String> hashtable=new Hashtable<String,String>();
  hashtable.put(ProtocolProviderFactory.PROTOCOL,ProtocolNames.DICT);
  dictProviderFactory=new ProtocolProviderFactoryDictImpl();
  dictPpFactoryServReg=context.registerService(ProtocolProviderFactory.class.getName(),dictProviderFactory,hashtable);
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called when this bundle is started. In here we'll export the dict ProtocolProviderFactory implementation so that it could be possible to register accounts with it in SIP Communicator.
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this bundle ismarked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.
 */
public void start(BundleContext context) throws Exception {
  bundleContext=context;
  Hashtable<String,String> hashtable=new Hashtable<String,String>();
  hashtable.put(ProtocolProviderFactory.PROTOCOL,ProtocolNames.DICT);
  dictProviderFactory=new ProtocolProviderFactoryDictImpl();
  dictPpFactoryServReg=context.registerService(ProtocolProviderFactory.class.getName(),dictProviderFactory,hashtable);
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
}
Program: 103651
Project: 103651
Buggy source:
/** 
 * The default constructor for the Dict protocol provider.
 */
public ProtocolProviderServiceDictImpl(){
  logger.trace("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * The default constructor for the Dict protocol provider.
 */
public ProtocolProviderServiceDictImpl(){
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str");
}
Program: 103652
Project: 103652
Buggy source:
/** 
 * Close the connection to the server 
 */
private void closeConnection(){
  try {
    this.dictConnection.close();
  }
 catch (  DictException dx) {
    logger.info(dx);
  }
}

Fixed version (ground truth):
/** 
 * Close the connection to the server 
 */
private void closeConnection(){
  try {
    this.dictConnection.close();
  }
 catch (  DictException dx) {
    if (logger.isInfoEnabled())     logger.info(dx);
  }
}
Program: 103653
Project: 103653
Buggy source:
/** 
 * Checks if the connection to the dict server is open
 * @return TRUE if the connection is open - FALSE otherwise
 */
private boolean connect(){
  if (this.dictConnection.isConnected()) {
    return true;
  }
  try {
    return this.dictConnection.isAvailable();
  }
 catch (  DictException dx) {
    logger.info(dx);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the connection to the dict server is open
 * @return TRUE if the connection is open - FALSE otherwise
 */
private boolean connect(){
  if (this.dictConnection.isConnected()) {
    return true;
  }
  try {
    return this.dictConnection.isAvailable();
  }
 catch (  DictException dx) {
    if (logger.isInfoEnabled())     logger.info(dx);
  }
  return false;
}
Program: 103654
Project: 103654
Buggy source:
/** 
 * Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.
 */
public void shutdown(){
  if (!isInitialized) {
    return;
  }
  logger.trace("String_Node_Str" + this.accountID.getUserID());
  closeConnection();
  if (isRegistered()) {
    try {
      unregister();
    }
 catch (    OperationFailedException ex) {
      logger.error("String_Node_Str" + getAccountID(),ex);
    }
  }
  isInitialized=false;
}

Fixed version (ground truth):
/** 
 * Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.
 */
public void shutdown(){
  if (!isInitialized) {
    return;
  }
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + this.accountID.getUserID());
  closeConnection();
  if (isRegistered()) {
    try {
      unregister();
    }
 catch (    OperationFailedException ex) {
      logger.error("String_Node_Str" + getAccountID(),ex);
    }
  }
  isInitialized=false;
}
Program: 103655
Project: 103655
Buggy source:
/** 
 * Adds <tt>callPeer</tt> to the list of peers in this call. If the call peer is already included in the call, the method has no effect.
 * @param callPeer the new <tt>CallPeer</tt>
 */
public void addCallPeer(final CallPeerGibberishImpl callPeer){
  if (callPeers.contains(callPeer))   return;
  callPeer.addCallPeerListener(this);
  this.callPeers.add(callPeer);
  logger.info("String_Node_Str");
  fireCallPeerEvent(callPeer,CallPeerEvent.CALL_PEER_ADDED);
  callPeer.setState(CallPeerState.ALERTING_REMOTE_SIDE,"String_Node_Str");
  Timer timer1=new Timer(false);
  timer1.schedule(new TimerTask(){
    @Override public void run(){
      callPeer.setState(CallPeerState.CONNECTED,"String_Node_Str");
    }
  }
,1500);
  final Random random=new Random();
  Timer timer=new Timer(false);
  timer.scheduleAtFixedRate(new TimerTask(){
    @Override public void run(){
      callPeer.fireStreamSoundLevelEvent(random.nextInt(255));
    }
  }
,1800,100);
}

Fixed version (ground truth):
/** 
 * Adds <tt>callPeer</tt> to the list of peers in this call. If the call peer is already included in the call, the method has no effect.
 * @param callPeer the new <tt>CallPeer</tt>
 */
public void addCallPeer(final CallPeerGibberishImpl callPeer){
  if (callPeers.contains(callPeer))   return;
  callPeer.addCallPeerListener(this);
  this.callPeers.add(callPeer);
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  fireCallPeerEvent(callPeer,CallPeerEvent.CALL_PEER_ADDED);
  callPeer.setState(CallPeerState.ALERTING_REMOTE_SIDE,"String_Node_Str");
  Timer timer1=new Timer(false);
  timer1.schedule(new TimerTask(){
    @Override public void run(){
      callPeer.setState(CallPeerState.CONNECTED,"String_Node_Str");
    }
  }
,1500);
  final Random random=new Random();
  Timer timer=new Timer(false);
  timer.scheduleAtFixedRate(new TimerTask(){
    @Override public void run(){
      callPeer.fireStreamSoundLevelEvent(random.nextInt(255));
    }
  }
,1800,100);
}
Program: 103656
Project: 103656
Buggy source:
/** 
 * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle.
 * @param context The execution context of the bundle being stopped.
 * @throws Exception If this method throws an exception, the bundle isstill marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.
 */
public void stop(BundleContext context) throws Exception {
  gibberishProviderFactory.stop();
  gibberishPpFactoryServReg.unregister();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle.
 * @param context The execution context of the bundle being stopped.
 * @throws Exception If this method throws an exception, the bundle isstill marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.
 */
public void stop(BundleContext context) throws Exception {
  gibberishProviderFactory.stop();
  gibberishPpFactoryServReg.unregister();
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
}
Program: 103657
Project: 103657
Buggy source:
/** 
 * Called when this bundle is started. In here we'll export the gibberish ProtocolProviderFactory implementation so that it could be possible to register accounts with it in SIP Communicator.
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this bundle ismarked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.
 */
public void start(BundleContext context) throws Exception {
  GibberishActivator.bundleContext=context;
  Hashtable<String,String> hashtable=new Hashtable<String,String>();
  hashtable.put(ProtocolProviderFactory.PROTOCOL,"String_Node_Str");
  gibberishProviderFactory=new ProtocolProviderFactoryGibberishImpl();
  gibberishPpFactoryServReg=context.registerService(ProtocolProviderFactory.class.getName(),gibberishProviderFactory,hashtable);
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called when this bundle is started. In here we'll export the gibberish ProtocolProviderFactory implementation so that it could be possible to register accounts with it in SIP Communicator.
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this bundle ismarked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.
 */
public void start(BundleContext context) throws Exception {
  GibberishActivator.bundleContext=context;
  Hashtable<String,String> hashtable=new Hashtable<String,String>();
  hashtable.put(ProtocolProviderFactory.PROTOCOL,"String_Node_Str");
  gibberishProviderFactory=new ProtocolProviderFactoryGibberishImpl();
  gibberishPpFactoryServReg=context.registerService(ProtocolProviderFactory.class.getName(),gibberishProviderFactory,hashtable);
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
}
Program: 103658
Project: 103658
Buggy source:
/** 
 * Indicates a user request to end a call with the specified call particiapnt.
 * @param peer the peer that we'd like to hang up on.
 * @throws OperationFailedException with the corresponding code if weencounter an error while performing this operation.
 */
public void hangupCallPeer(CallPeer peer) throws OperationFailedException {
  if (peer.getState().equals(CallPeerState.DISCONNECTED)) {
    logger.debug("String_Node_Str" + "String_Node_Str");
    return;
  }
  CallPeerGibberishImpl callPeer=(CallPeerGibberishImpl)peer;
  logger.info("String_Node_Str");
  callPeer.setState(CallPeerState.DISCONNECTED,null);
  CallGibberishImpl call=(CallGibberishImpl)callPeer.getCall();
  call.removeCallPeer(callPeer);
}

Fixed version (ground truth):
/** 
 * Indicates a user request to end a call with the specified call particiapnt.
 * @param peer the peer that we'd like to hang up on.
 * @throws OperationFailedException with the corresponding code if weencounter an error while performing this operation.
 */
public void hangupCallPeer(CallPeer peer) throws OperationFailedException {
  if (peer.getState().equals(CallPeerState.DISCONNECTED)) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + "String_Node_Str");
    return;
  }
  CallPeerGibberishImpl callPeer=(CallPeerGibberishImpl)peer;
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  callPeer.setState(CallPeerState.DISCONNECTED,null);
  CallGibberishImpl call=(CallGibberishImpl)callPeer.getCall();
  call.removeCallPeer(callPeer);
}
Program: 103659
Project: 103659
Buggy source:
/** 
 * Indicates a user request to answer an incoming call from the specified CallPeer.
 * @param peer the call peer that we'd like to answer.
 * @throws OperationFailedException with the corresponding code if weencounter an error while performing this operation.
 */
public void answerCallPeer(CallPeer peer) throws OperationFailedException {
  CallPeerGibberishImpl callPeer=(CallPeerGibberishImpl)peer;
  if (peer.getState().equals(CallPeerState.CONNECTED)) {
    logger.info("String_Node_Str" + "String_Node_Str" + peer);
    return;
  }
  callPeer.setState(CallPeerState.CONNECTED,null);
}

Fixed version (ground truth):
/** 
 * Indicates a user request to answer an incoming call from the specified CallPeer.
 * @param peer the call peer that we'd like to answer.
 * @throws OperationFailedException with the corresponding code if weencounter an error while performing this operation.
 */
public void answerCallPeer(CallPeer peer) throws OperationFailedException {
  CallPeerGibberishImpl callPeer=(CallPeerGibberishImpl)peer;
  if (peer.getState().equals(CallPeerState.CONNECTED)) {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str" + "String_Node_Str" + peer);
    return;
  }
  callPeer.setState(CallPeerState.CONNECTED,null);
}
Program: 103660
Project: 103660
Buggy source:
public void callStateChanged(CallChangeEvent evt){
  if (evt.getEventType().equals(CallChangeEvent.CALL_STATE_CHANGE) && ((CallState)evt.getNewValue()).equals(CallState.CALL_ENDED)) {
    CallGibberishImpl sourceCall=(CallGibberishImpl)this.activeCalls.remove(evt.getSourceCall().getCallID());
    logger.trace("String_Node_Str" + sourceCall + "String_Node_Str"+ "String_Node_Str");
    fireCallEvent(CallEvent.CALL_ENDED,sourceCall);
  }
}

Fixed version (ground truth):
public void callStateChanged(CallChangeEvent evt){
  if (evt.getEventType().equals(CallChangeEvent.CALL_STATE_CHANGE) && ((CallState)evt.getNewValue()).equals(CallState.CALL_ENDED)) {
    CallGibberishImpl sourceCall=(CallGibberishImpl)this.activeCalls.remove(evt.getSourceCall().getCallID());
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + sourceCall + "String_Node_Str"+ "String_Node_Str");
    fireCallEvent(CallEvent.CALL_ENDED,sourceCall);
  }
}
Program: 103661
Project: 103661
Buggy source:
public void callStateChanged(CallChangeEvent evt){
  if (evt.getEventType().equals(CallChangeEvent.CALL_STATE_CHANGE) && ((CallState)evt.getNewValue()).equals(CallState.CALL_ENDED)) {
    CallGibberishImpl sourceCall=(CallGibberishImpl)this.activeCalls.remove(evt.getSourceCall().getCallID());
    logger.trace("String_Node_Str" + sourceCall + "String_Node_Str"+ "String_Node_Str");
    telephonyOpSet.fireCallEvent(CallEvent.CALL_ENDED,sourceCall);
  }
}

Fixed version (ground truth):
public void callStateChanged(CallChangeEvent evt){
  if (evt.getEventType().equals(CallChangeEvent.CALL_STATE_CHANGE) && ((CallState)evt.getNewValue()).equals(CallState.CALL_ENDED)) {
    CallGibberishImpl sourceCall=(CallGibberishImpl)this.activeCalls.remove(evt.getSourceCall().getCallID());
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + sourceCall + "String_Node_Str"+ "String_Node_Str");
    telephonyOpSet.fireCallEvent(CallEvent.CALL_ENDED,sourceCall);
  }
}
Program: 103662
Project: 103662
Buggy source:
/** 
 * The default constructor for the Gibberish protocol provider.
 */
public ProtocolProviderServiceGibberishImpl(){
  logger.trace("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * The default constructor for the Gibberish protocol provider.
 */
public ProtocolProviderServiceGibberishImpl(){
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str");
}
Program: 103663
Project: 103663
Buggy source:
/** 
 * Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.
 */
public void shutdown(){
  if (!isInitialized) {
    return;
  }
  logger.trace("String_Node_Str");
  if (isRegistered()) {
    try {
      unregister();
    }
 catch (    OperationFailedException ex) {
      logger.error("String_Node_Str" + getAccountID(),ex);
    }
  }
  isInitialized=false;
}

Fixed version (ground truth):
/** 
 * Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.
 */
public void shutdown(){
  if (!isInitialized) {
    return;
  }
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str");
  if (isRegistered()) {
    try {
      unregister();
    }
 catch (    OperationFailedException ex) {
      logger.error("String_Node_Str" + getAccountID(),ex);
    }
  }
  isInitialized=false;
}
Program: 103664
Project: 103664
Buggy source:
public void handleStateChange(ChatRoomSession chatRoomSession,ChatSessionState oldChatSessionState,ChatSessionState newChatSessionState){
  logger.debug("String_Node_Str" + newChatSessionState);
  if (chatInvitation == null && newChatSessionState.equals(ChatSessionState.INROOM)) {
    try {
      chatRoom.join();
    }
 catch (    Exception e) {
      logger.debug("String_Node_Str" + e);
    }
  }
  if (inviteUserList != null && newChatSessionState.equals(ChatSessionState.INROOM)) {
    Iterator<Map.Entry<String,String>> invitesIter=inviteUserList.entrySet().iterator();
    while (invitesIter.hasNext()) {
      Map.Entry<String,String> entry=invitesIter.next();
      chatRoom.invite(entry.getKey(),entry.getValue());
    }
  }
  if (newChatSessionState.equals(ChatSessionState.CLOSED) || newChatSessionState.equals(ChatSessionState.FAILED)) {
    updateMemberList(chatRoomSession.getUsers(),true);
  }
}

Fixed version (ground truth):
public void handleStateChange(ChatRoomSession chatRoomSession,ChatSessionState oldChatSessionState,ChatSessionState newChatSessionState){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + newChatSessionState);
  if (chatInvitation == null && newChatSessionState.equals(ChatSessionState.INROOM)) {
    try {
      chatRoom.join();
    }
 catch (    Exception e) {
      if (logger.isDebugEnabled())       logger.debug("String_Node_Str" + e);
    }
  }
  if (inviteUserList != null && newChatSessionState.equals(ChatSessionState.INROOM)) {
    Iterator<Map.Entry<String,String>> invitesIter=inviteUserList.entrySet().iterator();
    while (invitesIter.hasNext()) {
      Map.Entry<String,String> entry=invitesIter.next();
      chatRoom.invite(entry.getKey(),entry.getValue());
    }
  }
  if (newChatSessionState.equals(ChatSessionState.CLOSED) || newChatSessionState.equals(ChatSessionState.FAILED)) {
    updateMemberList(chatRoomSession.getUsers(),true);
  }
}