Program: 103165
Project: 103165
Buggy source:
/** 
 * Updates this view i.e. <tt>OneToOneCallPeerPanel</tt> so that it depicts the current state of its model i.e. <tt>callPeer</tt>. The update is performed in the AWT event dispatching thread.
 */
private void updateViewFromModelInEventDispatchThread(){
  OperationSetVideoTelephony videoTelephony=callPeer.getProtocolProvider().getOperationSet(OperationSetVideoTelephony.class);
  Component remoteVideo=null;
  Component localVideo=null;
  if (videoTelephony != null) {
    List<Component> remoteVideos=videoTelephony.getVisualComponents(callPeer);
    if ((remoteVideos != null) && !remoteVideos.isEmpty()) {
      remoteVideo=remoteVideos.get(0);
    }
    if (uiVideoHandler.isLocalVideoVisible()) {
      try {
        localVideo=videoTelephony.getLocalVisualComponent(callPeer);
      }
 catch (      OperationFailedException ofe) {
      }
    }
    boolean localVideoChanged=((localVideo != this.localVideo) || ((localVideo != null) && !UIVideoHandler2.isAncestor(center,localVideo)));
    boolean remoteVideoChanged=((remoteVideo != this.remoteVideo) || ((remoteVideo != null) && !UIVideoHandler2.isAncestor(center,remoteVideo)));
    if (localVideoChanged || remoteVideoChanged) {
      if (localVideoChanged && !remoteVideoChanged && (localVideo == null)) {
        if (this.localVideo != null) {
          center.remove(this.localVideo);
          this.localVideo=null;
          if (closeLocalVisualComponentButton != null)           center.remove(closeLocalVisualComponentButton);
        }
      }
 else {
        center.removeAll();
        if (remoteVideo != null)         center.add(remoteVideo,VideoLayout.CENTER_REMOTE,-1);
        this.remoteVideo=remoteVideo;
        if (localVideo != null) {
          center.add(localVideo,VideoLayout.LOCAL,-1);
          if (closeLocalVisualComponentButton == null) {
            closeLocalVisualComponentButton=new CloseLocalVisualComponentButton(uiVideoHandler);
          }
          center.add(closeLocalVisualComponentButton,VideoLayout.CLOSE_LOCAL_BUTTON,-1);
        }
        this.localVideo=localVideo;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates this view i.e. <tt>OneToOneCallPeerPanel</tt> so that it depicts the current state of its model i.e. <tt>callPeer</tt>. The update is performed in the AWT event dispatching thread.
 */
private void updateViewFromModelInEventDispatchThread(){
  if (disposed)   return;
  OperationSetVideoTelephony videoTelephony=callPeer.getProtocolProvider().getOperationSet(OperationSetVideoTelephony.class);
  Component remoteVideo=null;
  Component localVideo=null;
  if (videoTelephony != null) {
    List<Component> remoteVideos=videoTelephony.getVisualComponents(callPeer);
    if ((remoteVideos != null) && !remoteVideos.isEmpty()) {
      remoteVideo=remoteVideos.get(0);
    }
    if (uiVideoHandler.isLocalVideoVisible()) {
      try {
        localVideo=videoTelephony.getLocalVisualComponent(callPeer);
      }
 catch (      OperationFailedException ofe) {
        logger.warn("String_Node_Str",ofe);
      }
    }
    boolean localVideoChanged=((localVideo != this.localVideo) || ((localVideo != null) && !UIVideoHandler2.isAncestor(center,localVideo)));
    boolean remoteVideoChanged=((remoteVideo != this.remoteVideo) || ((remoteVideo != null) && !UIVideoHandler2.isAncestor(center,remoteVideo)));
    if (localVideoChanged || remoteVideoChanged) {
      if (localVideoChanged && !remoteVideoChanged && (localVideo == null)) {
        if (this.localVideo != null) {
          center.remove(this.localVideo);
          this.localVideo=null;
          if (closeLocalVisualComponentButton != null)           center.remove(closeLocalVisualComponentButton);
        }
      }
 else {
        center.removeAll();
        this.localVideo=null;
        this.remoteVideo=null;
        if (remoteVideo != null) {
          center.add(remoteVideo,VideoLayout.CENTER_REMOTE,-1);
          this.remoteVideo=remoteVideo;
        }
        if (localVideo != null) {
          center.add(localVideo,VideoLayout.LOCAL,-1);
          this.localVideo=localVideo;
          if (closeLocalVisualComponentButton == null) {
            closeLocalVisualComponentButton=new CloseLocalVisualComponentButton(uiVideoHandler);
          }
          center.add(closeLocalVisualComponentButton,VideoLayout.CLOSE_LOCAL_BUTTON,-1);
        }
      }
    }
  }
}