Program: 121032
Project: 121032
Buggy source:
@Override protected void configureGraphicalViewer(){
  super.configureGraphicalViewer();
  ScrollingGraphicalViewer viewer=(ScrollingGraphicalViewer)getGraphicalViewer();
  viewer.setSelectionManager(new TalendSelectionManager());
  TalendScalableFreeformRootEditPart root=new TalendScalableFreeformRootEditPart(getEditorInput());
  List<String> zoomLevels=new ArrayList<String>();
  zoomLevels.add(ZoomManager.FIT_ALL);
  zoomLevels.add(ZoomManager.FIT_WIDTH);
  zoomLevels.add(ZoomManager.FIT_HEIGHT);
  root.getZoomManager().setZoomLevelContributions(zoomLevels);
  IAction zoomIn=new ZoomInAction(root.getZoomManager());
  IAction zoomOut=new ZoomOutAction(root.getZoomManager());
  getActionRegistry().registerAction(zoomIn);
  getActionRegistry().registerAction(zoomOut);
  IHandlerService service=(IHandlerService)getEditorSite().getService(IHandlerService.class);
  service.activateHandler(zoomIn.getActionDefinitionId(),new ActionHandler(zoomIn));
  service.activateHandler(zoomOut.getActionDefinitionId(),new ActionHandler(zoomOut));
  IAction directEditAction=new DirectEditAction(this);
  getActionRegistry().registerAction(directEditAction);
  getSelectionActions().add(directEditAction.getId());
  IAction copyAction=new GEFCopyAction(this);
  getActionRegistry().registerAction(copyAction);
  getSelectionActions().add(copyAction.getId());
  IAction pasteAction=new GEFPasteAction(this);
  getActionRegistry().registerAction(pasteAction);
  getSelectionActions().add(pasteAction.getId());
  IAction deleteAction=new GEFDeleteAction(this);
  getActionRegistry().registerAction(deleteAction);
  getSelectionActions().add(deleteAction.getId());
  IAction setRefAction=new ConnectionSetAsMainRef(this);
  getActionRegistry().registerAction(setRefAction);
  getSelectionActions().add(setRefAction.getId());
  IAction modifyMergeAction=new ModifyMergeOrderAction(this);
  getActionRegistry().registerAction(modifyMergeAction);
  getSelectionActions().add(modifyMergeAction.getId());
  IAction modifyOutputOrderAction=new ModifyOutputOrderAction(this);
  getActionRegistry().registerAction(modifyOutputOrderAction);
  getSelectionActions().add(modifyOutputOrderAction.getId());
  List<IAction> calcOrderActions=ModifyConnectionOrderAction.getOrderActions(this);
  for (  IAction orderAction : calcOrderActions) {
    getActionRegistry().registerAction(orderAction);
    getSelectionActions().add(orderAction.getId());
  }
  viewer.setRootEditPart(root);
  PartFactory partFactory=new PartFactory();
  getGraphicalViewer().setEditPartFactory(partFactory);
  getGraphicalViewer().setKeyHandler(new NodePartKeyHander(getGraphicalViewer()).setParent(getCommonKeyHandler()));
  initializeActivationCodeTrigger();
  ContextMenuProvider cmProvider=new TalendEditorContextMenuProvider(this,viewer,getActionRegistry());
  viewer.setContextMenu(cmProvider);
  getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),MouseWheelZoomHandler.SINGLETON);
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SPACING,new Dimension(AbstractTalendEditor.GRID_SIZE,AbstractTalendEditor.GRID_SIZE));
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED,new Boolean(true));
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE,new Boolean(true));
  IAction showGrid=new ToggleGridAction(getGraphicalViewer());
  getActionRegistry().registerAction(showGrid);
  getGraphicalViewer().setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED,new Boolean(false));
  IAction snapAction=new ToggleSnapToGeometryAction(getGraphicalViewer());
  getActionRegistry().registerAction(snapAction);
  if (getProcess().isSubjobEnabled()) {
    IAction toggleSubjobsAction=ToggleSubjobsAction.getDefault();
    getActionRegistry().registerAction(toggleSubjobsAction);
    for (Iterator iterator=getSelectionActions().iterator(); iterator.hasNext(); ) {
      String actionID=(String)iterator.next();
      IAction action=getActionRegistry().getAction(actionID);
      setAction(actionID,action);
    }
  }
}

Fixed version (ground truth):
@Override protected void configureGraphicalViewer(){
  super.configureGraphicalViewer();
  ScrollingGraphicalViewer viewer=(ScrollingGraphicalViewer)getGraphicalViewer();
  viewer.setSelectionManager(new TalendSelectionManager());
  TalendScalableFreeformRootEditPart root=new TalendScalableFreeformRootEditPart(getEditorInput());
  List<String> zoomLevels=new ArrayList<String>();
  zoomLevels.add(ZoomManager.FIT_ALL);
  zoomLevels.add(ZoomManager.FIT_WIDTH);
  zoomLevels.add(ZoomManager.FIT_HEIGHT);
  root.getZoomManager().setZoomLevelContributions(zoomLevels);
  IAction zoomIn=new ZoomInAction(root.getZoomManager());
  IAction zoomOut=new ZoomOutAction(root.getZoomManager());
  getActionRegistry().registerAction(zoomIn);
  getActionRegistry().registerAction(zoomOut);
  IHandlerService service=(IHandlerService)getEditorSite().getService(IHandlerService.class);
  service.activateHandler(zoomIn.getActionDefinitionId(),new ActionHandler(zoomIn));
  service.activateHandler(zoomOut.getActionDefinitionId(),new ActionHandler(zoomOut));
  IAction directEditAction=new DirectEditAction(this);
  getActionRegistry().registerAction(directEditAction);
  getSelectionActions().add(directEditAction.getId());
  IAction copyAction=new GEFCopyAction(this);
  getActionRegistry().registerAction(copyAction);
  getSelectionActions().add(copyAction.getId());
  IAction pasteAction=new GEFPasteAction(this);
  getActionRegistry().registerAction(pasteAction);
  getSelectionActions().add(pasteAction.getId());
  IAction deleteAction=new GEFDeleteAction(this);
  getActionRegistry().registerAction(deleteAction);
  getSelectionActions().add(deleteAction.getId());
  IAction undoAction=new GEFUndoAction(this);
  getActionRegistry().registerAction(undoAction);
  getSelectionActions().add(undoAction.getId());
  IAction redoAction=new GEFRedoAction(this);
  getActionRegistry().registerAction(redoAction);
  getSelectionActions().add(redoAction.getId());
  IAction setRefAction=new ConnectionSetAsMainRef(this);
  getActionRegistry().registerAction(setRefAction);
  getSelectionActions().add(setRefAction.getId());
  IAction modifyMergeAction=new ModifyMergeOrderAction(this);
  getActionRegistry().registerAction(modifyMergeAction);
  getSelectionActions().add(modifyMergeAction.getId());
  IAction modifyOutputOrderAction=new ModifyOutputOrderAction(this);
  getActionRegistry().registerAction(modifyOutputOrderAction);
  getSelectionActions().add(modifyOutputOrderAction.getId());
  List<IAction> calcOrderActions=ModifyConnectionOrderAction.getOrderActions(this);
  for (  IAction orderAction : calcOrderActions) {
    getActionRegistry().registerAction(orderAction);
    getSelectionActions().add(orderAction.getId());
  }
  viewer.setRootEditPart(root);
  PartFactory partFactory=new PartFactory();
  getGraphicalViewer().setEditPartFactory(partFactory);
  getGraphicalViewer().setKeyHandler(new NodePartKeyHander(getGraphicalViewer()).setParent(getCommonKeyHandler()));
  initializeActivationCodeTrigger();
  ContextMenuProvider cmProvider=new TalendEditorContextMenuProvider(this,viewer,getActionRegistry());
  viewer.setContextMenu(cmProvider);
  getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1),MouseWheelZoomHandler.SINGLETON);
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SPACING,new Dimension(AbstractTalendEditor.GRID_SIZE,AbstractTalendEditor.GRID_SIZE));
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED,new Boolean(true));
  getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE,new Boolean(true));
  IAction showGrid=new ToggleGridAction(getGraphicalViewer());
  getActionRegistry().registerAction(showGrid);
  getGraphicalViewer().setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED,new Boolean(false));
  IAction snapAction=new ToggleSnapToGeometryAction(getGraphicalViewer());
  getActionRegistry().registerAction(snapAction);
  if (getProcess().isSubjobEnabled()) {
    IAction toggleSubjobsAction=ToggleSubjobsAction.getDefault();
    getActionRegistry().registerAction(toggleSubjobsAction);
    for (Iterator iterator=getSelectionActions().iterator(); iterator.hasNext(); ) {
      String actionID=(String)iterator.next();
      IAction action=getActionRegistry().getAction(actionID);
      setAction(actionID,action);
    }
  }
}