<commit_before>/**
 * Created by <NAME> on 4/28/16
 * github page: https://github.com/alejojperez
 */
package com.alejojperez.pi_gpio.core;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import com.alejojperez.pi_gpio.core.config.Configuration;
import com.alejojperez.pi_gpio.core.contracts.ResolveConfigurationInputStreamCallback;

import java.io.*;

public class Utils
{
    public static InputStream config;

    public static ResolveConfigurationInputStreamCallback callback;

    /**
     * Returns configuration
     *
     * @return
     */
    public static Configuration configuration()
    {
        try
        {
            JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);

            Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
            return (Configuration) jaxbUnmarshaller.unmarshal(Utils.resolveInputStream());
        }
        catch (JAXBException ignore) { }

        return null;
    }

    /**
     * @return
     */
    protected static InputStream resolveInputStream()
    {
        if(Utils.callback != null)
            Utils.callback.resolve();
        else
            Utils.callback = () -> Utils.config = Utils.class.getResourceAsStream("configuration.xml");

        Utils.callback.resolve();

        return Utils.config;
    }
}
<commit_msg>Fixed bug<commit_after>/**
 * Created by <NAME> on 4/28/16
 * github page: https://github.com/alejojperez
 */
package com.alejojperez.pi_gpio.core;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import com.alejojperez.pi_gpio.core.config.Configuration;
import com.alejojperez.pi_gpio.core.contracts.ResolveConfigurationInputStreamCallback;

import java.io.*;

public class Utils
{
    public static InputStream config;

    public static ResolveConfigurationInputStreamCallback callback;

    /**
     * Returns configuration
     *
     * @return
     */
    public static Configuration configuration()
    {
        try
        {
            JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);

            Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
            return (Configuration) jaxbUnmarshaller.unmarshal(Utils.resolveInputStream());
        }
        catch (JAXBException ignore) { }

        return null;
    }

    /**
     * @return
     */
    protected static InputStream resolveInputStream()
    {
        if(Utils.callback == null)
            Utils.callback = () -> Utils.config = Utils.class.getResourceAsStream("configuration.xml");

        Utils.callback.resolve();

        return Utils.config;
    }
}

{'fraction_non_alphanumeric': 0.10121457489878542, 'fraction_numerical': 0.00368052999631947, 'mean_word_length': 2.817415730337079, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '4622656', 'n_tokens_mistral': 800, 'n_tokens_neox': 782, 'n_words': 141}