Program: 72211
Project: 72211
Buggy source:
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans("String_Node_Str");
  TabularCubeHandle cube=(TabularCubeHandle)transfer;
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (cube.getModuleHandle() != moduleHandle && cube.getRoot() instanceof LibraryHandle) {
    try {
      UIUtil.includeLibrary(moduleHandle,(LibraryHandle)cube.getRoot());
      cube=(TabularCubeHandle)moduleHandle.getElementFactory().newElementFrom(cube,cube.getName());
      moduleHandle.getCubes().add(cube);
    }
 catch (    Exception e) {
      stack.rollback();
      return false;
    }
  }
  ExtendedItemHandle handle=null;
  String name=ReportPlugin.getDefault().getCustomName(ICrosstabConstants.CROSSTAB_EXTENSION_NAME);
  try {
    handle=CrosstabExtendedItemFactory.createCrosstabReportItem(SessionHandleAdapter.getInstance().getReportDesignHandle(),null,name);
  }
 catch (  Exception e) {
    stack.rollback();
    return false;
  }
  if (target instanceof EditPart) {
    EditPart editPart=(EditPart)target;
    if (editPart != null) {
      try {
        CreateRequest request=new CreateRequest();
        request.getExtendedData().put(DesignerConstants.KEY_NEWOBJECT,handle);
        request.setLocation(location.getPoint());
        Command command=editPart.getCommand(request);
        if (command != null && command.canExecute()) {
          editPart.getViewer().getEditDomain().getCommandStack().execute(command);
          handle.setProperty(IReportItemModel.CUBE_PROP,cube);
          List dimensions=cube.getContents(CubeHandle.DIMENSIONS_PROP);
          for (Iterator iterator=dimensions.iterator(); iterator.hasNext(); ) {
            TabularDimensionHandle dimension=(TabularDimensionHandle)iterator.next();
            if (dimension.isTimeType()) {
              createDimensionViewHandle(handle,dimension,ICrosstabConstants.COLUMN_AXIS_TYPE);
            }
 else {
              createDimensionViewHandle(handle,dimension,ICrosstabConstants.ROW_AXIS_TYPE);
            }
          }
          List measureGroups=cube.getContents(CubeHandle.MEASURE_GROUPS_PROP);
          int index=0;
          for (Iterator iterator=measureGroups.iterator(); iterator.hasNext(); ) {
            MeasureGroupHandle measureGroup=(MeasureGroupHandle)iterator.next();
            List measures=measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP);
            for (int j=0; j < measures.size(); j++) {
              Object temp=measures.get(j);
              if (temp instanceof MeasureHandle) {
                addMeasureHandle(handle,(MeasureHandle)temp,index++);
              }
            }
          }
          stack.commit();
          return true;
        }
      }
 catch (      Exception e) {
        stack.rollback();
        return false;
      }
    }
  }
  Map map=new HashMap();
  map.put(DesignerConstants.KEY_NEWOBJECT,handle);
  CreateCommand command=new CreateCommand(map);
  try {
    SlotHandle parentModel=getTargetSlotHandle(target,ICrosstabConstants.CROSSTAB_EXTENSION_NAME);
    if (parentModel != null) {
      command.setParent(parentModel);
    }
 else {
      command.setParent(SessionHandleAdapter.getInstance().getReportDesignHandle());
    }
    command.execute();
    handle.setProperty(IReportItemModel.CUBE_PROP,cube);
    List dimensions=cube.getContents(CubeHandle.DIMENSIONS_PROP);
    for (Iterator iterator=dimensions.iterator(); iterator.hasNext(); ) {
      TabularDimensionHandle dimension=(TabularDimensionHandle)iterator.next();
      if (dimension.isTimeType()) {
        createDimensionViewHandle(handle,dimension,ICrosstabConstants.COLUMN_AXIS_TYPE);
      }
 else {
        createDimensionViewHandle(handle,dimension,ICrosstabConstants.ROW_AXIS_TYPE);
      }
    }
    List measureGroups=cube.getContents(CubeHandle.MEASURE_GROUPS_PROP);
    int index=0;
    for (Iterator iterator=measureGroups.iterator(); iterator.hasNext(); ) {
      MeasureGroupHandle measureGroup=(MeasureGroupHandle)iterator.next();
      List measures=measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP);
      for (int j=0; j < measures.size(); j++) {
        Object temp=measures.get(j);
        if (temp instanceof MeasureHandle) {
          addMeasureHandle(handle,(MeasureHandle)temp,index++);
        }
      }
    }
    stack.commit();
    if (target instanceof EditPart) {
      ((EditPart)target).getViewer().flush();
    }
    ReportRequest request=new ReportRequest();
    List selectionObjects=new ArrayList();
    selectionObjects.add(handle);
    request.setSelectionObject(selectionObjects);
    request.setType(ReportRequest.SELECTION);
    SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
    if (SessionHandleAdapter.getInstance().getReportDesignHandle() instanceof LibraryHandle) {
      HandleAdapterFactory.getInstance().getLibraryHandleAdapter().setCurrentEditorModel(handle,LibraryHandleAdapter.CREATE_ELEMENT);
    }
  }
 catch (  Exception e) {
    stack.rollback();
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
  stack.startTrans("String_Node_Str");
  TabularCubeHandle cube=(TabularCubeHandle)transfer;
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (cube.getModuleHandle() != moduleHandle && cube.getRoot() instanceof LibraryHandle) {
    try {
      UIUtil.includeLibrary(moduleHandle,(LibraryHandle)cube.getRoot());
      cube=(TabularCubeHandle)moduleHandle.getElementFactory().newElementFrom(cube,cube.getName());
      moduleHandle.getCubes().add(cube);
    }
 catch (    Exception e) {
      stack.rollback();
      return false;
    }
  }
  ExtendedItemHandle handle=null;
  String name=ReportPlugin.getDefault().getCustomName(ICrosstabConstants.CROSSTAB_EXTENSION_NAME);
  try {
    handle=CrosstabExtendedItemFactory.createCrosstabReportItem(SessionHandleAdapter.getInstance().getReportDesignHandle(),null,name);
  }
 catch (  Exception e) {
    stack.rollback();
    return false;
  }
  if (target instanceof EditPart) {
    EditPartViewer viewer=((EditPart)target).getViewer();
    EditPart editPart=(EditPart)target;
    if (editPart != null) {
      try {
        CreateRequest request=new CreateRequest();
        request.getExtendedData().put(DesignerConstants.KEY_NEWOBJECT,handle);
        request.setLocation(location.getPoint());
        Command command=editPart.getCommand(request);
        if (command != null && command.canExecute()) {
          viewer.getEditDomain().getCommandStack().execute(command);
          handle.setProperty(IReportItemModel.CUBE_PROP,cube);
          List dimensions=cube.getContents(CubeHandle.DIMENSIONS_PROP);
          for (Iterator iterator=dimensions.iterator(); iterator.hasNext(); ) {
            TabularDimensionHandle dimension=(TabularDimensionHandle)iterator.next();
            if (dimension.isTimeType()) {
              createDimensionViewHandle(handle,dimension,ICrosstabConstants.COLUMN_AXIS_TYPE);
            }
 else {
              createDimensionViewHandle(handle,dimension,ICrosstabConstants.ROW_AXIS_TYPE);
            }
          }
          List measureGroups=cube.getContents(CubeHandle.MEASURE_GROUPS_PROP);
          int index=0;
          for (Iterator iterator=measureGroups.iterator(); iterator.hasNext(); ) {
            MeasureGroupHandle measureGroup=(MeasureGroupHandle)iterator.next();
            List measures=measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP);
            for (int j=0; j < measures.size(); j++) {
              Object temp=measures.get(j);
              if (temp instanceof MeasureHandle) {
                addMeasureHandle(handle,(MeasureHandle)temp,index++);
              }
            }
          }
          stack.commit();
          viewer.flush();
          viewer.getControl().setFocus();
          ReportCreationTool.selectAddedObject(handle,viewer);
          return true;
        }
      }
 catch (      Exception e) {
        stack.rollback();
        return false;
      }
    }
  }
  Map map=new HashMap();
  map.put(DesignerConstants.KEY_NEWOBJECT,handle);
  CreateCommand command=new CreateCommand(map);
  try {
    SlotHandle parentModel=getTargetSlotHandle(target,ICrosstabConstants.CROSSTAB_EXTENSION_NAME);
    if (parentModel != null) {
      command.setParent(parentModel);
    }
 else {
      command.setParent(SessionHandleAdapter.getInstance().getReportDesignHandle());
    }
    command.execute();
    handle.setProperty(IReportItemModel.CUBE_PROP,cube);
    List dimensions=cube.getContents(CubeHandle.DIMENSIONS_PROP);
    for (Iterator iterator=dimensions.iterator(); iterator.hasNext(); ) {
      TabularDimensionHandle dimension=(TabularDimensionHandle)iterator.next();
      if (dimension.isTimeType()) {
        createDimensionViewHandle(handle,dimension,ICrosstabConstants.COLUMN_AXIS_TYPE);
      }
 else {
        createDimensionViewHandle(handle,dimension,ICrosstabConstants.ROW_AXIS_TYPE);
      }
    }
    List measureGroups=cube.getContents(CubeHandle.MEASURE_GROUPS_PROP);
    int index=0;
    for (Iterator iterator=measureGroups.iterator(); iterator.hasNext(); ) {
      MeasureGroupHandle measureGroup=(MeasureGroupHandle)iterator.next();
      List measures=measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP);
      for (int j=0; j < measures.size(); j++) {
        Object temp=measures.get(j);
        if (temp instanceof MeasureHandle) {
          addMeasureHandle(handle,(MeasureHandle)temp,index++);
        }
      }
    }
    stack.commit();
    if (target instanceof EditPart) {
      ((EditPart)target).getViewer().flush();
    }
    ReportRequest request=new ReportRequest();
    List selectionObjects=new ArrayList();
    selectionObjects.add(handle);
    request.setSelectionObject(selectionObjects);
    request.setType(ReportRequest.SELECTION);
    SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
    if (SessionHandleAdapter.getInstance().getReportDesignHandle() instanceof LibraryHandle) {
      HandleAdapterFactory.getInstance().getLibraryHandleAdapter().setCurrentEditorModel(handle,LibraryHandleAdapter.CREATE_ELEMENT);
    }
  }
 catch (  Exception e) {
    stack.rollback();
    return false;
  }
  return true;
}