Program: 47580
Project: 47580
Buggy source:
public void handleRightClick(final int left,final int top,final Boolean metaKeyDown){
  Boolean isSelected=filesListPanel.getSelectedFileItems().contains(this);
  if (!isSelected) {
    toggleSelect(metaKeyDown,false);
    fireFileSelectionEvent();
  }
  String menuItems[];
  FileCommand.COMMAND menuCommands[];
  if (isInTrash()) {
    menuItems=trashMenuItems;
    menuCommands=trashMenuCommands;
  }
 else {
    if (SolutionBrowserPanel.getInstance().isAdministrator()) {
      menuItems=adminMenuItems;
      menuCommands=adminMenuCommands;
    }
 else {
      menuItems=nonAdminMenuItems;
      menuCommands=nonAdminMenuCommands;
    }
  }
  popupMenu.setPopupPosition(left,top);
  final MenuBar menuBar=new MenuBar(true);
  menuBar.setAutoOpen(true);
  for (int i=0; i < menuItems.length; i++) {
    if (!MantleApplication.showAdvancedFeatures && menuCommands[i] == COMMAND.EDIT_ACTION) {
      continue;
    }
    if (menuItems[i].equals(SEPARATOR)) {
      menuBar.addSeparator();
    }
 else     if (options != null && options.isCommandEnabled(menuCommands[i])) {
      menuBar.addItem(new MenuItem(Messages.getString(menuItems[i]),new FileCommand(menuCommands[i],popupMenu,getRepositoryFile())));
    }
 else {
      MenuItem item=new MenuItem(Messages.getString(menuItems[i]),(Command)null);
      item.setStyleName("String_Node_Str");
      menuBar.addItem(item);
    }
  }
  popupMenu.setWidget(menuBar);
  Timer t=new Timer(){
    public void run(){
      popupMenu.hide();
      popupMenu.show();
      if ((top + popupMenu.getOffsetHeight()) > Window.getClientHeight()) {
        popupMenu.setPopupPosition(left,top - popupMenu.getOffsetHeight());
        popupMenu.hide();
        popupMenu.show();
        DOM.scrollIntoView(popupMenu.getElement());
      }
    }
  }
;
  t.schedule(250);
}

Fixed version (ground truth):
public void handleRightClick(final int left,final int top,final Boolean metaKeyDown){
  Boolean isSelected=filesListPanel.getSelectedFileItems().contains(this);
  if (!isSelected) {
    toggleSelect(metaKeyDown,false);
    fireFileSelectionEvent();
  }
  MenuGlue menuItems[];
  if (isInTrash()) {
    menuItems=trashMenuItems;
  }
 else {
    if (SolutionBrowserPanel.getInstance().isAdministrator()) {
      menuItems=adminMenuItems;
    }
 else {
      menuItems=nonAdminMenuItems;
    }
  }
  popupMenu.setPopupPosition(left,top);
  final MenuBar menuBar=new MenuBar(true);
  menuBar.setAutoOpen(true);
  for (int i=0; i < menuItems.length; i++) {
    if (!MantleApplication.showAdvancedFeatures && menuItems[i].getCommand() == COMMAND.EDIT_ACTION) {
      continue;
    }
    if (menuItems[i].getTitle().equals(SEPARATOR)) {
      menuBar.addSeparator();
    }
 else     if (options != null && options.isCommandEnabled(menuItems[i].getCommand())) {
      menuBar.addItem(new MenuItem(Messages.getString(menuItems[i].getTitle()),new FileCommand(menuItems[i].getCommand(),popupMenu,getRepositoryFile())));
    }
 else {
      MenuItem item=new MenuItem(Messages.getString(menuItems[i].getTitle()),(Command)null);
      item.setStyleName("String_Node_Str");
      menuBar.addItem(item);
    }
  }
  popupMenu.setWidget(menuBar);
  Timer t=new Timer(){
    public void run(){
      popupMenu.hide();
      popupMenu.show();
      if ((top + popupMenu.getOffsetHeight()) > Window.getClientHeight()) {
        popupMenu.setPopupPosition(left,top - popupMenu.getOffsetHeight());
        popupMenu.hide();
        popupMenu.show();
        DOM.scrollIntoView(popupMenu.getElement());
      }
    }
  }
;
  t.schedule(250);
}