<commit_before>package edu.teco.dnd.eclipse;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.internal.dnd.SwtUtil;
import org.eclipse.ui.part.ViewPart;

import com.sun.swing.internal.plaf.synth.resources.synth;

import edu.teco.dnd.network.ConnectionListener;
import edu.teco.dnd.network.ConnectionManager;
import edu.teco.dnd.network.TCPConnectionManager;

/**
 * ModuleView: Shows available modules.
 * 
 * @author jung
 * 
 */
public class ModuleView extends ViewPart implements ConnectionListener {
	/**
	 * The logger for this class.
	 */
	private static final Logger LOGGER = LogManager.getLogger(ModuleView.class);
	
	private Label label;
	private ConnectionManager manager;

	private Button button;
	private boolean serverIsRunning;
	private Label serverAnnounce;

	private Table moduleTable;
	private Map<UUID, TableItem> map = new HashMap<UUID, TableItem>();
	
	private Display display;

	public ModuleView() {
		super();
		manager = Activator.getDefault().getConnectionManager();
	}

	public void setFocus() {
		label.setFocus();
	}

	public void init(IViewSite site, IMemento memento) throws PartInitException {
		LOGGER.entry(site, memento);
		super.init(site, memento);
		manager = Activator.getDefault().getConnectionManager();
		display = Display.getCurrent();
		if (display == null) {
			display = Display.getDefault();
			LOGGER.trace("Display.getCurrent() returned null, using Display.getDefault(): {}", display);
		}
		LOGGER.exit();
	}

	public void createPartControl(Composite parent) {
		GridLayout layout = new GridLayout(5, false);
		parent.setLayout(layout);
<commit_msg>Fix minor bug in ModuleView<commit_after>package edu.teco.dnd.eclipse;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.internal.dnd.SwtUtil;
import org.eclipse.ui.part.ViewPart;

import com.sun.swing.internal.plaf.synth.resources.synth;

import edu.teco.dnd.network.ConnectionListener;
import edu.teco.dnd.network.ConnectionManager;
import edu.teco.dnd.network.TCPConnectionManager;

/**
 * ModuleView: Shows available modules.
 * 
 * @author jung
 * 
 */
public class ModuleView extends ViewPart implements ConnectionListener {
	/**
	 * The logger for this class.
	 */
	private static final Logger LOGGER = LogManager.getLogger(ModuleView.class);
	
	private Label label;
	private ConnectionManager manager;

	private Button button;
	private boolean serverIsRunning;
	private Label serverAnnounce;

	private Table moduleTable;
	private Map<UUID, TableItem> map = new HashMap<UUID, TableItem>();
	
	private Display display;

	public ModuleView() {
		super();
		manager = Activator.getDefault().getConnectionManager();
	}

	public void setFocus() {
		label.setFocus();
	}

	public void init(IViewSite site, IMemento memento) throws PartInitException {
		LOGGER.entry(site, memento);
		super.init(site, memento);
		manager = Activator.getDefault().getConnectionManager();
		display = Display.getCurrent();
		if (display == null) {
			display = Display.getDefault();
			LOGGER.trace("Display.getCurrent() returned null, using Display.getDefault(): {}", display);
		}
		LOGGER.exit();
	}
	
	@Override
	public void dispose() {
		LOGGER.entry();
		manager.removeConnectionListener(this);
		LOGGER.exit();
	}

	public void createPartControl(Composite parent) {
		GridLayout layout = new GridLayout(5, false);
		parent.setLayout(layout);

{'fraction_non_alphanumeric': 0.1162528216704289, 'fraction_numerical': 0.0013544018058690745, 'mean_word_length': 5.036784741144414, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4882161', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1391, 'n_words': 305}