<commit_before>package at.ac.tuwien.dsg.pubsub.subscriber.comp;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import at.ac.tuwien.dsg.myx.monitor.AbstractVirtualExternalMyxSimpleBrick;
import at.ac.tuwien.dsg.myx.util.MyxMonitoringUtils;
import at.ac.tuwien.dsg.pubsub.message.Message;
import at.ac.tuwien.dsg.pubsub.message.Topic;
import at.ac.tuwien.dsg.pubsub.middleware.interfaces.ISubscriber;
import at.ac.tuwien.dsg.pubsub.middleware.myx.DynamicArchitectureModelProperties;
import at.ac.tuwien.dsg.pubsub.network.Endpoint;
import at.ac.tuwien.dsg.pubsub.subscriber.myx.MyxInterfaceNames;
import edu.uci.isr.myx.fw.IMyxName;

public abstract class Subscriber<E> extends AbstractVirtualExternalMyxSimpleBrick {

    public static IMyxName OUT_ISUBSCRIBER = MyxInterfaceNames.ISUBSCRIBER;

    private Topic.Type topicType;
    private List<String> topics = new ArrayList<>();

    protected Endpoint<E> endpoint;
    private ISubscriber<E> subscriber;

    private ExecutorService executor;
    private Runnable runnable;

    @Override
    public Object getServiceObject(@SuppressWarnings("unused") IMyxName interfaceName) {
        return null;
    }

    @Override
    public void init() {
        Properties initProps = MyxMonitoringUtils.getInitProperties(this);

        topicType = Topic.Type.valueOf(initProps.getProperty("topicType", "GLOB"));
        for (String key : initProps.stringPropertyNames()) {
            if (key.startsWith("topicName")) {
                topics.add(initProps.getProperty(key));
            }
        }
        // if no topics are given set the default topic
        if (topics.isEmpty()) {
            topics.add(".*");
        }

        executor = Executors.newSingleThreadExecutor();<commit_msg>bugfix: updated default topic<commit_after>package at.ac.tuwien.dsg.pubsub.subscriber.comp;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import at.ac.tuwien.dsg.myx.monitor.AbstractVirtualExternalMyxSimpleBrick;
import at.ac.tuwien.dsg.myx.util.MyxMonitoringUtils;
import at.ac.tuwien.dsg.pubsub.message.Message;
import at.ac.tuwien.dsg.pubsub.message.Topic;
import at.ac.tuwien.dsg.pubsub.middleware.interfaces.ISubscriber;
import at.ac.tuwien.dsg.pubsub.middleware.myx.DynamicArchitectureModelProperties;
import at.ac.tuwien.dsg.pubsub.network.Endpoint;
import at.ac.tuwien.dsg.pubsub.subscriber.myx.MyxInterfaceNames;
import edu.uci.isr.myx.fw.IMyxName;

public abstract class Subscriber<E> extends AbstractVirtualExternalMyxSimpleBrick {

    public static IMyxName OUT_ISUBSCRIBER = MyxInterfaceNames.ISUBSCRIBER;

    private Topic.Type topicType;
    private List<String> topics = new ArrayList<>();

    protected Endpoint<E> endpoint;
    private ISubscriber<E> subscriber;

    private ExecutorService executor;
    private Runnable runnable;

    @Override
    public Object getServiceObject(@SuppressWarnings("unused") IMyxName interfaceName) {
        return null;
    }

    @Override
    public void init() {
        Properties initProps = MyxMonitoringUtils.getInitProperties(this);

        topicType = Topic.Type.valueOf(initProps.getProperty("topicType", "GLOB"));
        for (String key : initProps.stringPropertyNames()) {
            if (key.startsWith("topicName")) {
                topics.add(initProps.getProperty(key));
            }
        }
        // if no topics are given set the default topic
        if (topics.isEmpty()) {
            topics.add("*");
        }

        executor = Executors.newSingleThreadExecutor();
{'fraction_non_alphanumeric': 0.10493013445821249, 'fraction_numerical': 0.0, 'mean_word_length': 3.808618504435995, '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': '681830', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1189, 'n_words': 206}