<commit_before>package org.shipkit.internal.notes.contributors;


import org.json.simple.JsonObject;
import org.shipkit.internal.notes.model.ProjectContributor;
import org.shipkit.internal.notes.util.Function;
import org.shipkit.internal.notes.util.GitHubObjectFetcher;

import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ContributorsDispatcher {

    public static final int N_THREADS = 4;

    public Set<ProjectContributor> dispatch(List<JsonObject> page, String readOnlyAuthToken) {
        Set<ProjectContributor> result = new HashSet<ProjectContributor>();
        ExecutorService executor = Executors.newFixedThreadPool(N_THREADS);
        List<JsonObject> synchronizedPageList = Collections.synchronizedList(page);

        List<Future<Set<ProjectContributor>>> futures = new ArrayList<Future<Set<ProjectContributor>>>();
        if (page.size() > 0) {
            for (int i = 0; i < N_THREADS; i++) {
                GitHubObjectFetcher objectFetcher = new GitHubObjectFetcher(readOnlyAuthToken);
                Function<JsonObject, ProjectContributor> projectContributorFetcherFunction = new ProjectContributorFetcherFunction(objectFetcher);
                Callable<Set<ProjectContributor>> callable = new FetcherCallable<JsonObject, ProjectContributor>(synchronizedPageList, projectContributorFetcherFunction);

                futures.add(executor.submit(callable));
            }
        }

        for (Future<Set<ProjectContributor>> future: futures) {
            try {
                result.addAll(future.get());
            } catch (Exception e) {
                throw new RuntimeException("Error occurred while fetching contributors!", e);
            }
        }
        return result;
    }<commit_msg>reduce visibility<commit_after>package org.shipkit.internal.notes.contributors;


import org.json.simple.JsonObject;
import org.shipkit.internal.notes.model.ProjectContributor;
import org.shipkit.internal.notes.util.Function;
import org.shipkit.internal.notes.util.GitHubObjectFetcher;

import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ContributorsDispatcher {

    private static final int N_THREADS = 4;

    public Set<ProjectContributor> dispatch(List<JsonObject> page, String readOnlyAuthToken) {
        Set<ProjectContributor> result = new HashSet<ProjectContributor>();
        ExecutorService executor = Executors.newFixedThreadPool(N_THREADS);
        List<JsonObject> synchronizedPageList = Collections.synchronizedList(page);

        List<Future<Set<ProjectContributor>>> futures = new ArrayList<Future<Set<ProjectContributor>>>();
        if (page.size() > 0) {
            for (int i = 0; i < N_THREADS; i++) {
                GitHubObjectFetcher objectFetcher = new GitHubObjectFetcher(readOnlyAuthToken);
                Function<JsonObject, ProjectContributor> projectContributorFetcherFunction = new ProjectContributorFetcherFunction(objectFetcher);
                Callable<Set<ProjectContributor>> callable = new FetcherCallable<JsonObject, ProjectContributor>(synchronizedPageList, projectContributorFetcherFunction);

                futures.add(executor.submit(callable));
            }
        }

        for (Future<Set<ProjectContributor>> future: futures) {
            try {
                result.addAll(future.get());
            } catch (Exception e) {
                throw new RuntimeException("Error occurred while fetching contributors!", e);
            }
        }
        return result;
    }
{'fraction_non_alphanumeric': 0.09404221212930804, 'fraction_numerical': 0.0016029922522041143, 'mean_word_length': 3.5658536585365854, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '6747502', 'n_tokens_mistral': 1034, 'n_tokens_neox': 980, 'n_words': 189}