<commit_before>package de.helwich.junit;

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

import org.junit.runner.Description;

/**
 * Called from JavaSript by jasmine mocks while interpreting the jasmine specs. Builds a spec description tree which can
 * be given to junit before tests are executed.
 * 
 * @author <NAME>
 */
public class JasmineDescriber {

    /**
     * Stack which is used to build a description tree. After the tests are interpreted, the stack holds the single
     * description tree element.
     */
    private final List<Description> descStack;

    /**
     * Can be set to true after the tests are interpreted to assure that no further tests are interpreted.
     */
    private boolean disabled = false;

    /**
     * Simple id counter used to give all descriptions a unique id.
     */
    private int descId = 1;

    private void pushDescription(Description desc) {
        checkEnabled();
        Description top = descStack.get(descStack.size() - 1);
        top.addChild(desc);
        descStack.add(desc);
    }

    private Description popDescription() {
        checkEnabled();
        return descStack.remove(descStack.size() - 1);
    }

    private void checkEnabled() {
        if (disabled) {
            throw new RuntimeException("describer used at an unexpected time");
        }
    }

    public JasmineDescriber() {
        descStack = new ArrayList<Description>();
    }

    public void describeStart(String description) {
        pushDescription(Description.createSuiteDescription(description, descId++));
    }

    public void describeEnd() {<commit_msg>fix description id (should be globally unique)<commit_after>package de.helwich.junit;

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

import org.junit.runner.Description;

/**
 * Called from JavaSript by jasmine mocks while interpreting the jasmine specs. Builds a spec description tree which can
 * be given to junit before tests are executed.
 * 
 * @author <NAME>
 */
public class JasmineDescriber {

    /**
     * Stack which is used to build a description tree. After the tests are interpreted, the stack holds the single
     * description tree element.
     */
    private final List<Description> descStack;

    /**
     * Can be set to true after the tests are interpreted to assure that no further tests are interpreted.
     */
    private boolean disabled = false;

    /**
     * Simple id counter used to give all descriptions a unique id.
     */
    private static int descId = 1;

    private void pushDescription(Description desc) {
        checkEnabled();
        Description top = descStack.get(descStack.size() - 1);
        top.addChild(desc);
        descStack.add(desc);
    }

    private Description popDescription() {
        checkEnabled();
        return descStack.remove(descStack.size() - 1);
    }

    private void checkEnabled() {
        if (disabled) {
            throw new RuntimeException("describer used at an unexpected time");
        }
    }

    public JasmineDescriber() {
        descStack = new ArrayList<Description>();
    }

    public void describeStart(String description) {
        pushDescription(Description.createSuiteDescription(description, descId++));
    }

    public void describeEnd() {
{'fraction_non_alphanumeric': 0.08623853211009175, 'fraction_numerical': 0.001834862385321101, 'mean_word_length': 2.7946635730858467, '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': '6715257', 'n_tokens_mistral': 865, 'n_tokens_neox': 814, 'n_words': 301}