private @Nullable Object getSlowData(@NotNull String dataId, @NotNull List<Object> selection) {
      if (myCalcElementsThread != null) {
        return null;
      }

      if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
        Object element = ContainerUtil.getOnlyItem(selection);
        if (element instanceof PsiElement) {
          return element;
        }

        if (element instanceof DataProvider) {
          Object data = ((DataProvider)element).getData(dataId);
          return data == null ? null : DataValidators.validOrNull(data, dataId, element);
        }
      }
      else if (PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
        List<PsiElement> result = new ArrayList<>(selection.size());
        for (Object element : selection) {
          if (element instanceof PsiElement) {
            result.add((PsiElement)element);
          }
        }
        return PsiUtilCore.toPsiElementArray(result);
      }
      return null;
    }
private @Nullable Object getSlowData(@NotNull String dataId, @NotNull List<Object> selection)