<commit_before>package com.intellij.util.xml.tree;

import jetbrains.fabrique.ui.treeStructure.SimpleNode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.xml.DomElement;
import com.intellij.util.xml.GenericValue;

import java.util.*;
import java.lang.reflect.Method;


public class BaseDomElementNode extends AbstractDomElementNode {
  static final private Logger LOG = Logger.getInstance(DomModelTreeStructure.class.getName());

  protected DomElement myDomlElement;
  protected String myTagName;

  public BaseDomElementNode(final DomElement modelElement) {
    this(modelElement, null, null);
  }

  public BaseDomElementNode(final DomElement modelElement, final String tagName, SimpleNode parent) {
    super(parent);

    myDomlElement = modelElement;
    myTagName = tagName == null ? "unknown" : tagName;
   }

  public SimpleNode[] getChildren() {
    List<SimpleNode> children = new ArrayList();

    final Collection<Method> methods = myDomlElement.getMethodsInfo().getFixedChildrenGetterMethods();

    for (Method method : methods) {
      try {
        final Object result = method.invoke(myDomlElement, new Object[0]);

        if (result instanceof DomElement) {
          final String tagName = myDomlElement.getMethodsInfo().getTagName(method);

          if (showGenericValues() && result instanceof GenericValue) {
             children.add(new GenericValueNode((GenericValue)result, tagName, this));
          } else {

            children.add(getDomElementNode((DomElement)result, tagName, this));
          }
        }
      }
      catch (Throwable e) {
        LOG.error(e);
      }
    }

    final Collection<Method> collectionMethods = myDomlElement.getMethodsInfo().getCollectionChildrenGetterMethods();

    for (Method method : collectionMethods) {
      children.add(getDomElementsGroupNode(myDomlElement, method));
    }

    AbstractDomElementNode[] childrenNodes = children.toArray(new AbstractDomElementNode[children.size()]);
    if (showOrdered()) {
      Arrays.sort(childrenNodes, getComparator());
    }

    return childrenNodes;
  }

  protected DomElementsGroupNode getDomElementsGroupNode(final DomElement domElement, final Method method) {
    return new DomElementsGroupNode(domElement, method);
  }

  protected boolean showOrdered() {
    return true;
  }

  protected boolean showGenericValues() {
    return true;
  }

  public Object[] getEqualityObjects() {
    return NONE;
  }

  protected boolean doUpdate() {
    setUniformIcon(getNodeIcon());
    clearColoredText();<commit_msg>typo fixed<commit_after>package com.intellij.util.xml.tree;

import jetbrains.fabrique.ui.treeStructure.SimpleNode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.xml.DomElement;
import com.intellij.util.xml.GenericValue;

import java.util.*;
import java.lang.reflect.Method;


public class BaseDomElementNode extends AbstractDomElementNode {
  static final private Logger LOG = Logger.getInstance(DomModelTreeStructure.class.getName());

  protected DomElement myDomElement;
  protected String myTagName;

  public BaseDomElementNode(final DomElement modelElement) {
    this(modelElement, null, null);
  }

  public BaseDomElementNode(final DomElement modelElement, final String tagName, SimpleNode parent) {
    super(parent);

    myDomElement = modelElement;
    myTagName = tagName == null ? "unknown" : tagName;
   }

  public SimpleNode[] getChildren() {
    List<SimpleNode> children = new ArrayList();

    final Collection<Method> methods = myDomElement.getMethodsInfo().getFixedChildrenGetterMethods();

    for (Method method : methods) {
      try {
        final Object result = method.invoke(myDomElement, new Object[0]);

        if (result instanceof DomElement) {
          final String tagName = myDomElement.getMethodsInfo().getTagName(method);

          if (showGenericValues() && result instanceof GenericValue) {
             children.add(new GenericValueNode((GenericValue)result, tagName, this));
          } else {

            children.add(getDomElementNode((DomElement)result, tagName, this));
          }
        }
      }
      catch (Throwable e) {
        LOG.error(e);
      }
    }

    final Collection<Method> collectionMethods = myDomElement.getMethodsInfo().getCollectionChildrenGetterMethods();

    for (Method method : collectionMethods) {
      children.add(getDomElementsGroupNode(myDomElement, method));
    }

    AbstractDomElementNode[] childrenNodes = children.toArray(new AbstractDomElementNode[children.size()]);
    if (showOrdered()) {
      Arrays.sort(childrenNodes, getComparator());
    }

    return childrenNodes;
  }

  protected DomElementsGroupNode getDomElementsGroupNode(final DomElement domElement, final Method method) {
    return new DomElementsGroupNode(domElement, method);
  }

  protected boolean showOrdered() {
    return true;
  }

  protected boolean showGenericValues() {
    return true;
  }

  public Object[] getEqualityObjects() {
    return NONE;
  }

  protected boolean doUpdate() {
    setUniformIcon(getNodeIcon());
    clearColoredText();
{'fraction_non_alphanumeric': 0.09688581314878893, 'fraction_numerical': 0.00038446751249519417, 'mean_word_length': 3.955238095238095, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '528634', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1405, 'n_words': 312}