<commit_before>package jdbj;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

public final class JDBJ {

    /**
     * @param resource
     * @return a phase 2 builder
     */
    public static ReturnsQuery query(String resource) {
        final URL url = JDBJ.class.getClassLoader().getResource(resource);
        if (url == null) {
            throw new IllegalArgumentException("resource not found: " + resource);
        }
        return queryString(readQueryResource(url));
    }

    /**
     * @param queryString
     * @return a phase 2 builder
     */
    public static ReturnsQuery queryString(String queryString) {
        final NamedParameterStatement statement = NamedParameterStatement.make(queryString);
        return new ReturnsQuery(statement);
    }

    /**
     * @param queryString
     * @return a phase 2 builder
     */
    public static InsertQuery insertQueryString(String queryString) {
        final NamedParameterStatement statement = NamedParameterStatement.make(queryString);
        return new InsertQuery(statement);
    }

    JDBJ() {

    }

    private static String readQueryResource(URL url) {
        final String queryString1;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()))) {

            final StringBuilder queryString = new StringBuilder();
            String line;
            while ((line = br.readLine()) != null) {
                queryString.append(line).append('\n');
            }
            queryString1 = queryString.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return queryString1;
    }
}
<commit_msg>refactor: simpler readQueryResource<commit_after>package jdbj;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

public final class JDBJ {

    /**
     * @param resource
     * @return a phase 2 builder
     */
    public static ReturnsQuery query(String resource) {
        final URL url = JDBJ.class.getClassLoader().getResource(resource);
        if (url == null) {
            throw new IllegalArgumentException("resource not found: " + resource);
        }
        return queryString(readQueryResource(url));
    }

    /**
     * @param queryString
     * @return a phase 2 builder
     */
    public static ReturnsQuery queryString(String queryString) {
        final NamedParameterStatement statement = NamedParameterStatement.make(queryString);
        return new ReturnsQuery(statement);
    }

    /**
     * @param queryString
     * @return a phase 2 builder
     */
    public static InsertQuery insertQueryString(String queryString) {
        final NamedParameterStatement statement = NamedParameterStatement.make(queryString);
        return new InsertQuery(statement);
    }

    JDBJ() {

    }

    private static String readQueryResource(URL url) {
        final StringBuilder queryString = new StringBuilder();
        try (BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()))) {


            String line;
            while ((line = br.readLine()) != null) {
                queryString.append(line).append('\n');
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return queryString.toString();
    }
}

{'fraction_non_alphanumeric': 0.09375915616759449, 'fraction_numerical': 0.002636976267213595, 'mean_word_length': 2.548856548856549, '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': '5297548', 'n_tokens_mistral': 884, 'n_tokens_neox': 864, 'n_words': 229}