<commit_before>package com.thinkgem.jeesite.mina;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketServer {

    private static int port = 8888;

    private static final Log log = LogFactory.getLog(SocketServer.class);

    public static void main(String[] args) {
        getInstance();
    }


    public static void getInstance() {
        try {
            ServerSocket server = new ServerSocket(port);
            log.info("启动Socket: " + server.getInetAddress().getHostName() + ":" + server.getLocalPort());


            while (true) {
                Socket client = server.accept();
                if (client != null) {
                    log.info("客户端:" + client.getInetAddress().getHostAddress() + ":" + client.getPort() + "已连接到服务器");
                    //读取客户端发送来的消息
                    BufferedReader br = new BufferedReader(new InputStreamReader(client.getInputStream()));
                    String mess = br.readLine();
                    log.info("客户端发来的消息：" + mess);
                    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
                    bw.write(mess + "\n");
                    log.info("服务返回消息：" + mess);
                    bw.flush();
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private class SocketThread extends Thread {

        private Socket client;

        public SocketThread(Socket client) {
            this.client = client;
        }

        @Override
        public void run() {

            super.run();
        }
    }
}
<commit_msg>成千上万的bug<commit_after>package com.thinkgem.jeesite.mina;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketServer {

    private static int port = 8888;

    private static final Log log = LogFactory.getLog(SocketServer.class);

    public static void main(String[] args) {
        getInstance();
    }


    public static void getInstance() {
        try {
            ServerSocket server = new ServerSocket(port);
            log.info("启动Socket: " + server.getInetAddress().getHostName() + ":" + server.getLocalPort());


            while (true) {
                Socket client = server.accept();
                if (client != null) {
                    log.info("客户端:" + client.getInetAddress().getHostAddress() + ":" + client.getPort() + "已连接到服务器");
                    receiveMessage(client);
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void receiveMessage(Socket socket) throws IOException {
        String receive = "";
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(64000);
        byte[] buffer = new byte[12800];
        int length;
        InputStream inputStream = socket.getInputStream();

        // read()会一直阻塞
        while((length = inputStream.read(buffer)) != -1) {
            byteArrayOutputStream.write(buffer, 0, length);
            // 转码后读取数据
            receive = byteArrayOutputStream.toString("UTF-8");
            log.info("客户端发送消息：" + receive);
            OutputStream socketWriter = socket.getOutputStream();
            socketWriter.write(receive.getBytes());
            socketWriter.flush();
        }


    }

    private class SocketThread extends Thread {

        private Socket client;

        public SocketThread(Socket client) {
            this.client = client;
        }

        @Override
        public void run() {

            super.run();
        }
    }
}

{'fraction_non_alphanumeric': 0.1122502628811777, 'fraction_numerical': 0.005520504731861199, 'mean_word_length': 1.9291762894534257, 'pattern_counts': {'":': 4, '<': 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': '3747322', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1031, 'n_words': 217}