if(h1.seqno == h2.seqno && m1.getSrc().equals(m2.getSrc())) { present = true; } } if (!present) final_v.addElement(m1); }
for(int j=0; j < final_v.size(); j++) { m2=(Message)final_v.elementAt(j); h2=m2 != null? (NakAckHeader)m2.getHeader(getName()) : null; if(m2 == null || h2 == null) { Trace.error("NAKACK.rebroadcastMsgs()", "message m2 is null"); continue; } if(h1.seqno == h2.seqno && m1.getSrc().equals(m2.getSrc())) { present=true; } } if(!present) final_v.addElement(m1); }
     void rebroadcastMsgs(Vector v) {	    Vector        final_v=new Vector();	    Message       m1, m2;	    NakAckHeader  h1, h2;	    if(v == null) return;	    // weed out duplicates	    /** @todo Check!!!!! */	    for(int i=0; i < v.size(); i++) {		boolean present = false;		m1=(Message)v.elementAt(i);		if(m1 == null) { // +++ remove		    Trace.error("NAKACK.rebroadcastMsgs()", "message is null");		    continue;		}		h1=(NakAckHeader)m1.getHeader(getName());		for(int j=0; j < final_v.size(); j++) {		    m2=(Message)final_v.elementAt(j);		    h2=(NakAckHeader)m2.getHeader(getName());		    if(h1.seqno == h2.seqno && m1.getSrc().equals(m2.getSrc())) {			present = true;		    }		}		if (!present) final_v.addElement(m1);	    }	    if(Trace.trace)		Trace.warn("NAKACK.rebroadcastMsgs()", "rebroadcasting " + final_v.size() + " messages");	    /* Now re-broadcast messages using original NakAckHeader (same seqnos, same sender !) */	    for(int i=0; i < final_v.size(); i++) {		m1=(Message)final_v.elementAt(i);		naker.resend(m1);	    }	    // Wait until all members have acked reception of outstanding msgs. This will empty our	    // retransmission table (AckMcastSenderWindow)	    naker.waitUntilAllAcksReceived(rebroadcast_timeout);	    passUp(new Event(Event.REBROADCAST_MSGS_OK));     }