<commit_before>package de.jpaw.bonaparte.dsl

import de.jpaw.bonaparte.dsl.bonScript.XExternalizable
import de.jpaw.bonaparte.dsl.bonScript.XHazelcast
import org.eclipse.xtend.lib.annotations.Data
import org.apache.log4j.Logger

@Data
public class ConfigReader {
    private static final Logger LOGGER = Logger.getLogger(ConfigReader);
    String prefix;

    def String getProp(String name, String defaultValue) {
        var String result
        try {
            result = System.getProperty(prefix + "." + name)
            if (result !== null)
                return result
        } catch (Exception e) {
            LOGGER.error('''Exception «e» while accessing system property «prefix».«name»''')
        }
        try {
            result = System.getenv(prefix + "_" + name)
            LOGGER.debug('''Setting «prefix».«name» is «result ?: defaultValue»''')
        } catch (Exception e) {
            LOGGER.error('''Exception «e» while accessing environment variable «prefix»_«name»''')
        }
        return result ?: defaultValue
    }

    def boolean getProp(String name, boolean defaultValue) {
        return Boolean.valueOf(getProp(name, defaultValue.toString))
    }
    def int getProp(String name, int defaultValue) {
        return Integer.valueOf(getProp(name, defaultValue.toString))
    }
}

public class BonScriptPreferences {
    static private final ConfigReader configReader = new ConfigReader("bonaparte")
    static private final boolean warnByteDefault                = configReader.getProp("WarnByte", true);
    static private final boolean warnFloatDefault               = configReader.getProp("WarnFloat", false);
    static private final boolean doDebugOutDefault              = configReader.getProp("DebugOut", false);
    static private final boolean doDateTimeDefault              = configReader.getProp("DateTime", true);
    static private final boolean noXmlDefault                   = configReader.getProp("noXML", false);
    static private final boolean jakartaOutputDefault           = configReader.getProp("jakarta", false);  // use jakarta instead of javax<commit_msg>jakarta migration: namespace flag change<commit_after>package de.jpaw.bonaparte.dsl

import de.jpaw.bonaparte.dsl.bonScript.XExternalizable
import de.jpaw.bonaparte.dsl.bonScript.XHazelcast
import org.eclipse.xtend.lib.annotations.Data
import org.apache.log4j.Logger

@Data
public class ConfigReader {
    private static final Logger LOGGER = Logger.getLogger(ConfigReader);
    String prefix;

    def String getProp(String name, String defaultValue) {
        var String result
        try {
            result = System.getProperty(prefix + "." + name)
            if (result !== null)
                return result
        } catch (Exception e) {
            LOGGER.error('''Exception «e» while accessing system property «prefix».«name»''')
        }
        try {
            result = System.getenv(prefix + "_" + name)
            LOGGER.debug('''Setting «prefix».«name» is «result ?: defaultValue»''')
        } catch (Exception e) {
            LOGGER.error('''Exception «e» while accessing environment variable «prefix»_«name»''')
        }
        return result ?: defaultValue
    }

    def boolean getProp(String name, boolean defaultValue) {
        return Boolean.valueOf(getProp(name, defaultValue.toString))
    }
    def int getProp(String name, int defaultValue) {
        return Integer.valueOf(getProp(name, defaultValue.toString))
    }
}

public class BonScriptPreferences {
    static private final ConfigReader configReader = new ConfigReader("bonaparte")
    static private final boolean warnByteDefault                = configReader.getProp("WarnByte", true);
    static private final boolean warnFloatDefault               = configReader.getProp("WarnFloat", false);
    static private final boolean doDebugOutDefault              = configReader.getProp("DebugOut", false);
    static private final boolean doDateTimeDefault              = configReader.getProp("DateTime", true);
    static private final boolean noXmlDefault                   = configReader.getProp("noXML", false);
    static private final boolean jakartaOutputDefault           = configReader.getProp("jakarta", true);  // use jakarta instead of javax
{'fraction_non_alphanumeric': 0.09531615925058548, 'fraction_numerical': 0.000468384074941452, 'mean_word_length': 2.921946740128558, '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': '3958615', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1099, 'n_words': 339}