<commit_before>/**
 * 
 */
package org.alfresco.contentcraft;

import java.lang.reflect.Constructor;
import java.util.Map;

import org.bukkit.command.CommandExecutor;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * Content craft plugin implementation
 * 
 * @author <NAME>
 */
public class ContentCraftPlugin extends JavaPlugin 
{
	/**
	 * @see org.bukkit.plugin.java.JavaPlugin#onEnable()
	 */
	@Override
	public void onEnable() 
	{
		getLogger().info("onEnable had been invoked");
		
		PluginDescriptionFile descriptionFile = getDescription();
		
		Map<String, Map<String, Object>> commands = descriptionFile.getCommands();
		for (Map.Entry<String, Map<String, Object>> entry : commands.entrySet()) 
		{
			String className = (String)entry.getValue().get("class");
			if (className != null)
			{
				try
				{
					Class<?> clazz = Class.forName(className);
					Constructor<?> ctor = clazz.getConstructor(String.class, Map.class);
					CommandExecutor commandExecutor = (CommandExecutor)ctor.newInstance(entry.getKey(), entry.getValue());
					
					getCommand(entry.getKey()).setExecutor(commandExecutor);
					
					if (commandExecutor instanceof Listener)
					{
						getServer().getPluginManager().registerEvents((Listener)commandExecutor, this);
					}
				}
				catch (Exception exception)
				{
					exception.printStackTrace();
				} 
			}
		}
	}
	
	/**
	 * @see org.bukkit.plugin.java.JavaPlugin#onDisable()
	 */
	@Override
	public void onDisable() 
	{
		getLogger().info("onDisable has been invoked");
	}
	
}<commit_msg>Add comments<commit_after>/**
 * 
 */
package org.alfresco.contentcraft;

import java.lang.reflect.Constructor;
import java.util.Map;

import org.bukkit.command.CommandExecutor;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * Content craft plugin implementation
 * 
 * @author <NAME>
 */
public class ContentCraftPlugin extends JavaPlugin 
{
	/**
	 * @see org.bukkit.plugin.java.JavaPlugin#onEnable()
	 */
	@Override
	public void onEnable() 
	{
		getLogger().info("onEnable had been invoked");
		
		// get the plugin description file
		PluginDescriptionFile descriptionFile = getDescription();
		
		// get the command information map
		Map<String, Map<String, Object>> commands = descriptionFile.getCommands();
		for (Map.Entry<String, Map<String, Object>> entry : commands.entrySet()) 
		{
			// look for the executor class
			String className = (String)entry.getValue().get("class");
			if (className != null)
			{
				try
				{
					// create an instance of the the executor class
					Class<?> clazz = Class.forName(className);
					Constructor<?> ctor = clazz.getConstructor(String.class, Map.class);
					CommandExecutor commandExecutor = (CommandExecutor)ctor.newInstance(entry.getKey(), entry.getValue());
					
					// set the command executor
					getCommand(entry.getKey()).setExecutor(commandExecutor);
					
					// if the command is a listener
					if (commandExecutor instanceof Listener)
					{
						// register events
						getServer().getPluginManager().registerEvents((Listener)commandExecutor, this);
					}
				}
				catch (Exception exception)
				{
					exception.printStackTrace();
				} 
			}
		}
	}
	
	/**
	 * @see org.bukkit.plugin.java.JavaPlugin#onDisable()
	 */
	@Override
	public void onDisable() 
	{
		getLogger().info("onDisable has been invoked");
	}
	
}
{'fraction_non_alphanumeric': 0.12947579490117445, 'fraction_numerical': 0.0, 'mean_word_length': 3.656, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5454158', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1005, 'n_words': 214}