<commit_before>package de.haw.vs.nameservice.connectionhandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class Server implements IServer {

    private ServerSocket serverSocket;
    private volatile boolean stopping;
    private final Logger log = LoggerFactory.getLogger(Server.class);
    private final int maxConcurrentConnections = 30;
    private final Executor threadPool = Executors.newFixedThreadPool(maxConcurrentConnections);

    @Override
    public void initServer(int port) {
        try {
            serverSocket = new ServerSocket(port);
            this.stopping = false;
        } catch (IOException e) {
            this.stopping = true;
            log.error("Could not start server at port: " + String.valueOf(port), e);
        }
    }

    @Override
    public void run() {
        log.info("Started server");
        while (!stopping) {
            try {
                Socket clientSocket = serverSocket.accept();
                IClientRequestHandler clientRequest = new ClientRequestHandler(clientSocket);
                threadPool.execute(clientRequest);
            } catch (IOException e) {
                log.warn("Error while client tried to connect", e);
            }
        }
        try {
            serverSocket.close();
        } catch (IOException e) {
            log.warn("Could not close server socket");
        }
        log.info("Stopped server");
    }

    public boolean isStopping() {
        return stopping;
    }

    public void stop() {
        this.stopping = true;
    }
}<commit_msg>Use ExecutorService instead of Executor<commit_after>package de.haw.vs.nameservice.connectionhandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Server implements IServer {

    private ServerSocket serverSocket;
    private volatile boolean stopping;
    private final Logger log = LoggerFactory.getLogger(Server.class);
    private final int maxConcurrentConnections = 30;
    private final ExecutorService threadPool = Executors.newFixedThreadPool(maxConcurrentConnections);

    @Override
    public void initServer(int port) {
        try {
            serverSocket = new ServerSocket(port);
            this.stopping = false;
        } catch (IOException e) {
            this.stopping = true;
            log.error("Could not start server at port: " + String.valueOf(port), e);
        }
    }

    @Override
    public void run() {
        log.info("Started server");
        while (!stopping) {
            try {
                Socket clientSocket = serverSocket.accept();
                IClientRequestHandler clientRequest = new ClientRequestHandler(clientSocket);
                threadPool.submit(clientRequest);
            } catch (IOException e) {
                log.warn("Error while client tried to connect", e);
            }
        }
        try {
            serverSocket.close();
        } catch (IOException e) {
            log.warn("Could not close server socket");
        }
        log.info("Stopped server");
    }

    public boolean isStopping() {
        return stopping;
    }

    public void stop() {
        this.stopping = true;
    }
}
{'fraction_non_alphanumeric': 0.08963745361119041, 'fraction_numerical': 0.0022837567799029405, 'mean_word_length': 2.346704871060172, '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': '7325158', 'n_tokens_mistral': 920, 'n_tokens_neox': 894, 'n_words': 236}