<commit_before>package classpath

import (
    "errors"
    "os"
    "strings"
)

// :(linux/unix) or ;(windows)
const pathListSeparator = string(os.PathListSeparator)

type ClassPath struct {
    entries []ClassPathEntry
}

// className: fully/qualified/ClassName
func (self *ClassPath) ReadClassData(className string) ([]byte, error) {
    className = className + ".class"
    for _, entry := range self.entries {
        data, err := entry.readClassData(className)
        if err == nil {
            return data, nil
        }
    }

    // todo
    err := errors.New("class not found!")
    return nil, err
}

func ParseClassPath(cpOption string) (*ClassPath) {
    if cpOption == "" {
        return &ClassPath{}
    }

    cpOptionSplitted := strings.Split(cpOption, pathListSeparator)
    cpEntries := make([]ClassPathEntry, len(cpOptionSplitted))

    for idx, str := range cpOptionSplitted {
        cpEntries[idx] = parseClassPathEntry(str)
    }

    return &ClassPath{cpEntries}
}<commit_msg>reorder methods<commit_after>package classpath

import (
    "errors"
    "os"
    "strings"
)

// :(linux/unix) or ;(windows)
const pathListSeparator = string(os.PathListSeparator)

type ClassPath struct {
    entries []ClassPathEntry
}

func ParseClassPath(cpOption string) (*ClassPath) {
    if cpOption == "" {
        return &ClassPath{}
    }

    cpOptionSplitted := strings.Split(cpOption, pathListSeparator)
    cpEntries := make([]ClassPathEntry, len(cpOptionSplitted))

    for i, str := range cpOptionSplitted {
        cpEntries[i] = parseClassPathEntry(str)
    }

    return &ClassPath{cpEntries}
}

// className: fully/qualified/ClassName
func (self *ClassPath) ReadClassData(className string) ([]byte, error) {
    className = className + ".class"
    for _, entry := range self.entries {
        data, err := entry.readClassData(className)
        if err == nil {
            return data, nil
        }
    }

    // todo
    err := errors.New("class not found!")
    return nil, err
}
{'fraction_non_alphanumeric': 0.12151394422310757, 'fraction_numerical': 0.0, 'mean_word_length': 3.018, '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': '226874', 'n_tokens_mistral': 619, 'n_tokens_neox': 605, 'n_words': 147}