<commit_before>package beaform.gui.search;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import beaform.entities.Formula;
import beaform.gui.FormulaTree;

public final class RenderSearchResult implements Runnable {

	private final Future<Formula> searchresult;
	private final JPanel pane;

	public RenderSearchResult(Future<Formula> searchresult, JPanel pane) {
		this.searchresult = searchresult;
		this.pane = pane;
	}

	@Override
	public void run() {
		final Formula searchResult;
		try {
			searchResult = this.searchresult.get();
		}
		catch (InterruptedException | ExecutionException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			return;
		}
		SwingUtilities.invokeLater(new AddFormTreeToGui(searchResult, this.pane));
	}

	public static final class AddFormTreeToGui implements Runnable {
		private final Formula searchResult;
		private final JPanel pane;

		public AddFormTreeToGui(Formula searchResult, JPanel pane) {
			this.searchResult = searchResult;
			this.pane = pane;
		}

		@Override
		public void run() {
			FormulaTree ft = new FormulaTree(this.searchResult);
			this.pane.add(ft);
			this.pane.validate();
		}
	}
}<commit_msg>Remove old search results<commit_after>package beaform.gui.search;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import beaform.entities.Formula;
import beaform.gui.FormulaTree;

public final class RenderSearchResult implements Runnable {

	private final Future<Formula> searchresult;
	private final JPanel pane;

	public RenderSearchResult(Future<Formula> searchresult, JPanel pane) {
		this.searchresult = searchresult;
		this.pane = pane;
	}

	@Override
	public void run() {
		final Formula searchResult;
		try {
			searchResult = this.searchresult.get();
		}
		catch (InterruptedException | ExecutionException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			return;
		}
		SwingUtilities.invokeLater(new AddFormTreeToGui(searchResult, this.pane));
	}

	public static final class AddFormTreeToGui implements Runnable {
		private final Formula searchResult;
		private final JPanel pane;

		public AddFormTreeToGui(Formula searchResult, JPanel pane) {
			this.searchResult = searchResult;
			this.pane = pane;
		}

		@Override
		public void run() {
			FormulaTree ft = new FormulaTree(this.searchResult);
			if (this.pane.getComponentCount() > 3) {
				this.pane.remove(3);
			}
			this.pane.add(ft);
			this.pane.validate();
		}
	}
}
{'fraction_non_alphanumeric': 0.09256449165402124, 'fraction_numerical': 0.002276176024279211, 'mean_word_length': 4.528301886792453, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4666726', 'n_tokens_mistral': 911, 'n_tokens_neox': 817, 'n_words': 195}