Program: 126517
Project: 126517
Buggy source:
/** 
 * DOC amaumont Comment method "executePreviewHandlerEvent".
 * @param event
 */
private void executePreviewHandlerEvent(final PreviewHandlerEvent<R> event){
  final PreviewHandlerEvent.TYPE eventType=event.getType();
  final AsynchronousPreviewHandler<R> source=event.getSource();
  if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_STARTED) {
    final IRunnableWithProgress op=new IRunnableWithProgress(){
      public void run(      final IProgressMonitor monitor){
        infoLabel.getDisplay().asyncExec(new Runnable(){
          public void run(){
            monitorWrap=SubMonitor.convert(monitor);
            monitorWrap.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
            breakInfiniteLoop=false;
            while (true) {
              if (monitorWrap.isCanceled() || breakInfiniteLoop) {
                break;
              }
            }
            if (monitorWrap.isCanceled()) {
              source.stopPreviewProcess();
            }
 else {
              monitorWrap.done();
            }
          }
        }
);
      }
    }
;
    infoLabel.getDisplay().syncExec(new Runnable(){
      public void run(){
        try {
          new ProgressMonitorDialog(infoLabel.getShell()).run(true,true,op);
        }
 catch (        InvocationTargetException e) {
          ExceptionHandler.process(e);
        }
catch (        InterruptedException e) {
          ExceptionHandler.process(e);
        }
      }
    }
);
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_INTERRUPTED) {
    breakInfiniteLoop=true;
    infoLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_ENDED) {
    breakInfiniteLoop=true;
    infoLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    infoLabel.getParent().layout();
    R result=source.getResult();
    previewEnded(result);
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_IN_ERROR) {
    breakInfiniteLoop=true;
    final CoreException e=event.getException();
    previewInError(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "executePreviewHandlerEvent".
 * @param event
 */
private void executePreviewHandlerEvent(final PreviewHandlerEvent<R> event){
  final PreviewHandlerEvent.TYPE eventType=event.getType();
  final AsynchronousPreviewHandler<R> source=event.getSource();
  if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_STARTED) {
    final IRunnableWithProgress op=new IRunnableWithProgress(){
      public void run(      final IProgressMonitor monitor){
        infoLabel.getDisplay().asyncExec(new Runnable(){
          public void run(){
            monitorWrap=new EventLoopProgressMonitor(monitor);
            monitorWrap.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
            breakInfiniteLoop=false;
            while (true) {
              if (monitorWrap.isCanceled() || breakInfiniteLoop) {
                break;
              }
            }
            if (monitorWrap.isCanceled()) {
              source.stopPreviewProcess();
            }
 else {
              monitorWrap.done();
            }
          }
        }
);
      }
    }
;
    infoLabel.getDisplay().syncExec(new Runnable(){
      public void run(){
        try {
          new ProgressMonitorDialog(infoLabel.getShell()).run(true,true,op);
        }
 catch (        InvocationTargetException e) {
          ExceptionHandler.process(e);
        }
catch (        InterruptedException e) {
          ExceptionHandler.process(e);
        }
      }
    }
);
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_INTERRUPTED) {
    breakInfiniteLoop=true;
    infoLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_ENDED) {
    breakInfiniteLoop=true;
    infoLabel.setText("String_Node_Str" + Messages.getString("String_Node_Str"));
    infoLabel.getParent().layout();
    R result=source.getResult();
    previewEnded(result);
  }
 else   if (eventType == PreviewHandlerEvent.TYPE.PREVIEW_IN_ERROR) {
    breakInfiniteLoop=true;
    final CoreException e=event.getException();
    previewInError(e);
  }
}