<commit_before><commit_msg>start study design patterns<commit_after>/**
 * Singleton - hungry man pattern
 */
public class Singleton {
    private static Singleton singleton = new Singleton();

    private Singleton() { }

    public static Singleton getInstance() {
        return singleton;
    }

    public void hello() {
        System.out.println("hello singleton");
    }
}

/**
 * Singleton2 - idler man pattern
 */
class Singleton2 {
    private static Singleton2 singleton = null;

    private Singleton2() { }

    public static Singleton2 getInstance() {
        if (singleton == null) {
            synchronized (Singleton.class) {
                if (singleton == null) {
                    singleton = new Singleton2();
                }
            }
        }

        return singleton;
    }

    public void hello() {
        System.out.println("hello singleton");
    }
}
{'fraction_non_alphanumeric': 0.10201793721973094, 'fraction_numerical': 0.006726457399103139, 'mean_word_length': 2.0374149659863945, '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': '3093390', 'n_tokens_mistral': 247, 'n_tokens_neox': 230, 'n_words': 65}