<commit_before>package io.chthonic.mythos.mvp

/**
 * Created by jhavatar on 7/29/2018.
 */
class PresenterCacheLazy<P>(oneTimePresenterCreator: ()->P) : PresenterCache<P>() where P : Presenter<*>{
    private var presenterCreator: (()->P)? = oneTimePresenterCreator

    override var presenter: P? = null
        get() {
            if (field == null) {
                presenterCreator?.let{
                    field = it()
                }
                presenterCreator = null
            }
            return field<commit_msg>java support tweaks<commit_after>package io.chthonic.mythos.mvp

import java.util.concurrent.Callable

/**
 * Created by jhavatar on 7/29/2018.
 */
class PresenterCacheLazy<P>(oneTimeCreatePresenterFunction: ()->P) : PresenterCache<P>() where P : Presenter<*>{

    constructor(oneTimeCreatePresenterCallable: Callable<P>) : this({ oneTimeCreatePresenterCallable.call()})

    private var presenterCreator: (()->P)? = oneTimeCreatePresenterFunction

    override var presenter: P? = null
        get() {
            if (field == null) {
                presenterCreator?.let{
                    field = it()
                }
                presenterCreator = null
            }
            return field
{'fraction_non_alphanumeric': 0.11451612903225807, 'fraction_numerical': 0.01129032258064516, 'mean_word_length': 2.20671834625323, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, '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': '7320560', 'n_tokens_mistral': 376, 'n_tokens_neox': 353, 'n_words': 77}