<commit_before>package de._125m125.kt.ktapi_java.retrofitRequester.builderModifier;

import java.util.ArrayList;
import java.util.List;

import okhttp3.CertificatePinner;
import okhttp3.OkHttpClient.Builder;

public class CertificatePinnerAdder implements ClientModifier {

    //@formatter:off
    public static CertificatePinnerAdderCertificate[] DEFAULT_CERTIFICATES = {
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256//iQnnSh/9lsGEhErSqu/lrMUmVmi/QtJgarE3vtusbc=", 1523404800000L), // Apr 11 2018
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256/BDHLeJezD9o1bNzFlf1B9MLw/Ab9AzM4S8aTV3TCJUI=", 1528675200000L), // Jun 11 2018
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256/tKgj8//UI0ceNEqmwGJ9WnSaE/z/fYs/c+CcX80mzzc=", 1528675200000L), // Jun 11 2018
    };
    //@formatter:on

    public static class CertificatePinnerAdderBuilder {
        private final List<CertificatePinnerAdderCertificate> certificatesToAdd = new ArrayList<>();
        private final boolean                                 ignoreExpired;

        public CertificatePinnerAdderBuilder(final boolean ignoreExpired) {
            this.ignoreExpired = ignoreExpired;
        }

        public CertificatePinnerAdder build() {
            return new CertificatePinnerAdder(this.certificatesToAdd
                    .toArray(new CertificatePinnerAdderCertificate[this.certificatesToAdd.size()]));
        }

        public CertificatePinnerAdderBuilder add(final CertificatePinnerAdderCertificate cert) {
            if (this.ignoreExpired || cert.useUntilMillies > System.currentTimeMillis()) {
                this.certificatesToAdd.add(cert);
            }
            return this;
        }

        public CertificatePinnerAdderBuilder addAll(final CertificatePinnerAdderCertificate... certs) {
            for (final CertificatePinnerAdderCertificate cert : certs) {
                add(cert);
            }
            return this;
        }
    }

    public static CertificatePinnerAdderBuilder builder(final boolean ignoreExpired) {
        return new CertificatePinnerAdderBuilder(ignoreExpired);
    }

    private CertificatePinner certificatePinner;

    public CertificatePinnerAdder(final CertificatePinnerAdderCertificate... certificates) {
        if (certificates.length == 0) {
            this.certificatePinner = null;
            return;
        }
        final okhttp3.CertificatePinner.Builder builder = new CertificatePinner.Builder();
        for (final CertificatePinnerAdderCertificate certificate : certificates) {
            builder.add(certificate.hostname, certificate.value);
        }
        this.certificatePinner = builder.build();
    }

    @Override
    public Builder modify(final Builder builder) {
        if (this.certificatePinner != null) {
            builder.certificatePinner(this.certificatePinner);
        }
        return builder;
    }

    public static class CertificatePinnerAdderCertificate {
        private final String hostname;
        private final String value;
        private final long   useUntilMillies;

        public CertificatePinnerAdderCertificate(final String hostname, final String value,
                final long useUntilMillies) {
            super();
            this.hostname = hostname;
            this.value = value;
            this.useUntilMillies = useUntilMillies;
        }

        public String getHostname() {
            return this.hostname;
        }

        public String getValue() {
            return this.value;
        }

        public long getUseUntilMillies() {
            return this.useUntilMillies;
        }
    }
}
<commit_msg>update certificate pins<commit_after>package de._125m125.kt.ktapi_java.retrofitRequester.builderModifier;

import java.util.ArrayList;
import java.util.List;

import okhttp3.CertificatePinner;
import okhttp3.OkHttpClient.Builder;

public class CertificatePinnerAdder implements ClientModifier {

    //@formatter:off
    public static CertificatePinnerAdderCertificate[] DEFAULT_CERTIFICATES = {
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256/tKgj8//UI0ceNEqmwGJ9WnSaE/z/fYs/c+CcX80mzzc=", 1531148895000L), // Jul 09 2018
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256/ZnHPNFeZ/okzKy3UttEwn4O9V8T/qEvByGaE1FLBdq8=", 1536451200000L), // Sep 09 2018
            new CertificatePinnerAdderCertificate("kt.125m125.de",
                    "sha256/vJdW/+vnegRN4ZwzWfu4EymOnj672ev7S7EWh9p6xHU=", 1536451200000L), // Sep 09 2018
    };
    //@formatter:on

    public static class CertificatePinnerAdderBuilder {
        private final List<CertificatePinnerAdderCertificate> certificatesToAdd = new ArrayList<>();
        private final boolean                                 ignoreExpired;

        public CertificatePinnerAdderBuilder(final boolean ignoreExpired) {
            this.ignoreExpired = ignoreExpired;
        }

        public CertificatePinnerAdder build() {
            return new CertificatePinnerAdder(this.certificatesToAdd
                    .toArray(new CertificatePinnerAdderCertificate[this.certificatesToAdd.size()]));
        }

        public CertificatePinnerAdderBuilder add(final CertificatePinnerAdderCertificate cert) {
            if (this.ignoreExpired || cert.useUntilMillies > System.currentTimeMillis()) {
                this.certificatesToAdd.add(cert);
            }
            return this;
        }

        public CertificatePinnerAdderBuilder addAll(final CertificatePinnerAdderCertificate... certs) {
            for (final CertificatePinnerAdderCertificate cert : certs) {
                add(cert);
            }
            return this;
        }
    }

    public static CertificatePinnerAdderBuilder builder(final boolean ignoreExpired) {
        return new CertificatePinnerAdderBuilder(ignoreExpired);
    }

    private CertificatePinner certificatePinner;

    public CertificatePinnerAdder(final CertificatePinnerAdderCertificate... certificates) {
        if (certificates.length == 0) {
            this.certificatePinner = null;
            return;
        }
        final okhttp3.CertificatePinner.Builder builder = new CertificatePinner.Builder();
        for (final CertificatePinnerAdderCertificate certificate : certificates) {
            builder.add(certificate.hostname, certificate.value);
        }
        this.certificatePinner = builder.build();
    }

    @Override
    public Builder modify(final Builder builder) {
        if (this.certificatePinner != null) {
            builder.certificatePinner(this.certificatePinner);
        }
        return builder;
    }

    public static class CertificatePinnerAdderCertificate {
        private final String hostname;
        private final String value;
        private final long   useUntilMillies;

        public CertificatePinnerAdderCertificate(final String hostname, final String value,
                final long useUntilMillies) {
            super();
            this.hostname = hostname;
            this.value = value;
            this.useUntilMillies = useUntilMillies;
        }

        public String getHostname() {
            return this.hostname;
        }

        public String getValue() {
            return this.value;
        }

        public long getUseUntilMillies() {
            return this.useUntilMillies;
        }
    }
}

{'fraction_non_alphanumeric': 0.07298590800319064, 'fraction_numerical': 0.029646370646104758, 'mean_word_length': 2.4780397595931576, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6083734', 'n_tokens_mistral': 2225, 'n_tokens_neox': 1977, 'n_words': 384}