private static @NotNull String getMessageWithReason(@NotNull PsiElement element,
                                                      @Nullable String message,
                                                      boolean recursiveInvocation,
                                                      @Nullable Object trace) {
    @NonNls String reason = "Element: " + element.getClass();
    if (!recursiveInvocation) {
      try {
        reason += " #" + getLanguage(element).getID() + " ";
      }
      catch (PsiInvalidElementAccessException ignore) { }
      String traceText = !isTrackingInvalidation() ? "disabled" :
                         trace != null ? "see attachment" :
                         "no info";
      try {
        reason += " because: " + findOutInvalidationReason(element);
      }
      catch (PsiInvalidElementAccessException ignore) { }
      reason += "\ninvalidated at: " + traceText;
    }
    return reason + (message == null ? "" : "; " + message);
  }
private static @NotNull String getMessageWithReason(@NotNull PsiElement element,
                                                      @Nullable String message,
                                                      boolean recursiveInvocation,
                                                      @Nullable Object trace)