MergeHeader hdr, rsp_hdr; PingRsp rsp; Object coord;
MergeHeader hdr;
    public void up(Event evt) {        Message msg, rsp_msg;        Object obj;        MergeHeader hdr, rsp_hdr;        PingRsp rsp;        Object coord;        Address sender;        boolean contains;        Vector tmp;        switch(evt.getType()) {            case Event.MSG:                msg=(Message)evt.getArg();                obj=msg.getHeader(getName());                if(obj == null || !(obj instanceof MergeHeader)) {                    passUp(evt);                    return;                }                hdr=(MergeHeader)msg.removeHeader(getName());                switch(hdr.type) {                    case MergeHeader.HELLO:          // if coord: handle, else: discard                        if(!is_server || !is_coord) {                            return;                        }                        if(merging) {                            return;                        }                        sender=msg.getSrc();                        if((sender != null) && (members.size() >= 0)) {                            synchronized(members) {                                contains=members.contains(sender);                            }                            //merge only with lower addresses :prevents cycles and ensures that the new coordinator is correct.                            if(!contains && sender.compareTo(local_addr) < 0) {                                if(log.isInfoEnabled())                                    log.info("membership " + members +                                            " does not contain " + sender + "; merging it");                                tmp=new Vector();                                tmp.addElement(sender);                                merging=true;                                passUp(new Event(Event.MERGE, tmp));                            }                        }                        return;                    default:                        if(log.isErrorEnabled()) log.error("got MERGE hdr with unknown type (" + hdr.type + ')');                        return;                }            case Event.SET_LOCAL_ADDRESS:                local_addr=(Address)evt.getArg();                passUp(evt);                break;            default:                passUp(evt);            // Pass up to the layer above us                break;        }    }