<commit_before>package io.github.yas99en.clipshare.model;

import java.io.IOException;
import java.net.URI;

import javax.websocket.ClientEndpoint;
import javax.websocket.ContainerProvider;
import javax.websocket.DeploymentException;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer;

@ClientEndpoint
public class ClipShareClient {
    public interface Listener {
        
    }

    public void setListener(Listener listener) {
        
    }

    public void start(String server, int port)  {
        WebSocketContainer container = ContainerProvider.getWebSocketContainer();

        URI uri = URI.create("ws://localhost:8080/ws/echo");

        Session session;
        try {
            session = container.connectToServer(this, uri);
            System.out.println("connected");
            session.getBasicRemote().sendText("hello");
        } catch (DeploymentException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public void stop() {
        
    }

    @OnOpen
    public void onOpen(Session session) {
        System.out.println("open: " + session.getId());
    }

    @OnMessage
    public void onMessage(Session session, String message) {
        System.out.println("message: "+message);
    }

    @OnError
    public void onError(Throwable t) {
        t.printStackTrace();
    }

    @OnClose
    public void onClose(Session session) {
        System.out.println("close: " + session.getId());
    }
}
<commit_msg>Modified ClipShareClient.java.<commit_after>package io.github.yas99en.clipshare.model;

import java.io.IOException;
import java.net.URI;

import javax.websocket.ClientEndpoint;
import javax.websocket.ContainerProvider;
import javax.websocket.DeploymentException;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer;

@ClientEndpoint
public class ClipShareClient {
    public interface Listener {
        
    }

    private Session session;

    public void setListener(Listener listener) {
        
    }

    public void start(String server, int port)  {
        WebSocketContainer container = ContainerProvider.getWebSocketContainer();

        URI uri = URI.create("ws://localhost:8080/ws/echo");

        try {
            session = container.connectToServer(this, uri);
            System.out.println("connected");
            session.getBasicRemote().sendText("hello");
        } catch (DeploymentException | IOException e) {
            session = null;
        }
    }

    public void stop() throws IOException {
        if(session != null) {
            session.close();
        }
        session = null;
    }

    @OnOpen
    public void onOpen(Session session) {
        System.out.println("open: " + session.getId());
    }

    @OnMessage
    public void onMessage(Session session, String message) {
        System.out.println("message: "+message);
    }

    @OnError
    public void onError(Throwable t) {
        t.printStackTrace();
    }

    @OnClose
    public void onClose(Session session) {
        System.out.println("close: " + session.getId());
        session = null;
    }
}

{'fraction_non_alphanumeric': 0.10401406387342514, 'fraction_numerical': 0.0035159683562847933, 'mean_word_length': 2.7640573318632855, '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': '142445', 'n_tokens_mistral': 968, 'n_tokens_neox': 926, 'n_words': 200}