nus-yam/ex-repair huggingface dataset:
Program: 103403
Project: 103403
Buggy source:
/** 
 * Shows/hides the local video component.
 * @param isVisible <tt>true</tt> to show the local video, <tt>false</tt> -otherwise
 */
public void setLocalVideoVisible(boolean isVisible){
synchronized (videoContainers) {
    this.localVideoVisible=isVisible;
    if (isVisible != callRenderer.getCallContainer().isShowHideVideoButtonSelected()) {
      callRenderer.getCallContainer().setShowHideVideoButtonSelected(isVisible);
    }
    int videoContainerCount;
    if ((videoTelephony != null) && ((videoContainerCount=videoContainers.size()) > 0)) {
      Container videoContainer=videoContainers.get(videoContainerCount - 1);
      if (localVideo != null) {
        if (isVisible) {
          Container localVideoParent=localVideo.getParent();
          if (localVideoParent != null)           localVideoParent.remove(localVideo);
          Container closeButtonParent=closeButton.getParent();
          if (closeButtonParent != null)           closeButtonParent.remove(closeButton);
          videoContainer.add(localVideo,VideoLayout.LOCAL);
          videoContainer.add(closeButton,VideoLayout.CLOSE_LOCAL_BUTTON);
        }
 else {
          videoContainer.remove(localVideo);
          videoContainer.remove(closeButton);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Shows/hides the local video component.
 * @param isVisible <tt>true</tt> to show the local video, <tt>false</tt> -otherwise
 */
public void setLocalVideoVisible(boolean isVisible){
synchronized (videoContainers) {
    this.localVideoVisible=isVisible;
    if (isVisible != callRenderer.getCallContainer().isShowHideVideoButtonSelected()) {
      callRenderer.getCallContainer().setShowHideVideoButtonSelected(isVisible);
    }
    int videoContainerCount;
    if ((videoTelephony != null) && ((videoContainerCount=videoContainers.size()) > 0)) {
      Container videoContainer=videoContainers.get(videoContainerCount - 1);
      if (localVideo != null) {
        if (isVisible) {
          Container localVideoParent=localVideo.getParent();
          if (localVideoParent != null)           localVideoParent.remove(localVideo);
          Container closeButtonParent=closeButton.getParent();
          if (closeButtonParent != null)           closeButtonParent.remove(closeButton);
          videoContainer.add(localVideo,VideoLayout.LOCAL);
          videoContainer.add(closeButton,VideoLayout.CLOSE_LOCAL_BUTTON);
        }
 else {
          videoContainer.remove(localVideo);
          videoContainer.remove(closeButton);
        }
        videoContainer.validate();
        videoContainer.repaint();
      }
    }
  }
}
Program: 103405
Project: 103405
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 (ItemEvent.SELECTED == e.getStateChange()) {
    if (DeviceConfiguration.AUDIO_SYSTEM_PORTAUDIO.equals(e.getItem())) {
      createPortAudioControls(portAudioPanel);
    }
 else {
      portAudioPanel.removeAll();
    }
    portAudioPanel.revalidate();
    portAudioPanel.repaint();
  }
}
Program: 103406
Project: 103406
Buggy source:
public void hierarchyChanged(HierarchyEvent event){
  if (((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) && comboBox.isDisplayable()) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        comboBoxListener.actionPerformed(null);
      }
    }
);
  }
 else {
    if (!comboBox.isDisplayable())     videoDeviceInPreview=null;
  }
}

Fixed version (ground truth):
public void hierarchyChanged(HierarchyEvent event){
  if ((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) == 0)   return;
  if (comboBox.isDisplayable()) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        comboBoxListener.actionPerformed(null);
      }
    }
);
    if (windowListener == null) {
      window=SwingUtilities.windowForComponent(comboBox);
      if (window != null) {
        windowListener=new WindowAdapter(){
          @Override public void windowClosing(          WindowEvent event){
            dispose();
          }
        }
;
        window.addWindowListener(windowListener);
      }
    }
  }
 else {
    dispose();
  }
}
Program: 103408
Project: 103408
Buggy source:
@Override public void componentResized(ComponentEvent e){
  processLightweightComponentEvent();
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent e){
}
Program: 103409
Project: 103409
Buggy source:
/** 
 * Dispatches <tt>MouseEvent</tt>s to whatever is underneath this <tt>SwingVideoComponentCanvas</tt> because it only renders <tt>Component</tt>s i.e. it is like a "glass pane".
 */
private boolean dispatchMouseEvent(MouseEvent e){
  Component srcc=e.getComponent();
  if (srcc != null) {
    Container parent=getParent();
    if (parent != null) {
      Point parentPoint=SwingUtilities.convertPoint(srcc,e.getPoint(),parent);
      Component dstc=getComponentAt(parent,parentPoint);
      if (dstc != null) {
        dstc.dispatchEvent(SwingUtilities.convertMouseEvent(srcc,e,dstc));
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Dispatches <tt>MouseEvent</tt>s to whatever is underneath this <tt>SwingVideoComponentCanvas</tt> because it only renders <tt>Component</tt>s i.e. it is like a "glass pane".
 */
private boolean dispatchMouseEvent(MouseEvent e){
  Component srcc=e.getComponent();
  if (srcc != null) {
    int id=e.getID();
    Component dstc=null;
    if (MouseEvent.MOUSE_PRESSED == id)     mousePressedComponent=null;
 else     if (mousePressedComponent != null) {
      dstc=mousePressedComponent;
      if ((MouseEvent.MOUSE_CLICKED == id) || (MouseEvent.MOUSE_RELEASED == id))       mousePressedComponent=null;
    }
    if (dstc == null) {
      Container parent=getParent();
      if (parent != null) {
        Point parentPoint=SwingUtilities.convertPoint(srcc,e.getPoint(),parent);
        dstc=getComponentAt(parent,parentPoint);
      }
    }
    if (dstc != null) {
      if (MouseEvent.MOUSE_PRESSED == id)       mousePressedComponent=dstc;
      dstc.dispatchEvent(SwingUtilities.convertMouseEvent(srcc,e,dstc));
      return true;
    }
  }
  return false;
}
Program: 103410
Project: 103410
Buggy source:
public void componentRemoved(ContainerEvent e){
  Component c=e.getChild();
  if (!(c instanceof AWTVideoComponent) && !(c instanceof SwingVideoComponent)) {
    nonVideoComponentRemoved(c);
  }
 else   if (SwingVideoComponentCanvas.this.equals(c))   removeAllNonVideoComponents();
}

Fixed version (ground truth):
public void componentRemoved(ContainerEvent e){
  Component c=e.getChild();
  if (mousePressedComponent == c)   mousePressedComponent=null;
  if (!(c instanceof AWTVideoComponent) && !(c instanceof SwingVideoComponent)) {
    nonVideoComponentRemoved(c);
  }
 else   if (SwingVideoComponentCanvas.this.equals(c))   removeAllNonVideoComponents();
}
Program: 103411
Project: 103411
Buggy source:
@Override public void removeNotify(){
  if (parent != null) {
    parent.removeContainerListener(parentContainerListener);
    removeAllNonVideoComponents();
    parent=null;
  }
synchronized (getHandleLock()) {
    long handle=getHandle();
    if (handle != 0) {
      try {
        close(handle,this);
      }
  finally {
        this.handle=0;
      }
    }
  }
  super.removeNotify();
}

Fixed version (ground truth):
@Override public void removeNotify(){
  mousePressedComponent=null;
  if (parent != null) {
    parent.removeContainerListener(parentContainerListener);
    removeAllNonVideoComponents();
    parent=null;
  }
synchronized (getHandleLock()) {
    long handle=getHandle();
    if (handle != 0) {
      try {
        close(handle,this);
      }
  finally {
        this.handle=0;
      }
    }
  }
  super.removeNotify();
}
Program: 103412
Project: 103412
Buggy source:
/** 
 * Returns the media type (e.g. audio or video) for the specified media <tt>description</tt>.
 * @param description the <tt>MediaDescription</tt> whose media type we'dlike to extract.
 * @return the media type (e.g. audio or video) for the specified media<tt>description</tt>.
 */
public static MediaType getMediaType(MediaDescription description){
  try {
    return MediaType.parseString(description.getMedia().getMediaType());
  }
 catch (  SdpException exc) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + description,exc);
    throw new IllegalArgumentException("String_Node_Str" + description,exc);
  }
}

Fixed version (ground truth):
/** 
 * Returns the media type (e.g. audio or video) for the specified media <tt>description</tt>.
 * @param description the <tt>MediaDescription</tt> whose media type we'dlike to extract.
 * @return the media type (e.g. audio or video) for the specified media<tt>description</tt>.
 * @throws IllegalArgumentException if <tt>description</tt> does notcontain a known media type.
 */
public static MediaType getMediaType(MediaDescription description) throws IllegalArgumentException {
  try {
    return MediaType.parseString(description.getMedia().getMediaType());
  }
 catch (  SdpException exc) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + description,exc);
    throw new IllegalArgumentException("String_Node_Str" + description,exc);
  }
}
Program: 103414
Project: 103414
Buggy source:
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @param device video device that will be used to stream desktop.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee,MediaDevice device) throws OperationFailedException {
  CallJabberImpl call=(CallJabberImpl)super.createVideoCall(callee,device);
  CallPeerJabberImpl callPeer=call.getCallPeers().next();
  callPeer.addCallPeerListener(callPeerListener);
  size=(((VideoMediaFormat)call.getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=null;
  return call;
}

Fixed version (ground truth):
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @param device video device that will be used to stream desktop.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee,MediaDevice device) throws OperationFailedException {
  CallJabberImpl call=(CallJabberImpl)super.createVideoCall(callee,device);
  CallPeerJabberImpl callPeer=call.getCallPeers().next();
  callPeer.addCallPeerListener(callPeerListener);
  size=(((VideoMediaFormat)call.getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=getOriginForMediaDevice(device);
  return call;
}
Program: 103415
Project: 103415
Buggy source:
/** 
 * Check if the remote part supports Jingle video.
 * @param calleeAddress Contact address
 * @param videoDevice <tt>MediaDevice</tt> used
 * @return true if contact support Jingle video, false otherwise
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
protected Call createOutgoingVideoCall(String calleeAddress,MediaDevice videoDevice) throws OperationFailedException {
  if (parentProvider.getConnection() == null) {
    throw new OperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.INTERNAL_ERROR);
  }
  CallJabberImpl call=new CallJabberImpl(basicTelephony);
  call.setVideoDevice(videoDevice);
  call.setLocalVideoAllowed(true,getMediaUseCase());
  basicTelephony.createOutgoingCall(call,calleeAddress);
  origin=null;
  return call;
}

Fixed version (ground truth):
/** 
 * Check if the remote part supports Jingle video.
 * @param calleeAddress Contact address
 * @param videoDevice <tt>MediaDevice</tt> used
 * @return true if contact support Jingle video, false otherwise
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
protected Call createOutgoingVideoCall(String calleeAddress,MediaDevice videoDevice) throws OperationFailedException {
  if (parentProvider.getConnection() == null) {
    throw new OperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.INTERNAL_ERROR);
  }
  CallJabberImpl call=new CallJabberImpl(basicTelephony);
  call.setVideoDevice(videoDevice);
  call.setLocalVideoAllowed(true,getMediaUseCase());
  basicTelephony.createOutgoingCall(call,calleeAddress);
  origin=getOriginForMediaDevice(videoDevice);
  return call;
}
Program: 103416
Project: 103416
Buggy source:
/** 
 * Sets the indicator which determines whether the streaming of local video in a specific <tt>Call</tt> is allowed. The setting does not reflect the availability of actual video capture devices, it just expresses the desire of the user to have the local video streamed in the case the system is actually able to do so.
 * @param call the <tt>Call</tt> to allow/disallow the streaming of localvideo for
 * @param mediaDevice the media device to use for the desktop streaming
 * @param allowed <tt>true</tt> to allow the streaming of local video forthe specified <tt>Call</tt>; <tt>false</tt> to disallow it
 * @throws OperationFailedException if initializing local video fails.
 */
public void setLocalVideoAllowed(Call call,MediaDevice mediaDevice,boolean allowed) throws OperationFailedException {
  ((CallJabberImpl)call).setLocalVideoAllowed(allowed,MediaUseCase.DESKTOP);
  ((CallJabberImpl)call).setVideoDevice(mediaDevice);
  size=((VideoMediaFormat)mediaDevice.getFormat()).getSize();
  ((CallJabberImpl)call).modifyVideoContent(allowed);
  origin=null;
}

Fixed version (ground truth):
/** 
 * Sets the indicator which determines whether the streaming of local video in a specific <tt>Call</tt> is allowed. The setting does not reflect the availability of actual video capture devices, it just expresses the desire of the user to have the local video streamed in the case the system is actually able to do so.
 * @param call the <tt>Call</tt> to allow/disallow the streaming of localvideo for
 * @param mediaDevice the media device to use for the desktop streaming
 * @param allowed <tt>true</tt> to allow the streaming of local video forthe specified <tt>Call</tt>; <tt>false</tt> to disallow it
 * @throws OperationFailedException if initializing local video fails.
 */
public void setLocalVideoAllowed(Call call,MediaDevice mediaDevice,boolean allowed) throws OperationFailedException {
  ((CallJabberImpl)call).setLocalVideoAllowed(allowed,MediaUseCase.DESKTOP);
  ((CallJabberImpl)call).setVideoDevice(mediaDevice);
  size=((VideoMediaFormat)mediaDevice.getFormat()).getSize();
  ((CallJabberImpl)call).modifyVideoContent(allowed);
  origin=getOriginForMediaDevice(mediaDevice);
}
Program: 103417
Project: 103417
Buggy source:
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee) throws OperationFailedException {
  Call call=createOutgoingVideoCall(callee.getAddress());
  size=(((VideoMediaFormat)((CallJabberImpl)call).getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=null;
  return call;
}

Fixed version (ground truth):
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee) throws OperationFailedException {
  Call call=createOutgoingVideoCall(callee.getAddress());
  MediaDevice device=((CallJabberImpl)call).getDefaultDevice(MediaType.VIDEO);
  size=(((VideoMediaFormat)device.getFormat()).getSize());
  origin=getOriginForMediaDevice(device);
  return call;
}
Program: 103418
Project: 103418
Buggy source:
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @param device <tt>MediaDevice</tt> to use for this call
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee,MediaDevice device) throws OperationFailedException {
  CallSipImpl call=(CallSipImpl)super.createVideoCall(callee,device);
  CallPeerSipImpl callPeer=call.getCallPeers().next();
  callPeer.addMethodProcessorListener(this);
  callPeer.addCallPeerListener(callPeerListener);
  size=(((VideoMediaFormat)call.getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=null;
  return call;
}

Fixed version (ground truth):
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @param device <tt>MediaDevice</tt> to use for this call
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee,MediaDevice device) throws OperationFailedException {
  CallSipImpl call=(CallSipImpl)super.createVideoCall(callee,device);
  CallPeerSipImpl callPeer=call.getCallPeers().next();
  callPeer.addMethodProcessorListener(this);
  callPeer.addCallPeerListener(callPeerListener);
  size=(((VideoMediaFormat)call.getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=getOriginForMediaDevice(device);
  return call;
}
Program: 103419
Project: 103419
Buggy source:
/** 
 * Sets the indicator which determines whether the streaming of local video in a specific <tt>Call</tt> is allowed. The setting does not reflect the availability of actual video capture devices, it just expresses the desire of the user to have the local video streamed in the case the system is actually able to do so.
 * @param call the <tt>Call</tt> to allow/disallow the streaming of localvideo for
 * @param mediaDevice the media device to use for the desktop streaming
 * @param allowed <tt>true</tt> to allow the streaming of local video forthe specified <tt>Call</tt>; <tt>false</tt> to disallow it
 * @throws OperationFailedException if initializing local video fails.
 */
public void setLocalVideoAllowed(Call call,MediaDevice mediaDevice,boolean allowed) throws OperationFailedException {
  ((CallSipImpl)call).setVideoDevice(mediaDevice);
  ((CallSipImpl)call).setLocalVideoAllowed(allowed,MediaUseCase.DESKTOP);
  size=(((VideoMediaFormat)((CallSipImpl)call).getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=null;
  ((CallSipImpl)call).reInvite();
}

Fixed version (ground truth):
/** 
 * Sets the indicator which determines whether the streaming of local video in a specific <tt>Call</tt> is allowed. The setting does not reflect the availability of actual video capture devices, it just expresses the desire of the user to have the local video streamed in the case the system is actually able to do so.
 * @param call the <tt>Call</tt> to allow/disallow the streaming of localvideo for
 * @param mediaDevice the media device to use for the desktop streaming
 * @param allowed <tt>true</tt> to allow the streaming of local video forthe specified <tt>Call</tt>; <tt>false</tt> to disallow it
 * @throws OperationFailedException if initializing local video fails.
 */
public void setLocalVideoAllowed(Call call,MediaDevice mediaDevice,boolean allowed) throws OperationFailedException {
  ((CallSipImpl)call).setVideoDevice(mediaDevice);
  ((CallSipImpl)call).setLocalVideoAllowed(allowed,MediaUseCase.DESKTOP);
  size=(((VideoMediaFormat)((CallSipImpl)call).getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=getOriginForMediaDevice(mediaDevice);
  ((CallSipImpl)call).reInvite();
}
Program: 103420
Project: 103420
Buggy source:
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee) throws OperationFailedException {
  Call call=super.createVideoCall(callee);
  size=(((VideoMediaFormat)((CallSipImpl)call).getDefaultDevice(MediaType.VIDEO).getFormat()).getSize());
  origin=null;
  return call;
}

Fixed version (ground truth):
/** 
 * Create a new video call and invite the specified CallPeer to it.
 * @param callee the address of the callee that we should invite to a newcall.
 * @return CallPeer the CallPeer that will represented by thespecified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
 * @throws OperationFailedException with the corresponding code if we failto create the video call.
 */
@Override public Call createVideoCall(Contact callee) throws OperationFailedException {
  Call call=super.createVideoCall(callee);
  MediaDevice device=((CallSipImpl)call).getDefaultDevice(MediaType.VIDEO);
  size=(((VideoMediaFormat)device.getFormat()).getSize());
  origin=getOriginForMediaDevice(device);
  return call;
}
Program: 103424
Project: 103424
Buggy source:
/** 
 * Move origin of a partial desktop streaming <tt>MediaDevice</tt>.
 * @param mediaDevice desktop streaming <tt>MediaDevice</tt> obtained bygetMediaDeviceForPartialDesktopStreaming() method.
 * @param x new x coordinate origin
 * @param y new y coordinate origin
 */
public void movePartialDesktopStreaming(MediaDevice mediaDevice,int x,int y){
  MediaDeviceImpl dev=(MediaDeviceImpl)mediaDevice;
  if (!dev.getCaptureDeviceInfo().getLocator().getProtocol().equals(ImageStreamingAuto.LOCATOR_PROTOCOL)) {
    return;
  }
  VideoMediaDeviceSession session=(VideoMediaDeviceSession)dev.getSession();
  DataSource ds=session.getCaptureDevice();
  if (ds instanceof MutePullBufferDataSource) {
    MutePullBufferDataSource ds2=(MutePullBufferDataSource)ds;
    ds=ds2.getWrappedDataSource();
  }
  ScreenDevice screen=getScreenForPoint(new Point(x,y));
  ScreenDevice currentScreen=screen;
  if (x < 0) {
    x+=screen.getSize().width;
  }
 else   if (x > screen.getSize().width) {
    List<ScreenDevice> devs=getAvailableScreenDevices();
    if (screen.getIndex() > 0) {
      screen=devs.get(screen.getIndex() - 1);
    }
    x-=screen.getSize().width;
  }
  if (y < 0) {
    y+=screen.getSize().height;
  }
 else   if (y > screen.getSize().height) {
    List<ScreenDevice> devs=getAvailableScreenDevices();
    if (screen.getIndex() > 0) {
      screen=devs.get(screen.getIndex() - 1);
    }
    y-=screen.getSize().height;
  }
  ((net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.DataSource)ds).setOrigin(0,currentScreen.getIndex(),x,y);
}

Fixed version (ground truth):
/** 
 * Move origin of a partial desktop streaming <tt>MediaDevice</tt>.
 * @param mediaDevice desktop streaming <tt>MediaDevice</tt> obtained bygetMediaDeviceForPartialDesktopStreaming() method.
 * @param x new x coordinate origin
 * @param y new y coordinate origin
 */
public void movePartialDesktopStreaming(MediaDevice mediaDevice,int x,int y){
  MediaDeviceImpl dev=(MediaDeviceImpl)mediaDevice;
  if (!dev.getCaptureDeviceInfo().getLocator().getProtocol().equals(ImageStreamingAuto.LOCATOR_PROTOCOL)) {
    return;
  }
  VideoMediaDeviceSession session=(VideoMediaDeviceSession)dev.getSession();
  DataSource ds=session.getCaptureDevice();
  if (ds instanceof MutePullBufferDataSource) {
    MutePullBufferDataSource ds2=(MutePullBufferDataSource)ds;
    ds=ds2.getWrappedDataSource();
  }
  ScreenDevice screen=getScreenForPoint(new Point(x,y));
  ScreenDevice currentScreen=screen;
  if (screen == null) {
    return;
  }
  Rectangle bounds=((ScreenDeviceImpl)screen).getBounds();
  x-=bounds.x;
  y-=bounds.y;
  ((net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.DataSource)ds).setOrigin(0,currentScreen.getIndex(),x,y);
}
Program: 103426
Project: 103426
Buggy source:
/** 
 * If the screen contains specified point.
 * @param p point coordinate
 * @return true if point belongs to screen, false otherwise
 */
public boolean containsPoint(Point p){
  GraphicsConfiguration configs[]=screen.getConfigurations();
  for (  GraphicsConfiguration config : configs) {
    Rectangle bounds=config.getBounds();
    if (bounds.contains(p)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * If the screen contains specified point.
 * @param p point coordinate
 * @return true if point belongs to screen, false otherwise
 */
public boolean containsPoint(Point p){
  GraphicsConfiguration config=screen.getDefaultConfiguration();
  Rectangle bounds=config.getBounds();
  if (bounds.contains(p)) {
    return true;
  }
  return false;
}
Program: 103427
Project: 103427
Buggy source:
/** 
 * Reloads icon.
 */
public void loadSkin(){
  if (type == WARNING) {
    iconLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.WARNING_ICON)));
  }
 else {
    iconLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.ERROR_ICON)));
  }
}

Fixed version (ground truth):
/** 
 * Reloads icon.
 */
public void loadSkin(){
  ImageID icon=(type == WARNING) ? ImageLoader.WARNING_ICON : ImageLoader.ERROR_ICON;
  iconLabel.setIcon(new ImageIcon(ImageLoader.getImage(icon)));
}
Program: 103428
Project: 103428
Buggy source:
/** 
 * Creates an instance of <tt>MessageDialog</tt> by specifying the owner window and the message to be displayed.
 * @param owner the dialog owner
 * @param title the title of the error dialog
 * @param message the message to be displayed
 * @param type the dialog type
 */
public ErrorDialog(Frame owner,String title,String message,int type){
  this(owner,title,message);
  if (type == WARNING) {
    iconLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.WARNING_ICON)));
    this.type=type;
  }
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>ErrorDialog</tt> with a specific owner <tt>Frame</tt>, title and message to be displayed and of a specific type.
 * @param owner the dialog owner
 * @param title the title of the error dialog
 * @param message the message to be displayed
 * @param type the dialog type
 */
public ErrorDialog(Frame owner,String title,String message,int type){
  this(owner,title,message);
  if (type == WARNING) {
    iconLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.WARNING_ICON)));
    this.type=type;
  }
}
Program: 103429
Project: 103429
Buggy source:
/** 
 * Update the ErrorDialog when the user clicks on the hyperlink.
 * @param e The event generated by the click on the hyperlink.
 */
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    displayOrHideDetails();
  }
}

Fixed version (ground truth):
/** 
 * Update the ErrorDialog when the user clicks on the hyperlink.
 * @param e The event generated by the click on the hyperlink.
 */
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)   showOrHideDetails();
}
Program: 103430
Project: 103430
Buggy source:
/** 
 * Implements <code>ApplicationWindow.show</code> method.
 * @param isVisible specifies whether the frame is to be visible or not.
 */
public void setVisible(boolean isVisible){
  if (isVisible && configList.getSelectedIndex() < 0) {
    this.configList.setSelectedIndex(0);
  }
  super.setVisible(isVisible);
}

Fixed version (ground truth):
/** 
 * Implements <code>ApplicationWindow.show</code> method.
 * @param isVisible specifies whether the frame is to be visible or not.
 */
@Override public void setVisible(boolean isVisible){
  if (isVisible && configList.getSelectedIndex() < 0) {
    this.configList.setSelectedIndex(0);
  }
  super.setVisible(isVisible);
}
Program: 103431
Project: 103431
Buggy source:
/** 
 * Handles registration of a new configuration form.
 * @param event the <tt>ServiceEvent</tt> that notified us
 */
public void serviceChanged(ServiceEvent event){
  Object sService=AdvancedConfigActivator.bundleContext.getService(event.getServiceReference());
  if (!(sService instanceof ConfigurationForm))   return;
  ConfigurationForm configForm=(ConfigurationForm)sService;
  if (!configForm.isAdvanced())   return;
switch (event.getType()) {
case ServiceEvent.REGISTERED:
    if (logger.isInfoEnabled())     logger.info("String_Node_Str");
  this.addConfigForm(configForm);
break;
case ServiceEvent.UNREGISTERING:
this.removeConfigForm(configForm);
break;
}
}

Fixed version (ground truth):
/** 
 * Handles registration of a new configuration form.
 * @param event the <tt>ServiceEvent</tt> that notified us
 */
public void serviceChanged(ServiceEvent event){
  Object sService=AdvancedConfigActivator.bundleContext.getService(event.getServiceReference());
  if (!(sService instanceof ConfigurationForm))   return;
  ConfigurationForm configForm=(ConfigurationForm)sService;
  if ((configForm == this) || !configForm.isAdvanced())   return;
switch (event.getType()) {
case ServiceEvent.REGISTERED:
    if (logger.isInfoEnabled())     logger.info("String_Node_Str");
  this.addConfigForm(configForm);
break;
case ServiceEvent.UNREGISTERING:
this.removeConfigForm(configForm);
break;
}
}
Program: 103432
Project: 103432
Buggy source:
/** 
 * Installs this UI to the given component.
 * @param c the component to which to install this UI
 */
public void installUI(JComponent c){
  if (c == null)   throw new NullPointerException("String_Node_Str");
  tree=(JTree)c;
  tree.addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(    TreeSelectionEvent e){
      layoutCache.invalidatePathBounds(e.getOldLeadSelectionPath());
      layoutCache.invalidatePathBounds(e.getNewLeadSelectionPath());
      updateSize();
      tree.repaint();
    }
  }
);
  tree.addHierarchyListener(new HierarchyListener(){
    public void hierarchyChanged(    HierarchyEvent e){
      if (e.getID() == HierarchyEvent.HIERARCHY_CHANGED && (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0 && e.getChangedParent() instanceof JViewport) {
        parentViewport=(JViewport)e.getChangedParent();
      }
    }
  }
);
  super.installUI(c);
}

Fixed version (ground truth):
/** 
 * Installs this UI to the given component.
 * @param c the component to which to install this UI
 */
public void installUI(JComponent c){
  if (c == null)   throw new NullPointerException("String_Node_Str");
  tree=(JTree)c;
  tree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(    TreeSelectionEvent e){
      selectionChanged(e.getOldLeadSelectionPath(),e.getNewLeadSelectionPath());
    }
  }
);
  tree.addHierarchyListener(new HierarchyListener(){
    public void hierarchyChanged(    HierarchyEvent e){
      if (e.getID() == HierarchyEvent.HIERARCHY_CHANGED && (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0 && e.getChangedParent() instanceof JViewport) {
        parentViewport=(JViewport)e.getChangedParent();
      }
    }
  }
);
  super.installUI(c);
}
Program: 103433
Project: 103433
Buggy source:
public void valueChanged(TreeSelectionEvent e){
  layoutCache.invalidatePathBounds(e.getOldLeadSelectionPath());
  layoutCache.invalidatePathBounds(e.getNewLeadSelectionPath());
  updateSize();
  tree.repaint();
}

Fixed version (ground truth):
public void valueChanged(TreeSelectionEvent e){
  selectionChanged(e.getOldLeadSelectionPath(),e.getNewLeadSelectionPath());
}
Program: 103434
Project: 103434
Buggy source:
/** 
 * Creates an instance of <tt>ContactListTreeModel</tt>.
 */
public ContactListTreeModel(){
  super(null);
  RootUIGroup rootDescriptor=new RootUIGroup();
  rootGroupNode=new GroupNode(this,rootDescriptor);
  rootDescriptor.setGroupNode(rootGroupNode);
  this.setRoot(rootGroupNode);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>ContactListTreeModel</tt>.
 * @param tree the parent tree
 */
public ContactListTreeModel(JTree tree){
  super(null);
  this.parentTree=tree;
  RootUIGroup rootDescriptor=new RootUIGroup();
  rootGroupNode=new GroupNode(this,rootDescriptor);
  rootDescriptor.setGroupNode(rootGroupNode);
  this.setRoot(rootGroupNode);
}
Program: 103435
Project: 103435
Buggy source:
/** 
 * Removes the node corresponding to the given <tt>uiContact</tt> from this group.
 * @param uiContact the <tt>UIContact</tt> to remove
 */
public void removeContact(UIContact uiContact){
  final ContactNode contactNode=uiContact.getContactNode();
  if (contactNode != null) {
    int index=getIndex(contactNode);
    children.removeElementAt(index);
    contactNode.setParent(null);
    uiContact.setContactNode(null);
    uiContact=null;
    fireNodeRemoved(contactNode,index);
  }
}

Fixed version (ground truth):
/** 
 * Removes the node corresponding to the given <tt>uiContact</tt> from this group.
 * @param uiContact the <tt>UIContact</tt> to remove
 */
public void removeContact(UIContact uiContact){
  final ContactNode contactNode=uiContact.getContactNode();
  if (contactNode != null) {
    int index=getIndex(contactNode);
    int selectedIndex=getLeadSelectionRow();
    children.removeElementAt(index);
    contactNode.setParent(null);
    uiContact.setContactNode(null);
    uiContact=null;
    fireNodeRemoved(contactNode,index);
    refreshSelection(selectedIndex,getLeadSelectionRow());
  }
}
Program: 103436
Project: 103436
Buggy source:
/** 
 * Removes the node corresponding to the given <tt>uiGroup</tt> from this group node.
 * @param uiGroup the <tt>UIGroup</tt> to remove
 */
public void removeContactGroup(UIGroup uiGroup){
  GroupNode groupNode=uiGroup.getGroupNode();
  if (groupNode != null) {
    int index=getIndex(groupNode);
    children.removeElementAt(index);
    groupNode.setParent(null);
    uiGroup.setGroupNode(null);
    fireNodeRemoved(groupNode,index);
  }
}

Fixed version (ground truth):
/** 
 * Removes the node corresponding to the given <tt>uiGroup</tt> from this group node.
 * @param uiGroup the <tt>UIGroup</tt> to remove
 */
public void removeContactGroup(UIGroup uiGroup){
  GroupNode groupNode=uiGroup.getGroupNode();
  if (groupNode != null) {
    int index=getIndex(groupNode);
    int selectedIndex=getLeadSelectionRow();
    children.removeElementAt(index);
    groupNode.setParent(null);
    uiGroup.setGroupNode(null);
    fireNodeRemoved(groupNode,index);
    refreshSelection(selectedIndex,getLeadSelectionRow());
  }
}
Program: 103437
Project: 103437
Buggy source:
public void run(){
  Collections.sort(children,nodeComparator);
  fireNodesChanged();
}

Fixed version (ground truth):
public void run(){
  TreePath selectionPath=getLeadSelectionPath();
  int oldSelectionIndex=getLeadSelectionRow();
  Collections.sort(children,nodeComparator);
  fireNodesChanged();
  treeModel.getParentTree().setSelectionPath(selectionPath);
  refreshSelection(oldSelectionIndex,getLeadSelectionRow());
}
Program: 103438
Project: 103438
Buggy source:
/** 
 * Creates a <tt>ContactNode</tt> for the given <tt>uiContact</tt> and adds it to this group.
 * @param uiContact the <tt>UIContact</tt> to add
 * @return the created <tt>ContactNode</tt>
 */
public ContactNode addContact(UIContact uiContact){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + uiContact.getDisplayName());
  ContactNode contactNode=new ContactNode(uiContact);
  uiContact.setContactNode(contactNode);
  add(contactNode);
  int contactIndex=getIndex(contactNode);
  if (contactIndex > -1)   fireNodeInserted(contactIndex);
  return contactNode;
}

Fixed version (ground truth):
/** 
 * Creates a <tt>ContactNode</tt> for the given <tt>uiContact</tt> and adds it to this group.
 * @param uiContact the <tt>UIContact</tt> to add
 * @return the created <tt>ContactNode</tt>
 */
public ContactNode addContact(UIContact uiContact){
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + uiContact.getDisplayName());
  int selectedIndex=getLeadSelectionRow();
  ContactNode contactNode=new ContactNode(uiContact);
  uiContact.setContactNode(contactNode);
  add(contactNode);
  int contactIndex=getIndex(contactNode);
  if (contactIndex > -1)   fireNodeInserted(contactIndex);
  refreshSelection(selectedIndex,getLeadSelectionRow());
  return contactNode;
}
Program: 103439
Project: 103439
Buggy source:
/** 
 * Sorts the children of this node.
 * @param treeModel the <tt>ContactListTreeModel</tt>, which should berefreshed
 */
@SuppressWarnings("String_Node_Str") public void sort(ContactListTreeModel treeModel){
  if (children != null) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        Collections.sort(children,nodeComparator);
        fireNodesChanged();
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Sorts the children of this node.
 * @param treeModel the <tt>ContactListTreeModel</tt>, which should berefreshed
 */
@SuppressWarnings("String_Node_Str") public void sort(final ContactListTreeModel treeModel){
  if (children != null) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        TreePath selectionPath=getLeadSelectionPath();
        int oldSelectionIndex=getLeadSelectionRow();
        Collections.sort(children,nodeComparator);
        fireNodesChanged();
        treeModel.getParentTree().setSelectionPath(selectionPath);
        refreshSelection(oldSelectionIndex,getLeadSelectionRow());
      }
    }
);
  }
}
Program: 103440
Project: 103440
Buggy source:
/** 
 * Creates a <tt>GroupNode</tt> for the given <tt>uiGroup</tt> and adds it to this group.
 * @param uiGroup the <tt>UIGroup</tt> to add
 * @return the created <tt>GroupNode</tt>
 */
public GroupNode addContactGroup(UIGroup uiGroup){
  GroupNode groupNode=new GroupNode(treeModel,uiGroup);
  uiGroup.setGroupNode(groupNode);
  add(groupNode);
  int groupIndex=getIndex(groupNode);
  if (groupIndex > -1)   fireNodeInserted(groupIndex);
  return groupNode;
}

Fixed version (ground truth):
/** 
 * Creates a <tt>GroupNode</tt> for the given <tt>uiGroup</tt> and adds it to this group.
 * @param uiGroup the <tt>UIGroup</tt> to add
 * @return the created <tt>GroupNode</tt>
 */
public GroupNode addContactGroup(UIGroup uiGroup){
  int selectedIndex=getLeadSelectionRow();
  GroupNode groupNode=new GroupNode(treeModel,uiGroup);
  uiGroup.setGroupNode(groupNode);
  add(groupNode);
  int groupIndex=getIndex(groupNode);
  if (groupIndex > -1)   fireNodeInserted(groupIndex);
  refreshSelection(selectedIndex,getLeadSelectionRow());
  return groupNode;
}
Program: 103441
Project: 103441
Buggy source:
/** 
 * Creates the <tt>TreeContactList</tt>.
 */
public TreeContactList(){
  originalMouseListeners=this.getMouseListeners();
  for (  MouseListener listener : originalMouseListeners)   this.removeMouseListener(listener);
  this.addMouseListener(this);
  this.addMouseMotionListener(this);
  this.addTreeExpansionListener(this);
  GuiActivator.getContactListService().addMetaContactListListener(this);
  treeModel=new ContactListTreeModel();
  setTreeModel(treeModel);
  if (isRootVisible())   setRootVisible(false);
  this.initKeyActions();
  this.initContactSources();
}

Fixed version (ground truth):
/** 
 * Creates the <tt>TreeContactList</tt>.
 */
public TreeContactList(){
  originalMouseListeners=this.getMouseListeners();
  for (  MouseListener listener : originalMouseListeners)   this.removeMouseListener(listener);
  this.addMouseListener(this);
  this.addMouseMotionListener(this);
  this.addTreeExpansionListener(this);
  GuiActivator.getContactListService().addMetaContactListListener(this);
  treeModel=new ContactListTreeModel(this);
  setTreeModel(treeModel);
  if (isRootVisible())   setRootVisible(false);
  this.initKeyActions();
  this.initContactSources();
}
Program: 103442
Project: 103442
Buggy source:
/** 
 * Indicates that a change has occurred in the status of the source <tt>CallPeer</tt>.
 * @param evt the <tt>CallPeerChangeEvent</tt> instance containing thesource event as well as its previous and its new status
 */
@Override public void peerStateChanged(CallPeerChangeEvent evt){
  CallPeer peer=evt.getSourceCallPeer();
  CallPeerState state=peer.getState();
  if (remoteControlEnabled && state != null && (state.equals(CallPeerState.DISCONNECTED) || state.equals(CallPeerState.FAILED))) {
    disableRemoteControl(evt.getSourceCallPeer());
  }
 else   if (state != null && state.equals(CallPeerState.CONNECTED)) {
    enableRemoteControl(evt.getSourceCallPeer());
  }
}

Fixed version (ground truth):
/** 
 * Indicates that a change has occurred in the status of the source <tt>CallPeer</tt>.
 * @param evt the <tt>CallPeerChangeEvent</tt> instance containing thesource event as well as its previous and its new status
 */
@Override public void peerStateChanged(CallPeerChangeEvent evt){
  CallPeer peer=evt.getSourceCallPeer();
  CallPeerState state=peer.getState();
  if (remoteControlEnabled && state != null && (state.equals(CallPeerState.DISCONNECTED) || state.equals(CallPeerState.FAILED))) {
    disableRemoteControl(evt.getSourceCallPeer());
  }
}
Program: 103444
Project: 103444
Buggy source:
/** 
 * Disable desktop remote control. Local desktop stop regenerates keyboard and mouse events received from peer.
 * @param callPeer call peer that will stop controlling on local computer
 */
public void disableRemoteControl(CallPeer callPeer){
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  remoteControlEnabled=false;
  if (callPeers.contains(callPeer.getAddress())) {
    callPeers.remove(callPeer.getAddress());
  }
}

Fixed version (ground truth):
/** 
 * Disable desktop remote control. Local desktop stops regenerate keyboard and mouse events received from peer.
 * @param callPeer call peer that will stop controlling on local computer
 */
public void disableRemoteControl(CallPeer callPeer){
  if (logger.isInfoEnabled())   logger.info("String_Node_Str");
  remoteControlEnabled=false;
  if (callPeers.contains(callPeer.getAddress())) {
    callPeers.remove(callPeer.getAddress());
  }
}
Program: 103445
Project: 103445
Buggy source:
/** 
 * Notifies this <tt>MethodProcessorListener</tt> that a specific <tt>CallPeer</tt> has processed a specific SIP <tt>Response</tt> and has replied to it with a specific SIP <tt>Request</tt>.
 * @param sourceCallPeer the <tt>CallPeer</tt> which has processed thespecified SIP <tt>Response</tt>
 * @param response the SIP <tt>Response</tt> which has been processed by<tt>sourceCallPeer</tt>
 * @param request the SIP <tt>Request</tt> sent by <tt>sourceCallPeer</tt>as a reply to the specified SIP <tt>response</tt>
 * @see MethodProcessorListener#responseProcessed(CallPeerSipImpl,Response,Request)
 */
public void responseProcessed(CallPeerSipImpl sourceCallPeer,Response response,Request request){
  if (Response.OK == response.getStatusCode()) {
    CSeqHeader cseqHeader=(CSeqHeader)response.getHeader(CSeqHeader.NAME);
    if ((cseqHeader != null) && Request.INVITE.equalsIgnoreCase(cseqHeader.getMethod())) {
      enableRemoteControl(sourceCallPeer);
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies this <tt>MethodProcessorListener</tt> that a specific <tt>CallPeer</tt> has processed a specific SIP <tt>Response</tt> and has replied to it with a specific SIP <tt>Request</tt>.
 * @param sourceCallPeer the <tt>CallPeer</tt> which has processed thespecified SIP <tt>Response</tt>
 * @param response the SIP <tt>Response</tt> which has been processed by<tt>sourceCallPeer</tt>
 * @param request the SIP <tt>Request</tt> sent by <tt>sourceCallPeer</tt>as a reply to the specified SIP <tt>response</tt>
 * @see MethodProcessorListener#responseProcessed(CallPeerSipImpl,Response,Request)
 */
public void responseProcessed(CallPeerSipImpl sourceCallPeer,Response response,Request request){
  if (Response.OK == response.getStatusCode()) {
    CSeqHeader cseqHeader=(CSeqHeader)response.getHeader(CSeqHeader.NAME);
    if ((cseqHeader != null) && Request.INVITE.equalsIgnoreCase(cseqHeader.getMethod())) {
    }
  }
}
Program: 103446
Project: 103446
Buggy source:
/** 
 * Sends this collector's query to the default resolver.
 */
public void run(){
  Message localResponse=null;
  try {
    localResponse=defaultResolver.send(query);
  }
 catch (  Throwable exc) {
    this.exception=exc;
  }
synchronized (this) {
    if (done)     return;
    response=localResponse;
    done=true;
    notify();
  }
}

Fixed version (ground truth):
/** 
 * Sends this collector's query to the default resolver.
 */
public void run(){
  Message localResponse=null;
  try {
    localResponse=defaultResolver.send(query);
  }
 catch (  Throwable exc) {
    logger.info("String_Node_Str" + exc);
    this.exception=exc;
  }
synchronized (this) {
    if (done)     return;
    response=localResponse;
    done=true;
    notify();
  }
}
Program: 103447
Project: 103447
Buggy source:
/** 
 * Asynchronously sends this collector's query to all backup resolvers.
 */
public void sendBackupQueries(){
synchronized (this) {
    for (    Resolver resolver : backupResolvers) {
      if (done)       return;
      resolver.sendAsync(query,this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Asynchronously sends this collector's query to all backup resolvers.
 */
public void sendBackupQueries(){
  logger.info("String_Node_Str");
synchronized (this) {
    for (    Resolver resolver : backupResolvers) {
      if (done)       return;
      resolver.sendAsync(query,this);
    }
  }
}