Program: 103709
Project: 103709
Buggy source:
/** 
 * Handles a specific <tt>VideoEvent</tt> related to a specific visual <tt>Component</tt> depicting video knowing that it is to be displayed or is already displayed in a specific <tt>Container</tt>.
 * @param videoEvent the <tt>VideoEvent</tt> describing the visual<tt>Component</tt> which was added, removed or updated
 * @param videoContainer the <tt>Container</tt> which is to contain oralready contains the visual <tt>Component</tt> described by <tt>videoEvent</tt>
 */
private void handleVideoEvent(VideoEvent videoEvent,Container videoContainer){
  if (videoEvent != null) {
    if ((videoEvent.getOrigin() == VideoEvent.REMOTE) && (videoEvent instanceof SizeChangeVideoEvent)) {
      SizeChangeVideoEvent sizeChangeVideoEvent=(SizeChangeVideoEvent)videoEvent;
      Component visualComponent=sizeChangeVideoEvent.getVisualComponent();
      int width=sizeChangeVideoEvent.getWidth();
      int height=sizeChangeVideoEvent.getHeight();
      if (visualComponent.getParent() == null)       visualComponent.setPreferredSize(new Dimension(width,height));
 else       if (isAncestor(videoContainer,visualComponent))       ensureSize(visualComponent,width,height);
      return;
    }
switch (videoEvent.getType()) {
case VideoEvent.VIDEO_ADDED:
case VideoEvent.VIDEO_REMOVED:
      break;
default :
    return;
}
}
int zOrder=0;
videoContainer.removeAll();
if (localVideo != null) {
videoContainer.add(localVideo,VideoLayout.LOCAL,zOrder++);
if (!callDialog.isVideoButtonSelected()) callDialog.setVideoButtonSelected(true);
}
Component video=videoTelephony.getVisualComponent(callPeer);
if (video != null) videoContainer.add(video,VideoLayout.CENTER_REMOTE,zOrder++);
videoContainer.validate();
videoContainer.repaint();
}

Fixed version (ground truth):
/** 
 * Handles a specific <tt>VideoEvent</tt> related to a specific visual <tt>Component</tt> depicting video knowing that it is to be displayed or is already displayed in a specific <tt>Container</tt>.
 * @param videoEvent the <tt>VideoEvent</tt> describing the visual<tt>Component</tt> which was added, removed or updated
 * @param videoContainer the <tt>Container</tt> which is to contain oralready contains the visual <tt>Component</tt> described by <tt>videoEvent</tt>
 */
private void handleVideoEvent(VideoEvent videoEvent,Container videoContainer){
  if (videoEvent != null) {
    if ((videoEvent.getOrigin() == VideoEvent.REMOTE) && (videoEvent instanceof SizeChangeVideoEvent)) {
      SizeChangeVideoEvent sizeChangeVideoEvent=(SizeChangeVideoEvent)videoEvent;
      Component visualComponent=sizeChangeVideoEvent.getVisualComponent();
      int width=sizeChangeVideoEvent.getWidth();
      int height=sizeChangeVideoEvent.getHeight();
      if (visualComponent.getParent() == null)       visualComponent.setPreferredSize(new Dimension(width,height));
 else       if (isAncestor(videoContainer,visualComponent)) {
        ensureSize(visualComponent,width,height);
        videoContainer.doLayout();
      }
      return;
    }
switch (videoEvent.getType()) {
case VideoEvent.VIDEO_ADDED:
case VideoEvent.VIDEO_REMOVED:
      break;
default :
    return;
}
}
int zOrder=0;
videoContainer.removeAll();
if (localVideo != null) {
videoContainer.add(localVideo,VideoLayout.LOCAL,zOrder++);
if (!callDialog.isVideoButtonSelected()) callDialog.setVideoButtonSelected(true);
}
Component video=videoTelephony.getVisualComponent(callPeer);
if (video != null) videoContainer.add(video,VideoLayout.CENTER_REMOTE,zOrder++);
videoContainer.validate();
videoContainer.repaint();
}