<commit_before>package fun.photoutil.main;

import java.io.FileReader;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class Configuration {
	private static final JSONObject json = readConf();

	private static JSONObject readConf() {
		JSONParser parser = new JSONParser();
		FileReader jr = null;
		try {
			jr = new FileReader(Constants.CONFIGURATION_FILE);
			return (JSONObject) parser.parse(jr);
		} catch (Exception e) {
			CommonUtils.exception(e);
			return null;
		} finally {
			if (jr != null)
				try {
					jr.close();
				} catch (Exception e) {
				}
		}
	}
}<commit_msg>EOD - 2017 04 14<commit_after>package fun.photoutil.main;

import java.io.FileReader;
import java.io.FileWriter;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class Configuration {
	private static final JSONObject json = readConf();

	private static JSONObject readConf() {
		JSONParser parser = new JSONParser();
		FileReader jr = null;
		try {
			jr = new FileReader(Constants.CONFIGURATION_FILE);
			return (JSONObject) parser.parse(jr);
		} catch (Exception e) {
			CommonUtils.exception(e);
			return null;
		} finally {
			if (jr != null)
				try {
					jr.close();
				} catch (Exception e) {
				}
		}
	}

	public String get(String key) {
		return (String) json.get(key);
	}

	@SuppressWarnings("unchecked")
	public void set(String key, String value) {
		json.put(key, value);
		FileWriter jw = null;
		try {
			jw = new FileWriter(Constants.CONFIGURATION_FILE);
			json.writeJSONString(jw);
		} catch (Exception e) {
			CommonUtils.exception(e);
		} finally {
			if (jw != null)
				try {
					jw.close();
				} catch (Exception e) {
				}
		}
	}
}
{'fraction_non_alphanumeric': 0.12202208018593841, 'fraction_numerical': 0.004648460197559558, 'mean_word_length': 3.4381443298969074, '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': '4542840', 'n_tokens_mistral': 678, 'n_tokens_neox': 578, 'n_words': 142}