<commit_before>package sds

import java.io.File
import java.util.jar.JarEntry
import java.util.jar.JarFile
import kotlin.collections.MutableList

class SDS(args: Array<String>) {
    private var jar: JarFile? = null
    private val classfiles: MutableList<String> = mutableListOf()


    init {
        args.forEach { parseArgs(it) }
    }

    private fun parseArgs(arg: String) {
        when {
            arg.endsWith(".jar")   -> this.jar = JarFile(File(arg))
            arg.endsWith(".class") -> classfiles.add(arg)
            else -> throw IllegalArgumentException("invalid file.")
        }
    }

    fun run() {
        if(classfiles.isNotEmpty()) {
            classfiles.forEach { file: String ->
                val reader: ClassfileReader = ClassfileReader(file)
            }
        }
        // not execute if jar is null
        jar?.stream()?.forEach { entry: JarEntry? ->
            val file: String = entry.toString()
            if(file.endsWith(".class")) {
                // throws Exception if jar is null
                val reader: ClassfileReader = ClassfileReader(jar!!.getInputStream(entry))
            }
        }
    }
}<commit_msg>use list<commit_after>package sds

import java.io.File
import java.util.jar.JarEntry
import java.util.jar.JarFile
import kotlin.collections.MutableList

class SDS(args: Array<String>) {
    private var jarfiles: MutableList<JarFile> = mutableListOf()
    private val classfiles: MutableList<String> = mutableListOf()


    init {
        args.forEach { parseArgs(it) }
    }

    private fun parseArgs(arg: String) {
        when {
            arg.endsWith(".jar")   -> jarfiles.add(JarFile(File(arg)))
            arg.endsWith(".class") -> classfiles.add(arg)
            else -> throw IllegalArgumentException("invalid file.")
        }
    }

    fun run() {
        if(classfiles.isNotEmpty()) {
            classfiles.forEach { file: String ->
                val reader: ClassfileReader = ClassfileReader(file)
            }
        }
        // not execute if jar is null
        jarfiles.forEach { jar : JarFile ->
            jar.stream().forEach { entry: JarEntry ->
                val file: String = entry.toString()
                if(file.endsWith(".class")) {
                    // throws Exception if jar is null
                    val reader: ClassfileReader = ClassfileReader(jar.getInputStream(entry))
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.1134780827529701, 'fraction_numerical': 0.0, 'mean_word_length': 1.9386281588447654, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 19, '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': '4981094', 'n_tokens_mistral': 693, 'n_tokens_neox': 670, 'n_words': 151}