Program: 71290
Project: 71290
Buggy source:
protected boolean copyData(Object target,Object transfer){
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (transfer instanceof DataSetHandle) {
    target=moduleHandle.getDataSets();
  }
 else   if (transfer instanceof DataSourceHandle) {
    target=moduleHandle.getDataSources();
  }
 else   if (transfer instanceof ParameterHandle || transfer instanceof ParameterGroupHandle || transfer instanceof CascadingParameterGroupHandle) {
    target=moduleHandle.getParameters();
  }
 else   if (transfer instanceof CubeHandle) {
    target=moduleHandle.getCubes();
  }
  int position=getPosition(target);
  boolean result=false;
  if (transfer != null && transfer instanceof DesignElementHandle) {
    DesignElementHandle sourceHandle;
    if ((sourceHandle=(DesignElementHandle)transfer).getRoot() instanceof LibraryHandle) {
      LibraryHandle library=(LibraryHandle)sourceHandle.getRoot();
      try {
        if (moduleHandle != library) {
          if (UIUtil.includeLibrary(moduleHandle,library)) {
            DNDUtil.addElementHandle(target,moduleHandle.getElementFactory().newElementFrom(sourceHandle,sourceHandle.getName()));
            result=true;
          }
        }
 else {
          result=DNDUtil.copyHandles(transfer,target,position);
        }
      }
 catch (      Exception e) {
        ExceptionHandler.handle(e);
      }
    }
 else {
      result=DNDUtil.copyHandles(transfer,target,position);
    }
  }
 else   if (transfer != null && transfer instanceof EmbeddedImageHandle) {
    result=DNDUtil.copyHandles(transfer,target,position);
  }
  if (result) {
    viewer.reveal(target);
  }
  return result;
}

Fixed version (ground truth):
protected boolean copyData(Object target,Object transfer){
  ModuleHandle moduleHandle=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (transfer instanceof DataSetHandle) {
    target=moduleHandle.getDataSets();
  }
 else   if (transfer instanceof DataSourceHandle) {
    target=moduleHandle.getDataSources();
  }
 else   if (transfer instanceof ParameterHandle || transfer instanceof ParameterGroupHandle || transfer instanceof CascadingParameterGroupHandle) {
    target=moduleHandle.getParameters();
  }
 else   if (transfer instanceof CubeHandle) {
    target=moduleHandle.getCubes();
  }
 else   if (transfer instanceof MasterPageHandle) {
    target=moduleHandle.getMasterPages();
  }
  int position=getPosition(target);
  boolean result=false;
  if (transfer != null && transfer instanceof DesignElementHandle) {
    DesignElementHandle sourceHandle;
    if ((sourceHandle=(DesignElementHandle)transfer).getRoot() instanceof LibraryHandle) {
      LibraryHandle library=(LibraryHandle)sourceHandle.getRoot();
      try {
        if (moduleHandle != library) {
          if (UIUtil.includeLibrary(moduleHandle,library)) {
            DNDUtil.addElementHandle(target,moduleHandle.getElementFactory().newElementFrom(sourceHandle,sourceHandle.getName()));
            result=true;
          }
        }
 else {
          result=DNDUtil.copyHandles(transfer,target,position);
        }
      }
 catch (      Exception e) {
        ExceptionHandler.handle(e);
      }
    }
 else {
      result=DNDUtil.copyHandles(transfer,target,position);
    }
  }
 else   if (transfer != null && transfer instanceof EmbeddedImageHandle) {
    result=DNDUtil.copyHandles(transfer,target,position);
  }
  if (result) {
    viewer.reveal(target);
  }
  return result;
}