Program: 57902
Project: 57902
Buggy source:
public static void showMenu(final ContextMenuCreator menuCreator,final int retriesLeft){
  if (retriesLeft == 0)   return;
  final Display display=menuCreator.getParent().getDisplay();
  final Shell activeShell=menuCreator.getParent().getShell();
  popupShell=new Shell(display,SWT.NO_TRIM | SWT.NO_FOCUS | SWT.ON_TOP);
  Point l=display.getCursorLocation();
  l.x-=2;
  l.y-=2;
  popupShell.setLocation(l);
  popupShell.setSize(4,4);
  popupShell.open();
  final int[] count=new int[1];
  Runnable r=new Runnable(){
    public void run(){
      popupShell.setActive();
      final Menu menu=menuCreator.create(popupShell);
      menu.addListener(SWT.Hide,new Listener(){
        public void handleEvent(        Event e){
          activeShell.setActive();
        }
      }
);
      menu.addListener(SWT.Show,new Listener(){
        public void handleEvent(        Event e){
          count[0]++;
          if (!menu.isVisible() && count[0] > MAX_ATTEMPTS) {
            Runnable r=new Runnable(){
              public void run(){
                System.err.println("String_Node_Str" + MAX_ATTEMPTS + "String_Node_Str");
                menu.setVisible(false);
                menu.dispose();
                popupShell.dispose();
                System.err.println("String_Node_Str");
                showMenu(menuCreator,retriesLeft - 1);
              }
            }
;
            display.asyncExec(r);
            return;
          }
          Runnable runnable=new Runnable(){
            public void run(){
              if (!menu.isVisible())               menu.setVisible(true);
 else {
              }
            }
          }
;
          display.asyncExec(runnable);
        }
      }
);
      menu.setVisible(true);
    }
  }
;
  display.asyncExec(r);
}

Fixed version (ground truth):
public static void showMenu(final ContextMenuCreator menuCreator,final int retriesLeft){
  if (retriesLeft == 0)   return;
  final Display display=menuCreator.getParent().getDisplay();
  final Shell activeShell=menuCreator.getParent().getShell();
  popupShell=new Shell(activeShell,SWT.NO_TRIM | SWT.NO_FOCUS | SWT.ON_TOP);
  Point l=display.getCursorLocation();
  l.x-=2;
  l.y-=2;
  popupShell.setLocation(l);
  popupShell.setSize(4,4);
  popupShell.open();
  final int[] count=new int[1];
  Runnable r=new Runnable(){
    public void run(){
      popupShell.setActive();
      final Menu menu=menuCreator.create(popupShell);
      menu.addListener(SWT.Hide,new Listener(){
        public void handleEvent(        Event e){
          activeShell.setActive();
        }
      }
);
      menu.addListener(SWT.Show,new Listener(){
        public void handleEvent(        Event e){
          count[0]++;
          if (!menu.isVisible() && count[0] > MAX_ATTEMPTS) {
            Runnable r=new Runnable(){
              public void run(){
                System.err.println("String_Node_Str" + MAX_ATTEMPTS + "String_Node_Str");
                menu.setVisible(false);
                menu.dispose();
                popupShell.dispose();
                System.err.println("String_Node_Str");
                showMenu(menuCreator,retriesLeft - 1);
              }
            }
;
            display.asyncExec(r);
            return;
          }
          Runnable runnable=new Runnable(){
            public void run(){
              if (!menu.isVisible())               menu.setVisible(true);
 else {
              }
            }
          }
;
          display.asyncExec(runnable);
        }
      }
);
      popupShell.addListener(SWT.Deactivate,new Listener(){
        @Override public void handleEvent(        Event event){
          popupShell.close();
          popupShell.dispose();
          menuCreator.getView().setLazyMode(false);
        }
      }
);
      menu.setVisible(true);
    }
  }
;
  display.asyncExec(r);
}