<commit_before>package com.intellij.xml.breadcrumbs;

import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;

/**
 * @author spleaner
 */
public class BreadcrumbsPsiItem extends BreadcrumbsItem {
  private PsiElement myElement;
  private BreadcrumbsInfoProvider myProvider;

  public BreadcrumbsPsiItem(@NotNull final PsiElement element, @NotNull final BreadcrumbsInfoProvider provider) {
    myElement = element;
    myProvider = provider;
  }

  public String getDisplayText() {
    return myProvider.getElementInfo(myElement);
  }

  public String getTooltip() {
    final String s = myProvider.getElementTooltip(myElement);
    return s == null ? "" : s;
  }

  public boolean isValid() {
    return myElement != null && myElement.isValid();
  }

  public PsiElement getPsiElement() {
    return myElement;
  }
}<commit_msg>PIEAE while typing <% in JSP file<commit_after>package com.intellij.xml.breadcrumbs;

import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;

/**
 * @author spleaner
 */
public class BreadcrumbsPsiItem extends BreadcrumbsItem {
  private PsiElement myElement;
  private BreadcrumbsInfoProvider myProvider;

  public BreadcrumbsPsiItem(@NotNull final PsiElement element, @NotNull final BreadcrumbsInfoProvider provider) {
    myElement = element;
    myProvider = provider;
  }

  public String getDisplayText() {
    return isValid() ? myProvider.getElementInfo(myElement) : "INVALID";
  }

  public String getTooltip() {
    final String s = isValid() ? myProvider.getElementTooltip(myElement) : "";
    return s == null ? "" : s;
  }

  public boolean isValid() {
    return myElement != null && myElement.isValid();
  }

  public PsiElement getPsiElement() {
    return myElement;
  }
}
{'fraction_non_alphanumeric': 0.09642654566080544, 'fraction_numerical': 0.0, 'mean_word_length': 4.329305135951661, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4823738', 'n_tokens_mistral': 533, 'n_tokens_neox': 529, 'n_words': 128}