<commit_before>package com.intellij.projectView;

import com.intellij.ide.impl.ProjectViewSelectInTarget;
import com.intellij.ide.projectView.BaseProjectTreeBuilder;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.projectView.ViewSettings;
import com.intellij.ide.projectView.impl.*;
import com.intellij.ide.projectView.impl.nodes.BasePsiNode;
import com.intellij.ide.projectView.impl.nodes.PackageElementNode;
import com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode;
import com.intellij.ide.util.treeView.*;
import com.intellij.idea.IdeaTestUtil;
import com.intellij.openapi.util.MultiValuesMap;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.TestSourceBasedTestCase;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.util.*;

public abstract class BaseProjectViewTestCase extends TestSourceBasedTestCase {
  protected AbstractTreeStructure myStructure;
  protected boolean myShowMembers = false;
  private List<AbstractProjectViewPSIPane> myPanes = new ArrayList<AbstractProjectViewPSIPane>();

  protected void setUp() throws Exception {
    super.setUp();

    myStructure = new TestProjectTreeStructure(myProject) {
      public boolean isShowMembers() {
        return myShowMembers;
      }
    };
  }

  protected void tearDown() throws Exception {
    for (Iterator<AbstractProjectViewPSIPane> iterator = myPanes.iterator(); iterator.hasNext();) {
      iterator.next().dispose();
    }
    myPanes.clear();
    super.tearDown();
  }

  protected AbstractProjectViewPSIPane createPane() {
    final AbstractProjectViewPSIPane pane = new AbstractProjectViewPSIPane(myProject) {
      protected ProjectViewSelectInTarget createSelectInTarget() {
        return null;
      }

      protected AbstractTreeUpdater createTreeUpdater(AbstractTreeBuilder treeBuilder) {
        return new AbstractTreeUpdater(treeBuilder);
      }

      protected BaseProjectTreeBuilder createBuilder(DefaultTreeModel treeModel) {
        return new ProjectTreeBuilder(myProject, myTree, treeModel, AlphaComparator.INSTANCE,
                                      (ProjectAbstractTreeStructureBase)myTreeStructure) {
          protected AbstractTreeUpdater createUpdater() {
            return createTreeUpdater(this);
          }

          protected void addTaskToWorker(final Runnable runnable, boolean first, final Runnable postRunnable) {<commit_msg>Test memleak.<commit_after>package com.intellij.projectView;

import com.intellij.ide.impl.ProjectViewSelectInTarget;
import com.intellij.ide.projectView.BaseProjectTreeBuilder;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.projectView.ViewSettings;
import com.intellij.ide.projectView.impl.*;
import com.intellij.ide.projectView.impl.nodes.BasePsiNode;
import com.intellij.ide.projectView.impl.nodes.PackageElementNode;
import com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode;
import com.intellij.ide.util.treeView.*;
import com.intellij.idea.IdeaTestUtil;
import com.intellij.openapi.util.MultiValuesMap;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.testFramework.TestSourceBasedTestCase;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.util.*;

public abstract class BaseProjectViewTestCase extends TestSourceBasedTestCase {
  protected AbstractTreeStructure myStructure;
  protected boolean myShowMembers = false;
  private List<AbstractProjectViewPSIPane> myPanes = new ArrayList<AbstractProjectViewPSIPane>();

  protected void setUp() throws Exception {
    super.setUp();

    myStructure = new TestProjectTreeStructure(myProject) {
      public boolean isShowMembers() {
        return myShowMembers;
      }
    };
  }

  protected void tearDown() throws Exception {
    for (Iterator<AbstractProjectViewPSIPane> iterator = myPanes.iterator(); iterator.hasNext();) {
      iterator.next().dispose();
    }
    myPanes = null;
    myStructure = null;
    super.tearDown();
  }

  protected AbstractProjectViewPSIPane createPane() {
    final AbstractProjectViewPSIPane pane = new AbstractProjectViewPSIPane(myProject) {
      protected ProjectViewSelectInTarget createSelectInTarget() {
        return null;
      }

      protected AbstractTreeUpdater createTreeUpdater(AbstractTreeBuilder treeBuilder) {
        return new AbstractTreeUpdater(treeBuilder);
      }

      protected BaseProjectTreeBuilder createBuilder(DefaultTreeModel treeModel) {
        return new ProjectTreeBuilder(myProject, myTree, treeModel, AlphaComparator.INSTANCE,
                                      (ProjectAbstractTreeStructureBase)myTreeStructure) {
          protected AbstractTreeUpdater createUpdater() {
            return createTreeUpdater(this);
          }

          protected void addTaskToWorker(final Runnable runnable, boolean first, final Runnable postRunnable) {
{'fraction_non_alphanumeric': 0.08405054019410364, 'fraction_numerical': 0.0, 'mean_word_length': 4.625128733264676, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4442144', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1518, 'n_words': 282}