Program: 129847
Project: 129847
Buggy source:
public void drop(DropTargetEvent event){
  DropTarget dropTarget=(DropTarget)event.getSource();
  Control control=dropTarget.getControl();
  XmlToSchemaDraggedData draggedData=XPathTransfer.getInstance().getDraggedData();
  List<TransferableXPathEntry> transferableEntryList=draggedData.getTransferableEntryList();
  ExtractionFieldsWithMDMEditorView mdmEditorView=linker.getFieldsTableEditorView();
  ExtractionLoopWithMDMEditorView loopTableEditorView=linker.getLoopTableEditorView();
  if (loopTableEditorView.isReadOnly()) {
    return;
  }
  ExtendedTableModel<Concept> extendedTableModel=loopTableEditorView.getExtendedTableModel();
  List<ConceptTarget> fullSchemaTargetList=new ArrayList<ConceptTarget>(mdmEditorView.getModel().getBeansList());
  Concept concept=extendedTableModel.getBeansList().get(0);
  if (linker.isLoopTable((Table)control)) {
    if (transferableEntryList.size() > 0) {
      String absoluteXPath=transferableEntryList.get(0).getAbsoluteXPath();
      TableViewerCreatorColumn xpathColumn=linker.getLoopTableEditorView().getXPathColumn();
      Display display=linker.getTree().getDisplay();
      Cursor cursor=new Cursor(display,SWT.CURSOR_WAIT);
      linker.getTree().getShell().setCursor(cursor);
      loopTableEditorView.getTableViewerCreator().setBeanValue(xpathColumn,concept,absoluteXPath,true);
      linker.getTree().getShell().setCursor(null);
    }
  }
 else {
    ExtractionFieldsWithMDMEditorView tableEditorView=linker.getFieldsTableEditorView();
    Integer startInsertAtThisIndex=TableUtils.getItemIndexWhereInsertFromPosition(fieldsTable,new Point(event.x,event.y));
    List<ConceptTarget> list=new ArrayList<ConceptTarget>(transferableEntryList.size());
    for (    TransferableXPathEntry entry : transferableEntryList) {
      ArrayList<String> loopXpathNodes=linker.getLoopXpathNodes();
      if (loopXpathNodes.size() > 0) {
        String loopPath=loopXpathNodes.get(0);
        String relativeXPath=XPathPopulationUtil.populateColumnPath(loopPath,entry.getAbsoluteXPath());
        if (relativeXPath == null) {
          continue;
        }
        if (relativeXPath.startsWith("String_Node_Str")) {
          relativeXPath=relativeXPath.substring(1);
        }
        if (relativeXPath.endsWith("String_Node_Str")) {
          relativeXPath=relativeXPath.substring(0,relativeXPath.length() - 1);
        }
        if (relativeXPath.trim().equals("String_Node_Str")) {
          relativeXPath="String_Node_Str";
        }
        ConceptTarget newTargetEntry=linker.getNewSchemaTargetEntry(relativeXPath);
        String name=extractColumnName(extractTagName(relativeXPath),fullSchemaTargetList);
        newTargetEntry.setTargetName(name);
        list.add(newTargetEntry);
        fullSchemaTargetList.add(newTargetEntry);
      }
    }
    tableEditorView.getTableViewerCreator().getTableViewer().refresh();
    loopTable.deselectAll();
    fieldsTable.deselectAll();
    linker.getTree().deselectAll();
    if (list.size() > 0) {
      ExtendedTableAddCommand addCommand=new ExtendedTableAddCommand(tableEditorView.getModel(),list,startInsertAtThisIndex);
      tableEditorView.getExtendedTableViewer().executeCommand(addCommand);
    }
  }
  linker.updateLinksStyleAndControlsSelection(control,true);
}

Fixed version (ground truth):
public void drop(DropTargetEvent event){
  DropTarget dropTarget=(DropTarget)event.getSource();
  Control control=dropTarget.getControl();
  XmlToSchemaDraggedData draggedData=XPathTransfer.getInstance().getDraggedData();
  List<TransferableXPathEntry> transferableEntryList=draggedData.getTransferableEntryList();
  ExtractionFieldsWithMDMEditorView mdmEditorView=linker.getFieldsTableEditorView();
  ExtractionLoopWithMDMEditorView loopTableEditorView=linker.getLoopTableEditorView();
  if (loopTableEditorView.isReadOnly()) {
    return;
  }
  ExtendedTableModel<Concept> extendedTableModel=loopTableEditorView.getExtendedTableModel();
  List<ConceptTarget> fullSchemaTargetList=new ArrayList<ConceptTarget>(mdmEditorView.getModel().getBeansList());
  Concept concept=extendedTableModel.getBeansList().get(0);
  if (linker.isLoopTable((Table)control)) {
    if (transferableEntryList.size() > 0) {
      String absoluteXPath=transferableEntryList.get(0).getAbsoluteXPath();
      TableViewerCreatorColumn xpathColumn=linker.getLoopTableEditorView().getXPathColumn();
      Display display=linker.getTree().getDisplay();
      Cursor cursor=new Cursor(display,SWT.CURSOR_WAIT);
      linker.getTree().getShell().setCursor(cursor);
      loopTableEditorView.getTableViewerCreator().setBeanValue(xpathColumn,concept,absoluteXPath,true);
      linker.getTree().getShell().setCursor(null);
    }
  }
 else {
    ExtractionFieldsWithMDMEditorView tableEditorView=linker.getFieldsTableEditorView();
    Integer startInsertAtThisIndex=TableUtils.getItemIndexWhereInsertFromPosition(fieldsTable,new Point(event.x,event.y));
    List<ConceptTarget> list=new ArrayList<ConceptTarget>(transferableEntryList.size());
    for (    TransferableXPathEntry entry : transferableEntryList) {
      ArrayList<String> loopXpathNodes=linker.getLoopXpathNodes();
      if (loopXpathNodes.size() > 0) {
        String loopPath=loopXpathNodes.get(0);
        String relativeXPath=XPathPopulationUtil.populateColumnPath(loopPath,entry.getAbsoluteXPath());
        if (relativeXPath == null) {
          continue;
        }
        if (relativeXPath.startsWith("String_Node_Str")) {
          relativeXPath=relativeXPath.substring(1);
        }
        if (relativeXPath.endsWith("String_Node_Str")) {
          relativeXPath=relativeXPath.substring(0,relativeXPath.length() - 1);
        }
        if (relativeXPath.trim().equals("String_Node_Str")) {
          relativeXPath="String_Node_Str";
        }
        ConceptTarget newTargetEntry=linker.getNewSchemaTargetEntry(relativeXPath);
        String name="String_Node_Str";
        if ("String_Node_Str".equals(relativeXPath)) {
          if (entry.getAbsoluteXPath() != null) {
            String[] split=entry.getAbsoluteXPath().split("String_Node_Str");
            name=extractColumnName(extractTagName(split[split.length - 1]),fullSchemaTargetList);
          }
        }
 else {
          name=extractColumnName(extractTagName(relativeXPath),fullSchemaTargetList);
        }
        newTargetEntry.setTargetName(name);
        list.add(newTargetEntry);
        fullSchemaTargetList.add(newTargetEntry);
      }
    }
    tableEditorView.getTableViewerCreator().getTableViewer().refresh();
    loopTable.deselectAll();
    fieldsTable.deselectAll();
    linker.getTree().deselectAll();
    if (list.size() > 0) {
      ExtendedTableAddCommand addCommand=new ExtendedTableAddCommand(tableEditorView.getModel(),list,startInsertAtThisIndex);
      tableEditorView.getExtendedTableViewer().executeCommand(addCommand);
    }
  }
  linker.updateLinksStyleAndControlsSelection(control,true);
}