<commit_before>package config;

import java.io.FileInputStream;
import java.util.Properties;

public class Configuration {

	private final static String LOCAL_CONFIG_FILE = "./Configuration.xml";
	private final static String GENERAL_CONFIG_FILE = "../Configuration.xml";
	
	private static String otherFile = null;

	private final Properties props = new Properties();

	private final static Configuration config = new Configuration();

	private boolean configLoaded = false;

	protected Configuration() {
	}

	public static Configuration getInstance() {
		return config;
	}
	
	public static void setFile(String filePath) {
		otherFile = filePath;
	}

	public String getProperty(final String key) throws Exception {
		if (!configLoaded)
			if (otherFile != null)
				props.loadFromXML(new FileInputStream(otherFile));
			
			try {
				// First attempt
				props.loadFromXML(new FileInputStream(LOCAL_CONFIG_FILE));
				configLoaded = true;
			} catch (final Exception e) {
				// Second attempt
				props.loadFromXML(new FileInputStream(GENERAL_CONFIG_FILE));
			}
		return props.getProperty(key);
	}
}<commit_msg> * Configuration loading order changed.<commit_after>package config;

import java.io.FileInputStream;
import java.util.Properties;

public class Configuration {

	private final static String LOCAL_CONFIG_FILE = "./Configuration.xml";
	private final static String GENERAL_CONFIG_FILE = "../Configuration.xml";
	
	private static String otherFile = null;

	private final Properties props = new Properties();

	private final static Configuration config = new Configuration();

	private boolean configLoaded = false;

	protected Configuration() {
	}

	public static Configuration getInstance() {
		return config;
	}
	
	public static void setFile(String filePath) {
		otherFile = filePath;
	}

	public String getProperty(final String key) throws Exception {
		if (!configLoaded)
			if (otherFile != null) {
				props.loadFromXML(new FileInputStream(otherFile));
				
			} else {
				try {
					// First attempt
					props.loadFromXML(new FileInputStream(LOCAL_CONFIG_FILE));
					configLoaded = true;
				} catch (final Exception e) {
					// Second attempt
					props.loadFromXML(new FileInputStream(GENERAL_CONFIG_FILE));
				}
			}
		return props.getProperty(key);
	}
}
{'fraction_non_alphanumeric': 0.08955223880597014, 'fraction_numerical': 0.0, 'mean_word_length': 4.167800453514739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3687129', 'n_tokens_mistral': 701, 'n_tokens_neox': 598, 'n_words': 183}