<commit_before>package ee.shy.core;

import org.apache.commons.lang3.ArrayUtils;

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

public class TreePath implements Comparable<TreePath> {
    private final String[] pathStrings;

    public TreePath(String stringPath) {
        pathStrings = stringPath.split("/");
    }

    public TreePath(String[] treePath) {
        this.pathStrings = treePath;
    }

    public TreePath resolve(String str) {
        return new TreePath(ArrayUtils.addAll(pathStrings, str.split("/")));
    }

    public String toString() {
        return String.join("/", pathStrings);
    }

    @Override
    public int compareTo(TreePath o) {
        String[] oStringList = o.pathStrings;

        int iterCount = Math.min(pathStrings.length, oStringList.length);
        
        for (int i = 0; i < iterCount; i++) {
            int strCompareResult = oStringList[i].compareTo(pathStrings[i]);
            if(strCompareResult != 0) {
                return strCompareResult;
            }
        }

        return oStringList.length - pathStrings.length;
    }
}<commit_msg>Remove String constructor from TreePath<commit_after>package ee.shy.core;

import org.apache.commons.lang3.ArrayUtils;

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

public class TreePath implements Comparable<TreePath> {
    private final String[] pathStrings;

    public TreePath(String[] treePath) {
        this.pathStrings = treePath;
    }

    public TreePath resolve(String str) {
        return new TreePath(ArrayUtils.addAll(pathStrings, ArrayUtils.remove(str.split("/"), 0)));
    }

    public String toString() {
        return String.join("/", pathStrings);
    }

    @Override
    public int compareTo(TreePath o) {
        String[] oStringList = o.pathStrings;

        int iterCount = Math.min(pathStrings.length, oStringList.length);
        
        for (int i = 0; i < iterCount; i++) {
            int strCompareResult = oStringList[i].compareTo(pathStrings[i]);
            if(strCompareResult != 0) {
                return strCompareResult;
            }
        }

        return oStringList.length - pathStrings.length;
    }
}
{'fraction_non_alphanumeric': 0.10890632210429164, 'fraction_numerical': 0.003230272265805261, 'mean_word_length': 2.601328903654485, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '117646', 'n_tokens_mistral': 630, 'n_tokens_neox': 611, 'n_words': 140}