log.error("-- error: header was null");
System.err.println("-- error: header was null");
    public void receive(Message msg) {        Address  sender=msg.getSrc();        MyHeader hdr=(MyHeader)msg.removeHeader(HDRNAME);        if(hdr == null) {            log.error("-- error: header was null");            return;        }        switch(hdr.type) {            case MyHeader.START:                updateTimestamp();                new Thread() {                    public void run() {                        // needs to be done in a separate thread; otherwise we cannot receive                        // data messages until we have sent all messages (sendMessages() returned).                        sendMessages();                    }                }.start();                break;            case MyHeader.DATA:                Entry entry=(Entry)data.get(sender);                if(entry == null) {                    log.error("-- received a message from " + sender + ", who is not in the list");                }                else {                    entry.add(hdr.seqno);                    if((hdr.seqno) % 100 == 0)                        System.out.println("-- received " + sender + ':' + hdr.seqno);                    if(entry.getNumReceived() >= num_bursts * num_msgs_per_burst) {                        if(entry.done())                            System.out.println("*--* " + sender + " DONE");                    }                }                break;            case MyHeader.DONE:                break;            case MyHeader.CLEAR:                clear();                break;            default:                break;        }    }