<commit_before>package com.iskrembilen.quasseldroid.util;

import java.util.ArrayList;
import java.util.List;

public class NetsplitHelper {
    private static final int maxNetsplitNicks = 15;

    private List<String> nicks = new ArrayList<String>();
    private String sideOne;
    private String sideTwo;

    public NetsplitHelper(String netsplitString) {
        String[] splitString = netsplitString.split("#:#");
        for (int i = 0; i < splitString.length; i++) {
            if (i < splitString.length - 1) {
                nicks.add(splitString[i].split("!")[0]);
            } else if (i == splitString.length - 1) {
                String[] sides = splitString[i].split(" ");
                if (sides.length > 1) {
                    sideOne = sides[0];
                    sideTwo = sides[1];
                }
            }
        }
    }

    public List<String> getNicks() {
        return nicks;
    }

    public String getSideOne() {
        return sideOne;
    }

    public String getSideTwo() {
        return sideTwo;
    }

    public String formatJoinMessage() {
        return "Netsplit between " + sideOne + " and " + sideTwo + " ended. Users joined: " + formatNickList();
    }

    public String formatQuitMessage() {
        return "Netsplit between " + sideOne + " and " + sideTwo + ". Users quit: " + formatNickList();
    }

    private String formatNickList() {
        String nickList = "";

        int i = 0;
        for (; i < nicks.size() && i < maxNetsplitNicks; i++) {
            nickList += nicks.get(i);
            if ((i < nicks.size() - 1) && (i < maxNetsplitNicks - 1)) {
                nickList += ", ";
            }
        }

        if (i == maxNetsplitNicks - 1) {
            nickList += " (" + (nicks.size() - maxNetsplitNicks) + " more)";
        }

        return nickList;
    }
}
<commit_msg>Fix math issue in netsplit formatting code.<commit_after>package com.iskrembilen.quasseldroid.util;

import java.util.ArrayList;
import java.util.List;

public class NetsplitHelper {
    private static final int maxNetsplitNicks = 15;

    private List<String> nicks = new ArrayList<String>();
    private String sideOne;
    private String sideTwo;

    public NetsplitHelper(String netsplitString) {
        String[] splitString = netsplitString.split("#:#");
        for (int i = 0; i < splitString.length; i++) {
            if (i < splitString.length - 1) {
                nicks.add(splitString[i].split("!")[0]);
            } else if (i == splitString.length - 1) {
                String[] sides = splitString[i].split(" ");
                if (sides.length > 1) {
                    sideOne = sides[0];
                    sideTwo = sides[1];
                }
            }
        }
    }

    public List<String> getNicks() {
        return nicks;
    }

    public String getSideOne() {
        return sideOne;
    }

    public String getSideTwo() {
        return sideTwo;
    }

    public String formatJoinMessage() {
        return "Netsplit between " + sideOne + " and " + sideTwo + " ended. Users joined: " + formatNickList();
    }

    public String formatQuitMessage() {
        return "Netsplit between " + sideOne + " and " + sideTwo + ". Users quit: " + formatNickList();
    }

    private String formatNickList() {
        String nickList = "";

        int i = 0;
        for (; i < nicks.size() && i < maxNetsplitNicks; i++) {
            nickList += nicks.get(i);
            if ((i < nicks.size() - 1) && (i < maxNetsplitNicks - 1)) {
                nickList += ", ";
            }
        }

        if (i == maxNetsplitNicks && nicks.size() > maxNetsplitNicks) {
            nickList += " (" + (nicks.size() - maxNetsplitNicks) + " more)";
        }

        return nickList;
    }
}

{'fraction_non_alphanumeric': 0.1306532663316583, 'fraction_numerical': 0.006612007405448294, 'mean_word_length': 1.852187028657617, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 12, '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': '6003077', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1114, 'n_words': 273}