<commit_before>package nl.tudelft.watchdog.ui.handlers;

import nl.tudelft.watchdog.logic.InitializationManager;
import nl.tudelft.watchdog.ui.WatchDogView;
import nl.tudelft.watchdog.ui.preferences.Preferences;
import nl.tudelft.watchdog.ui.util.UIUtils;
import nl.tudelft.watchdog.util.WatchDogGlobals;
import nl.tudelft.watchdog.util.WatchDogGlobals.IDE;
import nl.tudelft.watchdog.util.WatchDogLogger;

import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;

/**
 * Handler called when an Eclipse instance with the WatchDog plugin installed
 * gets opened and activated.
 */
public class StartupHandler implements IStartup {

	/** {@inheritDoc} Starts the WatchDog plugin. */
	@Override
	public void earlyStartup() {
		StartupUIThread watchDogUiThread = new StartupUIThread(
				Preferences.getInstance());
		Display.getDefault().asyncExec(watchDogUiThread);
	}

	/** Starts WatchDog. */
	public static void startWatchDog() {
		try {
			WatchDogLogger.getInstance().logInfo("Starting WatchDog ...");

			// Initialize the interval manager, and thereby, interval recording.
			InitializationManager.getInstance();
			WatchDogGlobals.isActive = true;
			WatchDogGlobals.hostIDE = IDE.ECLIPSE;
			// Update WatchDog icon
			UIUtils.refreshCommand(UIUtils.COMMAND_SHOW_INFO);
			updateView();
		} catch (Exception exception) {
			WatchDogLogger.getInstance().logSevere(
					"Caught sever exception on top-level: ");
			WatchDogLogger.getInstance().logSevere(exception);
		}
	}

	private static void updateView() {
		WatchDogView view = UIUtils.getWatchDogView();
		if (view != null) {
			view.update();
		}
	}
}<commit_msg>IDE field now initialized before WD start-up #191<commit_after>package nl.tudelft.watchdog.ui.handlers;

import nl.tudelft.watchdog.logic.InitializationManager;
import nl.tudelft.watchdog.ui.WatchDogView;
import nl.tudelft.watchdog.ui.preferences.Preferences;
import nl.tudelft.watchdog.ui.util.UIUtils;
import nl.tudelft.watchdog.util.WatchDogGlobals;
import nl.tudelft.watchdog.util.WatchDogGlobals.IDE;
import nl.tudelft.watchdog.util.WatchDogLogger;

import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;

/**
 * Handler called when an Eclipse instance with the WatchDog plugin installed
 * gets opened and activated.
 */
public class StartupHandler implements IStartup {

	/** {@inheritDoc} Starts the WatchDog plugin. */
	@Override
	public void earlyStartup() {
		StartupUIThread watchDogUiThread = new StartupUIThread(
				Preferences.getInstance());
		Display.getDefault().asyncExec(watchDogUiThread);
	}

	/** Starts WatchDog. */
	public static void startWatchDog() {
		try {
			WatchDogLogger.getInstance().logInfo("Starting WatchDog ...");

			WatchDogGlobals.hostIDE = IDE.ECLIPSE;
			// Initialize the interval manager, and thereby, interval recording.
			InitializationManager.getInstance();
			WatchDogGlobals.isActive = true;
			// Update WatchDog icon
			UIUtils.refreshCommand(UIUtils.COMMAND_SHOW_INFO);
			updateView();
		} catch (Exception exception) {
			WatchDogLogger.getInstance().logSevere(
					"Caught sever exception on top-level: ");
			WatchDogLogger.getInstance().logSevere(exception);
		}
	}

	private static void updateView() {
		WatchDogView view = UIUtils.getWatchDogView();
		if (view != null) {
			view.update();
		}
	}
}
{'fraction_non_alphanumeric': 0.11151295961422544, 'fraction_numerical': 0.0009041591320072332, 'mean_word_length': 4.692967409948542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2501669', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1055, 'n_words': 213}