<commit_before>package com.canoo.dp.impl.platform.client;

import com.canoo.dp.impl.platform.client.http.DefaultHttpURLConnectionFactory;
import com.canoo.dp.impl.platform.core.Assert;
import com.canoo.dp.impl.platform.core.SimpleDolphinPlatformThreadFactory;
import com.canoo.dp.impl.platform.core.SimpleUncaughtExceptionHandler;
import com.canoo.platform.client.ClientConfiguration;
import com.canoo.platform.core.http.HttpURLConnectionFactory;
import org.apiguardian.api.API;

import java.net.CookieManager;
import java.net.CookieStore;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static org.apiguardian.api.API.Status.INTERNAL;

@API(since = "0.x", status = INTERNAL)
public class DefaultClientConfiguration implements ClientConfiguration {

    private final Properties internalProperties = new Properties();

    public DefaultClientConfiguration() {
        setUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());
        setUiUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());

        setBackgroundExecutor(Executors.newCachedThreadPool(new SimpleDolphinPlatformThreadFactory()));
        setCookieStore(new CookieManager().getCookieStore());
        setHttpURLConnectionFactory(new DefaultHttpURLConnectionFactory());
    }

    public DefaultClientConfiguration(Properties prop) {
        this();
        Assert.requireNonNull(prop, "prop");
        for(String key : prop.stringPropertyNames()) {
            setStringProperty(key, prop.getProperty(key));
        }
    }

    @Override
    public <T> T getObjectProperty(final String key) {
        return (T) internalProperties.get(key);
    }

    @Override
    public <T> T getObjectProperty(final String key, final T defaultValue) {
        if (containsProperty(key)) {
            return getObjectProperty(key);
        } else {
            return defaultValue;
        }
    }

    @Override
    public <T> void setObjectProperty(final String key, final T value) {
        internalProperties.put(key, value);
    }

    @Override
    public boolean containsProperty(final String key) {
        return internalProperties.containsKey(key);
    }

    @Override
    public Set<String> getPropertyKeys() {
        return internalProperties.stringPropertyNames();<commit_msg>based on review<commit_after>package com.canoo.dp.impl.platform.client;

import com.canoo.dp.impl.platform.client.http.DefaultHttpURLConnectionFactory;
import com.canoo.dp.impl.platform.core.Assert;
import com.canoo.dp.impl.platform.core.SimpleDolphinPlatformThreadFactory;
import com.canoo.dp.impl.platform.core.SimpleUncaughtExceptionHandler;
import com.canoo.platform.client.ClientConfiguration;
import com.canoo.platform.core.http.HttpURLConnectionFactory;
import org.apiguardian.api.API;

import java.net.CookieManager;
import java.net.CookieStore;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static org.apiguardian.api.API.Status.INTERNAL;

@API(since = "0.20", status = INTERNAL)
public class DefaultClientConfiguration implements ClientConfiguration {

    private final Properties internalProperties = new Properties();

    public DefaultClientConfiguration() {
        setUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());
        setUiUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());

        setBackgroundExecutor(Executors.newCachedThreadPool(new SimpleDolphinPlatformThreadFactory()));
        setCookieStore(new CookieManager().getCookieStore());
        setHttpURLConnectionFactory(new DefaultHttpURLConnectionFactory());
    }

    public DefaultClientConfiguration(Properties prop) {
        this();
        Assert.requireNonNull(prop, "prop");
        internalProperties.putAll(prop);
    }

    @Override
    public <T> T getObjectProperty(final String key) {
        return (T) internalProperties.get(key);
    }

    @Override
    public <T> T getObjectProperty(final String key, final T defaultValue) {
        if (containsProperty(key)) {
            return getObjectProperty(key);
        } else {
            return defaultValue;
        }
    }

    @Override
    public <T> void setObjectProperty(final String key, final T value) {
        internalProperties.put(key, value);
    }

    @Override
    public boolean containsProperty(final String key) {
        return internalProperties.containsKey(key);
    }

    @Override
    public Set<String> getPropertyKeys() {
        return internalProperties.stringPropertyNames();
{'fraction_non_alphanumeric': 0.09382871536523929, 'fraction_numerical': 0.0008396305625524769, 'mean_word_length': 4.118152524167562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3322446', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1254, 'n_words': 249}