<commit_before>package com.crawljax.core.plugin;

import java.util.List;

import org.apache.log4j.Logger;

import com.crawljax.browser.EmbeddedBrowser;
import com.crawljax.condition.invariant.Invariant;
import com.crawljax.core.CandidateElement;
import com.crawljax.core.CrawlSession;
import com.crawljax.core.CrawljaxController;
import com.crawljax.core.CrawljaxException;
import com.crawljax.core.configuration.ProxyConfiguration;
import com.crawljax.core.state.Eventable;
import com.crawljax.core.state.StateMachine;
import com.crawljax.core.state.StateVertix;

/**
 * Class for invoking the plugin. The methods in this class are invoked from the Crawljax Core.
 * 
 * @author <NAME> <EMAIL>
 * @author <NAME> <EMAIL>
 * @author <NAME> <EMAIL>
 * @version $Id$
 */
public final class CrawljaxPluginsUtil {

	/**
	 * Make a new Log4j object used to do the logging.
	 */
	private static final Logger LOGGER = Logger.getLogger(CrawljaxPluginsUtil.class.getName());
	private static List<Plugin> plugins;

	/**
	 * Non instanceable constructor; does nothing never used, this constructor prevents the
	 * CrawljaxPluginsUtil to be instantiated as a Object. All methods of this class must be used
	 * statically.
	 * 
	 * @throws CrawljaxException
	 *             this exception is always thrown when instanced.
	 */
	private CrawljaxPluginsUtil() throws CrawljaxException {
		LOGGER.fatal("As this contructor is private and never used interal "
		        + "in the CrawljaxPluginsUtil, this message may never appear");
		throw new CrawljaxException("Called private never used contructor CrawljaxPluginsUtil()");
	}

	/**
	 * Set the Plugins.
	 * 
	 * @param plugins
	 *            the list of plugins.
	 */
	public static void loadPlugins(List<Plugin> plugins) {
		if (plugins == null || plugins.size() == 0) {
			LOGGER.warn("No plugins loaded because CrawljaxConfiguration is empty");
			return;
		}
		CrawljaxPluginsUtil.plugins = plugins;
		for (Plugin plugin : CrawljaxPluginsUtil.plugins) {
			/**
			 * Log the name of the plugin loaded
			 */
			LOGGER.info(plugin.getClass().getName());
		}
	}

	/**<commit_msg>make it possible to reset the plugins list.<commit_after>package com.crawljax.core.plugin;

import java.util.List;

import org.apache.log4j.Logger;

import com.crawljax.browser.EmbeddedBrowser;
import com.crawljax.condition.invariant.Invariant;
import com.crawljax.core.CandidateElement;
import com.crawljax.core.CrawlSession;
import com.crawljax.core.CrawljaxController;
import com.crawljax.core.CrawljaxException;
import com.crawljax.core.configuration.ProxyConfiguration;
import com.crawljax.core.state.Eventable;
import com.crawljax.core.state.StateMachine;
import com.crawljax.core.state.StateVertix;

/**
 * Class for invoking the plugin. The methods in this class are invoked from the Crawljax Core.
 * 
 * @author <NAME> <EMAIL>
 * @author <NAME> <EMAIL>
 * @author <NAME> <EMAIL>
 * @version $Id$
 */
public final class CrawljaxPluginsUtil {

	/**
	 * Make a new Log4j object used to do the logging.
	 */
	private static final Logger LOGGER = Logger.getLogger(CrawljaxPluginsUtil.class.getName());
	private static List<Plugin> plugins;

	/**
	 * Non instanceable constructor; does nothing never used, this constructor prevents the
	 * CrawljaxPluginsUtil to be instantiated as a Object. All methods of this class must be used
	 * statically.
	 * 
	 * @throws CrawljaxException
	 *             this exception is always thrown when instanced.
	 */
	private CrawljaxPluginsUtil() throws CrawljaxException {
		LOGGER.fatal("As this contructor is private and never used interal "
		        + "in the CrawljaxPluginsUtil, this message may never appear");
		throw new CrawljaxException("Called private never used contructor CrawljaxPluginsUtil()");
	}

	/**
	 * Set the Plugins.
	 * 
	 * @param plugins
	 *            the list of plugins.
	 */
	public static void loadPlugins(List<Plugin> plugins) {
		CrawljaxPluginsUtil.plugins = plugins;
		if (plugins == null || plugins.size() == 0) {
			LOGGER.warn("No plugins loaded because CrawljaxConfiguration is empty");
			return;
		}
		for (Plugin plugin : CrawljaxPluginsUtil.plugins) {
			/**
			 * Log the name of the plugin loaded
			 */
			LOGGER.info(plugin.getClass().getName());
		}
	}

	/**
{'fraction_non_alphanumeric': 0.10060975609756098, 'fraction_numerical': 0.0014071294559099437, 'mean_word_length': 3.9766627771295218, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3955465', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1277, 'n_words': 373}