<commit_before>package echowand.sample;

import echowand.common.EPC;
import echowand.info.NodeProfileInfo;
import echowand.logic.MainLoop;
import echowand.logic.RequestDispatcher;
import echowand.logic.TooManyObjectsException;
import echowand.logic.TransactionManager;
import echowand.net.InetSubnet;
import echowand.net.Node;
import echowand.net.Subnet;
import echowand.net.SubnetException;
import echowand.object.*;
import echowand.util.Selector;
import java.net.BindException;
import java.util.LinkedList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author <NAME>
 */
public class Sample5 {
    
    public static NodeProfileInfo createNodeProfileInfo() {
        NodeProfileInfo nodeProfileInfo = new NodeProfileInfo();
        nodeProfileInfo.add(EPC.x97, true, false, false, 2);
        nodeProfileInfo.add(EPC.x98, true, false, false, 4);
        return nodeProfileInfo;
    }
    public static LocalObject createNodeProfileObject(Subnet subnet, LocalObjectManager manager, TransactionManager transactionManager) {
        LocalObject nodeProfileObject = new LocalObject(createNodeProfileInfo());
        nodeProfileObject.addDelegate(new LocalObjectDateTimeDelegate());
        nodeProfileObject.addDelegate(new NodeProfileObjectDelegate(manager));
        nodeProfileObject.addDelegate(new LocalObjectNotifyDelegate(subnet, transactionManager));
        return nodeProfileObject;
    }
    
    
    public static LinkedList<Node> getRemoteNodes(RemoteObjectManager remoteManager) {
        LinkedList<RemoteObject> objects = remoteManager.get(new Selector<RemoteObject>(){
            @Override
            public boolean select(RemoteObject obj){ return true; }
        });
        
        LinkedList<Node> nodes = new LinkedList<Node>();
        for (RemoteObject object : objects) {
            if (!nodes.contains(object.getNode())) {
                nodes.add(object.getNode());
            }
        }
        
        return nodes;
    }
    
    public static LinkedList<RemoteObject> getRemoteObjectsAt(final Node node, RemoteObjectManager remoteManager) {
        return remoteManager.get(new Selector<RemoteObject>(){
            @Override
            public boolean select(RemoteObject obj){ return obj.getNode().equals(node); }
        });
    }
    
    public static void main(String[] args) throws TooManyObjectsException, BindException {
        InetSubnet subnet = new InetSubnet();
        TransactionManager transactionManager = new TransactionManager(subnet);
        RemoteObjectManager remoteManager = new RemoteObjectManager();
        LocalObjectManager localManager = new LocalObjectManager();
        LocalObject nodeProfile = createNodeProfileObject(subnet, localManager, transactionManager);
        localManager.add(nodeProfile);
        
        RequestDispatcher requestDispatcher = new RequestDispatcher();
        requestDispatcher.addRequestProcessor(new SetGetRequestProcessor(localManager));
        requestDispatcher.addRequestProcessor(new AnnounceRequestProcessor(localManager, remoteManager));
        
        MainLoop loop = new MainLoop();
        loop.setSubnet(subnet);
        loop.addListener(requestDispatcher);
        loop.addListener(transactionManager);
        
        Thread loopThread = new Thread(loop);
        loopThread.setDaemon(true);
        loopThread.start();
        
        InstanceListRequestExecutor updater = new InstanceListRequestExecutor(subnet, transactionManager, remoteManager);
        try {
            updater.executeAndJoin();
        } catch (SubnetException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        
        for (Node node: getRemoteNodes(remoteManager)) {
            System.out.println(node);
            for (RemoteObject object: getRemoteObjectsAt(node, remoteManager)) {
                try {
                    System.out.println("  " + object.getEOJ() + " " + object.getData(EPC.x9F));
                } catch (EchonetObjectException ex) {
                    Logger.getLogger(Sample5.class.getName()).log(Level.SEVERE, object.getEOJ().toString(), ex);
                }
            }
        }
    }
}
<commit_msg>Deleted executeAndJoin method from InstanceListRequestExecutor.<commit_after>package echowand.sample;

import echowand.common.EPC;
import echowand.info.NodeProfileInfo;
import echowand.logic.MainLoop;
import echowand.logic.RequestDispatcher;
import echowand.logic.TooManyObjectsException;
import echowand.logic.TransactionManager;
import echowand.net.InetSubnet;
import echowand.net.Node;
import echowand.net.Subnet;
import echowand.net.SubnetException;
import echowand.object.*;
import echowand.util.Selector;
import java.net.BindException;
import java.util.LinkedList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author <NAME>
 */
public class Sample5 {
    
    public static NodeProfileInfo createNodeProfileInfo() {
        NodeProfileInfo nodeProfileInfo = new NodeProfileInfo();
        nodeProfileInfo.add(EPC.x97, true, false, false, 2);
        nodeProfileInfo.add(EPC.x98, true, false, false, 4);
        return nodeProfileInfo;
    }
    public static LocalObject createNodeProfileObject(Subnet subnet, LocalObjectManager manager, TransactionManager transactionManager) {
        LocalObject nodeProfileObject = new LocalObject(createNodeProfileInfo());
        nodeProfileObject.addDelegate(new LocalObjectDateTimeDelegate());
        nodeProfileObject.addDelegate(new NodeProfileObjectDelegate(manager));
        nodeProfileObject.addDelegate(new LocalObjectNotifyDelegate(subnet, transactionManager));
        return nodeProfileObject;
    }
    
    
    public static LinkedList<Node> getRemoteNodes(RemoteObjectManager remoteManager) {
        LinkedList<RemoteObject> objects = remoteManager.get(new Selector<RemoteObject>(){
            @Override
            public boolean select(RemoteObject obj){ return true; }
        });
        
        LinkedList<Node> nodes = new LinkedList<Node>();
        for (RemoteObject object : objects) {
            if (!nodes.contains(object.getNode())) {
                nodes.add(object.getNode());
            }
        }
        
        return nodes;
    }
    
    public static LinkedList<RemoteObject> getRemoteObjectsAt(final Node node, RemoteObjectManager remoteManager) {
        return remoteManager.get(new Selector<RemoteObject>(){
            @Override
            public boolean select(RemoteObject obj){ return obj.getNode().equals(node); }
        });
    }
    
    public static void main(String[] args) throws TooManyObjectsException, BindException {
        InetSubnet subnet = new InetSubnet();
        TransactionManager transactionManager = new TransactionManager(subnet);
        RemoteObjectManager remoteManager = new RemoteObjectManager();
        LocalObjectManager localManager = new LocalObjectManager();
        LocalObject nodeProfile = createNodeProfileObject(subnet, localManager, transactionManager);
        localManager.add(nodeProfile);
        
        RequestDispatcher requestDispatcher = new RequestDispatcher();
        requestDispatcher.addRequestProcessor(new SetGetRequestProcessor(localManager));
        requestDispatcher.addRequestProcessor(new AnnounceRequestProcessor(localManager, remoteManager));
        
        MainLoop loop = new MainLoop();
        loop.setSubnet(subnet);
        loop.addListener(requestDispatcher);
        loop.addListener(transactionManager);
        
        Thread loopThread = new Thread(loop);
        loopThread.setDaemon(true);
        loopThread.start();
        
        InstanceListRequestExecutor updater = new InstanceListRequestExecutor(subnet, transactionManager, remoteManager);
        try {
            updater.execute();
            updater.join();
        } catch (SubnetException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        
        for (Node node: getRemoteNodes(remoteManager)) {
            System.out.println(node);
            for (RemoteObject object: getRemoteObjectsAt(node, remoteManager)) {
                try {
                    System.out.println("  " + object.getEOJ() + " " + object.getData(EPC.x9F));
                } catch (EchonetObjectException ex) {
                    Logger.getLogger(Sample5.class.getName()).log(Level.SEVERE, object.getEOJ().toString(), ex);
                }
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.08818161076887976, 'fraction_numerical': 0.002053388090349076, 'mean_word_length': 2.7513906718014547, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1763306', 'n_tokens_mistral': 2241, 'n_tokens_neox': 2188, 'n_words': 437}