<commit_before>package test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.bitbucket.mlopatkin.android.liblogcat.LogRecord;
import org.bitbucket.mlopatkin.android.liblogcat.LogRecordParser;

public class TestDataLoader {
    private static final String filename = "test_data.txt";
    
    public static List<LogRecord> getRecords() {
        List<LogRecord> result = new ArrayList<LogRecord>();
        try {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            String s = in.readLine();
            while (s != null) {
                result.add(LogRecordParser.parseThreadtimeRecord(s));
                s = in.readLine();
            }            
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
}<commit_msg>Close stream in loader<commit_after>package test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.bitbucket.mlopatkin.android.liblogcat.LogRecord;
import org.bitbucket.mlopatkin.android.liblogcat.LogRecordParser;

public class TestDataLoader {
    private static final String filename = "test_data.txt";

    public static List<LogRecord> getRecords() {
        List<LogRecord> result = new ArrayList<LogRecord>();
        try {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            try {
                String s = in.readLine();
                while (s != null) {
                    result.add(LogRecordParser.parseThreadtimeRecord(s));
                    s = in.readLine();
                }
            } finally {
                in.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
}
{'fraction_non_alphanumeric': 0.09994794377928162, 'fraction_numerical': 0.0, 'mean_word_length': 2.279863481228669, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3489713', 'n_tokens_mistral': 530, 'n_tokens_neox': 519, 'n_words': 114}