Program: 122827
Project: 122827
Buggy source:
public void createNewComponent(DropTargetEvent event1){
  boolean quickCreateInput=event1.detail == DND.DROP_LINK;
  boolean quickCreateOutput=event1.detail == DND.DROP_COPY;
  Iterator iterator=getSelection().iterator();
  List<TempStore> list=new ArrayList<TempStore>();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof RepositoryNode) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      if (equalsJobInCurrentEditor(sourceNode)) {
        continue;
      }
      Item item=sourceNode.getObject().getProperty().getItem();
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (!(item instanceof ConnectionItem) && !(item instanceof ProcessItem) && !(item instanceof JobletProcessItem)&& !(item instanceof RulesItem)&& !(item instanceof LinkRulesItem)) {
        return;
      }
      if (item instanceof SalesforceSchemaConnectionItem && type == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
        return;
      }
      TempStore store=new TempStore();
      store.seletetedNode=sourceNode;
      getAppropriateComponent(item,quickCreateInput,quickCreateOutput,store,type);
      if (store.component != null) {
        list.add(store);
      }
 else {
        MessageDialog.openInformation(editor.getEditorSite().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      }
    }
    org.eclipse.swt.graphics.Point swtLocation=new org.eclipse.swt.graphics.Point(event1.x,event1.y);
    Canvas canvas=(Canvas)editor.getViewer().getControl();
    swtLocation=canvas.toControl(swtLocation);
    org.eclipse.swt.graphics.Point size=canvas.getSize();
    org.eclipse.draw2d.geometry.Point draw2dPosition=new org.eclipse.draw2d.geometry.Point(swtLocation.x,swtLocation.y);
    ProcessPart part=(ProcessPart)editor.getViewer().getRootEditPart().getRoot().getChildren().get(0);
    IFigure targetFigure=part.getFigure();
    translateAbsolateToRelative(targetFigure,draw2dPosition);
    String lastUniqname="String_Node_Str";
    for (Iterator<TempStore> iter=list.iterator(); iter.hasNext(); ) {
      TempStore store=iter.next();
      RepositoryNode selectedNode=store.seletetedNode;
      IComponent element=store.component;
      Node node=new Node(element);
      IPreferenceStore preferenceStore=DesignerPlugin.getDefault().getPreferenceStore();
      if (preferenceStore.getBoolean(TalendDesignerPrefConstants.USE_REPOSITORY_NAME)) {
        String LabelValue=null;
        RepositoryNode repositoryNode=null;
        repositoryNode=(RepositoryNode)getSelection().getFirstElement();
        IElementParameter dbTableParam=node.getElementParameterFromField(EParameterFieldType.DBTABLE);
        boolean hasDbTableField=dbTableParam != null;
        if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CON_TABLE && repositoryNode.getObject() != null && repositoryNode.getObject().getProperty().getItem() instanceof DatabaseConnectionItem && hasDbTableField) {
          LabelValue=DesignerUtilities.getParameterVar(dbTableParam.getName());
        }
 else         if (repositoryNode.getObjectType() == ERepositoryObjectType.PROCESS) {
          LabelValue=DesignerUtilities.getParameterVar(EParameterName.PROCESS);
        }
 else         if (CorePlugin.getDefault().getDesignerCoreService().getPreferenceStore(TalendDesignerPrefConstants.DEFAULT_LABEL).equals(node.getPropertyValue(EParameterName.LABEL.getName()))) {
          LabelValue=selectedNode.getObject().getLabel();
        }
        if (LabelValue != null) {
          node.setPropertyValue(EParameterName.LABEL.getName(),LabelValue);
        }
      }
      processSpecificDBTypeIfSameProduct(store.componentName,node);
      NodeContainer nc=null;
      if (node.isJoblet()) {
        nc=new JobletContainer(node);
      }
 else {
        nc=new NodeContainer(node);
      }
      boolean executed=false;
      if (getSelection().size() == 1 && getTargetEditPart() instanceof SubjobContainerPart) {
        executed=createComponentOnLink(node,draw2dPosition);
      }
      if (!executed) {
        execCommandStack(new CreateNodeContainerCommand((Process)editor.getProcess(),nc,draw2dPosition));
      }
      List<Command> commands=createRefreshingPropertiesCommand(selectedNode,node);
      for (      Command command : commands) {
        execCommandStack(command);
      }
      draw2dPosition=draw2dPosition.getCopy();
      draw2dPosition.x+=TalendEditor.GRID_SIZE;
      draw2dPosition.y+=TalendEditor.GRID_SIZE;
      node.checkNode();
      lastUniqname=node.getUniqueName();
    }
  }
}

Fixed version (ground truth):
public void createNewComponent(DropTargetEvent event1){
  boolean quickCreateInput=event1.detail == DND.DROP_LINK;
  boolean quickCreateOutput=event1.detail == DND.DROP_COPY;
  Iterator iterator=getSelection().iterator();
  List<TempStore> list=new ArrayList<TempStore>();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof RepositoryNode) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      if (equalsJobInCurrentEditor(sourceNode)) {
        continue;
      }
      Item item=sourceNode.getObject().getProperty().getItem();
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (!(item instanceof ConnectionItem) && !(item instanceof ProcessItem) && !(item instanceof JobletProcessItem)&& !(item instanceof RulesItem)&& !(item instanceof LinkRulesItem)) {
        return;
      }
      if (item instanceof SalesforceSchemaConnectionItem && type == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
        return;
      }
      TempStore store=new TempStore();
      store.seletetedNode=sourceNode;
      getAppropriateComponent(item,quickCreateInput,quickCreateOutput,store,type);
      if (store.component != null) {
        list.add(store);
      }
 else {
        MessageDialog.openInformation(editor.getEditorSite().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      }
    }
    org.eclipse.swt.graphics.Point swtLocation=new org.eclipse.swt.graphics.Point(event1.x,event1.y);
    Canvas canvas=(Canvas)editor.getViewer().getControl();
    swtLocation=canvas.toControl(swtLocation);
    org.eclipse.swt.graphics.Point size=canvas.getSize();
    org.eclipse.draw2d.geometry.Point draw2dPosition=new org.eclipse.draw2d.geometry.Point(swtLocation.x,swtLocation.y);
    ProcessPart part=(ProcessPart)editor.getViewer().getRootEditPart().getRoot().getChildren().get(0);
    IFigure targetFigure=part.getFigure();
    translateAbsolateToRelative(targetFigure,draw2dPosition);
    String lastUniqname="String_Node_Str";
    for (    TempStore store : list) {
      RepositoryNode selectedNode=store.seletetedNode;
      IComponent element=store.component;
      Node node=new Node(element);
      IPreferenceStore preferenceStore=DesignerPlugin.getDefault().getPreferenceStore();
      if (preferenceStore.getBoolean(TalendDesignerPrefConstants.USE_REPOSITORY_NAME)) {
        String LabelValue=null;
        RepositoryNode repositoryNode=null;
        repositoryNode=(RepositoryNode)getSelection().getFirstElement();
        IElementParameter dbTableParam=node.getElementParameterFromField(EParameterFieldType.DBTABLE);
        boolean hasDbTableField=dbTableParam != null;
        if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CON_TABLE && repositoryNode.getObject() != null && repositoryNode.getObject().getProperty().getItem() instanceof DatabaseConnectionItem && hasDbTableField) {
          LabelValue=DesignerUtilities.getParameterVar(dbTableParam.getName());
        }
 else         if (repositoryNode.getObjectType() == ERepositoryObjectType.PROCESS) {
          LabelValue=DesignerUtilities.getParameterVar(EParameterName.PROCESS);
        }
 else         if (CorePlugin.getDefault().getDesignerCoreService().getPreferenceStore(TalendDesignerPrefConstants.DEFAULT_LABEL).equals(node.getPropertyValue(EParameterName.LABEL.getName()))) {
          LabelValue=selectedNode.getObject().getLabel();
        }
        if (LabelValue != null) {
          node.setPropertyValue(EParameterName.LABEL.getName(),LabelValue);
        }
      }
      processSpecificDBTypeIfSameProduct(store.componentName,node);
      NodeContainer nc=null;
      if (node.isJoblet()) {
        nc=new JobletContainer(node);
      }
 else {
        nc=new NodeContainer(node);
      }
      boolean executed=false;
      if (getSelection().size() == 1 && getTargetEditPart() instanceof SubjobContainerPart) {
        executed=createComponentOnLink(node,draw2dPosition);
      }
      if (!executed) {
        execCommandStack(new CreateNodeContainerCommand((Process)editor.getProcess(),nc,draw2dPosition));
      }
      List<Command> commands=createRefreshingPropertiesCommand(selectedNode,node);
      for (      Command command : commands) {
        execCommandStack(command);
      }
      draw2dPosition=draw2dPosition.getCopy();
      draw2dPosition.x+=TalendEditor.GRID_SIZE;
      draw2dPosition.y+=TalendEditor.GRID_SIZE;
      node.checkNode();
      lastUniqname=node.getUniqueName();
    }
  }
}