<commit_before>package com.atlassian.jira.plugins.dvcs.smartcommits;

import com.atlassian.jira.plugins.dvcs.dao.ChangesetDao;
import com.atlassian.jira.plugins.dvcs.model.Progress;
import com.atlassian.jira.plugins.dvcs.model.Repository;
import com.atlassian.jira.plugins.dvcs.service.ChangesetService;
import com.atlassian.util.concurrent.Promise;
import com.atlassian.util.concurrent.Promises;
import com.atlassian.util.concurrent.ThreadFactories;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;

public class DefaultSmartcommitsChangesetsProcessor implements SmartcommitsChangesetsProcessor, DisposableBean
{

    /**
     * Logger of this class.
     */
    private static final Logger log = LoggerFactory.getLogger(DefaultSmartcommitsChangesetsProcessor.class);

    private final ListeningExecutorService executor;
    private final SmartcommitsService smartcommitService;
    private final CommitMessageParser commitParser;
    private final ChangesetDao changesetDao;

    public DefaultSmartcommitsChangesetsProcessor(ChangesetDao changesetDao, SmartcommitsService smartcommitService,
                                                  CommitMessageParser commitParser)
    {
        this.changesetDao = changesetDao;
        this.smartcommitService = smartcommitService;
        this.commitParser = commitParser;

        // a listening decorator returns ListenableFuture, which we then wrap in a Promise. if we were to instead create
        // a Promise out of a JDK future we wouldn't be able to guarantee that its callbacks run in this executor.
        executor = MoreExecutors.listeningDecorator(createThreadPool());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void destroy() throws Exception
    {<commit_msg>BBC-803: corrected comment in DefaultSmartcommitsChangesetsProcessor<commit_after>package com.atlassian.jira.plugins.dvcs.smartcommits;

import com.atlassian.jira.plugins.dvcs.dao.ChangesetDao;
import com.atlassian.jira.plugins.dvcs.model.Progress;
import com.atlassian.jira.plugins.dvcs.model.Repository;
import com.atlassian.jira.plugins.dvcs.service.ChangesetService;
import com.atlassian.util.concurrent.Promise;
import com.atlassian.util.concurrent.Promises;
import com.atlassian.util.concurrent.ThreadFactories;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;

public class DefaultSmartcommitsChangesetsProcessor implements SmartcommitsChangesetsProcessor, DisposableBean
{

    /**
     * Logger of this class.
     */
    private static final Logger log = LoggerFactory.getLogger(DefaultSmartcommitsChangesetsProcessor.class);

    private final ListeningExecutorService executor;
    private final SmartcommitsService smartcommitService;
    private final CommitMessageParser commitParser;
    private final ChangesetDao changesetDao;

    public DefaultSmartcommitsChangesetsProcessor(ChangesetDao changesetDao, SmartcommitsService smartcommitService,
                                                  CommitMessageParser commitParser)
    {
        this.changesetDao = changesetDao;
        this.smartcommitService = smartcommitService;
        this.commitParser = commitParser;

        // a listening decorator returns ListenableFuture, which we then wrap in a Promise. using JDK futures directly
        // leads to an extra thread being created for the lifetime of the Promise (see Guava JdkFutureAdapters)
        executor = MoreExecutors.listeningDecorator(createThreadPool());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void destroy() throws Exception
    {
{'fraction_non_alphanumeric': 0.07169634489222118, 'fraction_numerical': 0.0016401124648547328, 'mean_word_length': 4.250922509225092, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3322857', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1132, 'n_words': 250}