<commit_before>package fi.paivola.mapserver.core;

import fi.paivola.mapserver.core.setting.SettingMaster;

/**
 * The base class for connection models.
 *
 * @author Juhani
 */
public abstract class ConnectionModel extends Model {

    public boolean passtrough;

    public ConnectionModel(int id, SettingMaster sm) {
        super(id, sm);
        this.type = "connection";
        this.passtrough = true;
        this.maxConnections = 2;
    }
    
    public ConnectionModel() {
        super();
        this.type = "connection";
        this.passtrough = true;
        this.maxConnections = 2;
    }

    /**
     * Adds a event to all connections except one.
     *
     * @param e event thats added
     * @param m model to ignore
     */
    public void addEventToAllExceptOne(Event e, Model m) {
        for (Model i : this.connections) {
            if (i != m) {
                i.addEvent(e, m);
            }
        }
    }

    @Override
    public void addEvent(Event e, Model m) {
        if (this.passtrough) {
            this.addEventToAllExceptOne(e, m);
        } else {
            super.addEvent(e, m);
        }
    }

    @Override
    public boolean linkModel(Model m) {
        if (this.connections.size() >= 2) {
            return false;
        }
        return super.linkModel(m);
    }

}<commit_msg>redurant override<commit_after>package fi.paivola.mapserver.core;

import fi.paivola.mapserver.core.setting.SettingMaster;

/**
 * The base class for connection models.
 *
 * @author Juhani
 */
public abstract class ConnectionModel extends Model {

    public boolean passtrough;

    public ConnectionModel(int id, SettingMaster sm) {
        super(id, sm);
        this.type = "connection";
        this.passtrough = true;
        this.maxConnections = 2;
    }
    
    public ConnectionModel() {
        super();
        this.type = "connection";
        this.passtrough = true;
        this.maxConnections = 2;
    }

    /**
     * Adds a event to all connections except one.
     *
     * @param e event thats added
     * @param m model to ignore
     */
    public void addEventToAllExceptOne(Event e, Model m) {
        for (Model i : this.connections) {
            if (i != m) {
                i.addEvent(e, m);
            }
        }
    }

    @Override
    public void addEvent(Event e, Model m) {
        if (this.passtrough) {
            this.addEventToAllExceptOne(e, m);
        } else {
            super.addEvent(e, m);
        }
    }

}
{'fraction_non_alphanumeric': 0.10496794871794872, 'fraction_numerical': 0.002003205128205128, 'mean_word_length': 1.8407281001137656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5525572', 'n_tokens_mistral': 769, 'n_tokens_neox': 742, 'n_words': 193}