<commit_before>package com.github.qrokodial.sparkle.events.emission;

import com.github.qrokodial.sparkle.events.Event;
import com.github.qrokodial.sparkle.events.EventListener;
import com.github.qrokodial.sparkle.events.filtering.ListenerFilter;
import com.github.qrokodial.sparkle.events.util.Priority;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class EventManager implements EventEmitter {
    private List<EventListener> listeners;
    private Map<EventListener, List<ListenerFilter>> filterMap;

    /**
     * Instantiates the class.
     */
    public EventManager() {
        listeners = new ArrayList<>();
        filterMap = new ConcurrentHashMap<>();
    }

    /**
     * Registers event listeners with a given order/priority.
     *
     * @param priority indicates the order/priority in which an event will travel through event listeners
     * @param listeners
     */
    @Override
    public void registerListeners(Priority priority, EventListener... listeners) {
        for (EventListener listener : listeners) {
            registerListener(listener);
        }
    }

    /**
     * Registers event listeners. Defaults to the {@link Priority#NORMAL} priority.
     *
     * @param listeners
     */
    @Override
    public void registerListeners(EventListener... listeners) {<commit_msg>Ensure priority in registering listeners<commit_after>package com.github.qrokodial.sparkle.events.emission;

import com.github.qrokodial.sparkle.events.Event;
import com.github.qrokodial.sparkle.events.EventListener;
import com.github.qrokodial.sparkle.events.filtering.ListenerFilter;
import com.github.qrokodial.sparkle.events.util.Priority;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class EventManager implements EventEmitter {
    private List<EventListener> listeners;
    private Map<EventListener, List<ListenerFilter>> filterMap;

    /**
     * Instantiates the class.
     */
    public EventManager() {
        listeners = new ArrayList<>();
        filterMap = new ConcurrentHashMap<>();
    }

    /**
     * Registers event listeners with a given order/priority.
     *
     * @param priority indicates the order/priority in which an event will travel through event listeners
     * @param listeners
     */
    @Override
    public void registerListeners(Priority priority, EventListener... listeners) {
        for (EventListener listener : listeners) {
            registerListener(priority, listener);
        }
    }

    /**
     * Registers event listeners. Defaults to the {@link Priority#NORMAL} priority.
     *
     * @param listeners
     */
    @Override
    public void registerListeners(EventListener... listeners) {
{'fraction_non_alphanumeric': 0.09525458953931416, 'fraction_numerical': 0.0, 'mean_word_length': 3.375757575757576, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2499922', 'n_tokens_mistral': 765, 'n_tokens_neox': 766, 'n_words': 193}