Program: 122833
Project: 122833
Buggy source:
public void dragOver(DropTargetEvent event){
  IStructuredSelection selection=getSelection();
  if (selection.size() > 1) {
    boolean allowed=true;
    Item temItem=null;
    Iterator iter=selection.iterator();
    while (iter.hasNext()) {
      Object next=iter.next();
      if (next instanceof RepositoryNode) {
        RepositoryNode sourceNode=(RepositoryNode)next;
        IRepositoryViewObject object=sourceNode.getObject();
        if (object != null) {
          Item selectItem=object.getProperty().getItem();
          if (temItem == null) {
            temItem=selectItem;
            continue;
          }
          if (selectItem instanceof ProcessItem && !(temItem instanceof ProcessItem)) {
            allowed=false;
          }
 else           if (selectItem instanceof ContextItem && !(temItem instanceof ContextItem)) {
            allowed=false;
          }
 else           if (selectItem instanceof SQLPatternItem && !(temItem instanceof SQLPatternItem)) {
            allowed=false;
          }
        }
      }
    }
    if (!allowed) {
      event.detail=DND.DROP_NONE;
    }
  }
 else {
    CreateRequest req=((CreateRequest)getTargetRequest());
    Object o=null;
    try {
      o=req.getNewObject();
    }
 catch (    Exception e) {
      return;
    }
    if (!(o instanceof Node)) {
      return;
    }
    RootEditPart rep=editor.getViewer().getRootEditPart().getRoot();
    Point viewOriginalPosition=new Point();
    if (rep instanceof ScalableFreeformRootEditPart) {
      ScalableFreeformRootEditPart root=(ScalableFreeformRootEditPart)rep;
      Viewport viewport=(Viewport)root.getFigure();
      viewOriginalPosition=viewport.getViewLocation();
    }
    org.eclipse.swt.graphics.Point swtLocation=new org.eclipse.swt.graphics.Point(event.x + viewOriginalPosition.x,event.y + viewOriginalPosition.y);
    Canvas canvas=(Canvas)editor.getViewer().getControl();
    swtLocation=canvas.toControl(swtLocation);
    org.eclipse.draw2d.geometry.Point draw2dPosition=new org.eclipse.draw2d.geometry.Point(swtLocation.x,swtLocation.y);
    SubjobContainerPart containerPart=(SubjobContainerPart)getTargetEditPart();
    for (    Object child : editor.getProcessPart().getChildren()) {
      if (child instanceof SubjobContainerPart) {
        SubjobContainer container=(SubjobContainer)((SubjobContainerPart)child).getModel();
        if (container.getSubjobContainerRectangle().contains(draw2dPosition)) {
          containerPart=(SubjobContainerPart)child;
        }
      }
    }
    if (containerPart != null) {
      List<org.talend.designer.core.ui.editor.connections.Connection> connections=CreateComponentOnLinkHelper.getConnection(containerPart,draw2dPosition,(Node)o);
      for (      org.talend.designer.core.ui.editor.connections.Connection connection : connections) {
        CreateComponentOnLinkHelper.selectConnection(connection,containerPart);
      }
      if (connections.isEmpty()) {
        CreateComponentOnLinkHelper.unselectAllConnections(containerPart);
      }
    }
 else {
      for (      Object child : editor.getProcessPart().getChildren()) {
        if (child instanceof SubjobContainerPart) {
          CreateComponentOnLinkHelper.unselectAllConnections((SubjobContainerPart)child);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void dragOver(DropTargetEvent event){
  IStructuredSelection selection=getSelection();
  if (selection.size() > 1) {
    boolean allowed=true;
    Item temItem=null;
    Iterator iter=selection.iterator();
    while (iter.hasNext()) {
      Object next=iter.next();
      if (next instanceof RepositoryNode) {
        RepositoryNode sourceNode=(RepositoryNode)next;
        IRepositoryViewObject object=sourceNode.getObject();
        if (object != null) {
          Item selectItem=object.getProperty().getItem();
          if (temItem == null) {
            temItem=selectItem;
            continue;
          }
          if (selectItem instanceof ProcessItem && !(temItem instanceof ProcessItem)) {
            allowed=false;
          }
 else           if (selectItem instanceof ContextItem && !(temItem instanceof ContextItem)) {
            allowed=false;
          }
 else           if (selectItem instanceof SQLPatternItem && !(temItem instanceof SQLPatternItem)) {
            allowed=false;
          }
        }
      }
    }
    if (!allowed) {
      event.detail=DND.DROP_NONE;
    }
  }
 else {
    CreateRequest req=((CreateRequest)getTargetRequest());
    Object o=null;
    try {
      o=req.getNewObject();
    }
 catch (    Exception e) {
      return;
    }
    if (!(o instanceof Node)) {
      return;
    }
    RootEditPart rep=editor.getViewer().getRootEditPart().getRoot();
    Point viewOriginalPosition=new Point();
    if (rep instanceof ScalableFreeformRootEditPart) {
      ScalableFreeformRootEditPart root=(ScalableFreeformRootEditPart)rep;
      Viewport viewport=(Viewport)root.getFigure();
      viewOriginalPosition=viewport.getViewLocation();
    }
    org.eclipse.swt.graphics.Point swtLocation=new org.eclipse.swt.graphics.Point(event.x + viewOriginalPosition.x,event.y + viewOriginalPosition.y);
    Canvas canvas=(Canvas)editor.getViewer().getControl();
    swtLocation=canvas.toControl(swtLocation);
    org.eclipse.draw2d.geometry.Point draw2dPosition=new org.eclipse.draw2d.geometry.Point(swtLocation.x,swtLocation.y);
    SubjobContainerPart containerPart=(SubjobContainerPart)getTargetEditPart();
    for (    Object child : editor.getProcessPart().getChildren()) {
      if (child instanceof SubjobContainerPart) {
        SubjobContainer container=(SubjobContainer)((SubjobContainerPart)child).getModel();
        if (container.getSubjobContainerRectangle().contains(draw2dPosition)) {
          containerPart=(SubjobContainerPart)child;
        }
      }
    }
    if (containerPart != null) {
      List<org.talend.designer.core.ui.editor.connections.Connection> connections=CreateComponentOnLinkHelper.getConnection(containerPart,draw2dPosition,(Node)o);
      for (      org.talend.designer.core.ui.editor.connections.Connection connection : connections) {
        CreateComponentOnLinkHelper.selectConnection(connection,containerPart);
      }
      if (connections.isEmpty()) {
        CreateComponentOnLinkHelper.unselectAllConnections(containerPart);
      }
    }
 else {
      for (      Object child : editor.getProcessPart().getChildren()) {
        if (child instanceof SubjobContainerPart) {
          CreateComponentOnLinkHelper.unselectAllConnections((SubjobContainerPart)child);
        }
      }
    }
  }
}