<commit_before>package org.gestern.gringotts;

import static org.gestern.gringotts.Configuration.CONF;
import static org.gestern.gringotts.Language.LANG;
import static org.gestern.gringotts.dependency.Dependency.DEP;

import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.util.List;
import java.util.logging.Logger;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.ServicesManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.gestern.gringotts.accountholder.AccountHolderFactory;
import org.gestern.gringotts.accountholder.AccountHolderProvider;
import org.gestern.gringotts.api.impl.VaultConnector;
import org.gestern.gringotts.commands.ReloadCommand;
import org.gestern.gringotts.data.DAO;
import org.gestern.gringotts.data.DerbyDAO;
import org.gestern.gringotts.data.EBeanDAO;
import org.gestern.gringotts.data.Migration;
import org.gestern.gringotts.event.AccountListener;
import org.gestern.gringotts.event.PlayerVaultListener;
import org.gestern.gringotts.event.VaultCreator;

import com.avaje.ebean.EbeanServer;

public class Gringotts extends JavaPlugin {

	/** The Gringotts plugin instance. */
	public static Gringotts G;

	public DAO dao;

	private Logger log;

	/** Manages accounts. */
	public Accounting accounting;

	/**
	 * The account holder factory is the place to go if you need an
	 * AccountHolder instance for an id.
	 */
	public final AccountHolderFactory accountHolderFactory = new AccountHolderFactory();

	@Override
	public void onEnable() {

		G = this;

		try {
			log = getLogger();

			// just call DAO once to ensure it's loaded before startup is
			// complete
			dao = getDAO();

			// load and init configuration
			saveDefaultConfig(); // saves default configuration if no config.yml
									// exists yet
			reloadConfig();

			accounting = new Accounting();

			registerCommands();
			registerEvents();
			registerEconomy();
			
			new InterestModule().start();

		} catch (GringottsStorageException | GringottsConfigurationException e) {
			log.severe(e.getMessage());
			this.disable();
		} catch (RuntimeException e) {
			this.disable();
			throw e;
		}

		log.fine("enabled");
	}

	private void disable() {
		Bukkit.getPluginManager().disablePlugin(this);
		log.warning("Gringotts disabled due to startup errors.");
	}<commit_msg>delaying interest startup after full server load<commit_after>package org.gestern.gringotts;

import static org.gestern.gringotts.Configuration.CONF;
import static org.gestern.gringotts.Language.LANG;
import static org.gestern.gringotts.dependency.Dependency.DEP;

import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.util.List;
import java.util.logging.Logger;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.ServicesManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.gestern.gringotts.accountholder.AccountHolderFactory;
import org.gestern.gringotts.accountholder.AccountHolderProvider;
import org.gestern.gringotts.api.impl.VaultConnector;
import org.gestern.gringotts.commands.ReloadCommand;
import org.gestern.gringotts.data.DAO;
import org.gestern.gringotts.data.DerbyDAO;
import org.gestern.gringotts.data.EBeanDAO;
import org.gestern.gringotts.data.Migration;
import org.gestern.gringotts.event.AccountListener;
import org.gestern.gringotts.event.PlayerVaultListener;
import org.gestern.gringotts.event.VaultCreator;

import com.avaje.ebean.EbeanServer;

public class Gringotts extends JavaPlugin {

	/** The Gringotts plugin instance. */
	public static Gringotts G;

	public DAO dao;

	private Logger log;

	/** Manages accounts. */
	public Accounting accounting;

	/**
	 * The account holder factory is the place to go if you need an
	 * AccountHolder instance for an id.
	 */
	public final AccountHolderFactory accountHolderFactory = new AccountHolderFactory();

	@Override
	public void onEnable() {

		G = this;

		try {
			log = getLogger();

			// just call DAO once to ensure it's loaded before startup is
			// complete
			dao = getDAO();

			// load and init configuration
			saveDefaultConfig(); // saves default configuration if no config.yml
									// exists yet
			reloadConfig();

			accounting = new Accounting();

			registerCommands();
			registerEvents();
			registerEconomy();

			Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
				@Override
				public void run() {
					new InterestModule().start();
				}
			});

		} catch (GringottsStorageException | GringottsConfigurationException e) {
			log.severe(e.getMessage());
			this.disable();
		} catch (RuntimeException e) {
			this.disable();
			throw e;
		}

		log.fine("enabled");
	}

	private void disable() {
		Bukkit.getPluginManager().disablePlugin(this);
		log.warning("Gringotts disabled due to startup errors.");
	}
{'fraction_non_alphanumeric': 0.10398517145505097, 'fraction_numerical': 0.0, 'mean_word_length': 4.6033229491173415, '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': '2480540', 'n_tokens_mistral': 1853, 'n_tokens_neox': 1639, 'n_words': 375}