private @NotNull SemServiceImpl.SemData getCacheHolder(@NotNull PsiElement psi) {
    SemData cacheHolder = psi.getUserData(SEM_CACHE_KEY);
    if (cacheHolder != null) {
      return cacheHolder;
    }

    if (psi instanceof UserDataHolderEx) {
      return ((UserDataHolderEx)psi).putUserDataIfAbsent(SEM_CACHE_KEY, new SemData(getModCount()));
    }

    SemData semData;
    //noinspection SynchronizationOnLocalVariableOrMethodParameter
    synchronized (psi) {
      semData = psi.getUserData(SEM_CACHE_KEY);
      if (semData == null) {
        semData = new SemData(getModCount());
        psi.putUserData(SEM_CACHE_KEY, semData);
      }
    }
    return semData;
  }
private @NotNull SemServiceImpl.SemData getCacheHolder(@NotNull PsiElement psi)