if (sub == null ) { if (log.isDebugEnabled()) log.debug("No Frame changes"); return; }  RolePlayer player = getPlayer();  Enumeration en;   en = sub.getAddedList(); while (en.hasMoreElements()) { Frame frame = (Frame) en.nextElement(); if (log.isDebugEnabled()) { log.debug("Observed added "+frame); } Object fact = frameToFact(frame); if (fact instanceof Collection) { Iterator itr = ((Collection) fact).iterator(); while (itr.hasNext())  player.assertFact(itr.next()); } else if (fact != null) { player.assertFact(fact); } }    en = sub.getChangedList(); while (en.hasMoreElements()) { Frame frame = (Frame) en.nextElement(); if (log.isDebugEnabled()) { log.debug("Observed changed "+frame); } Collection changes = sub.getChangeReports(frame); Object fact = changesToFact(frame, changes); if (fact instanceof Collection) { Iterator itr = ((Collection) fact).iterator(); while (itr.hasNext())  player.assertFact(itr.next()); } else if (fact != null) { player.assertFact(fact); } }   en = sub.getRemovedList(); while (en.hasMoreElements()) { Frame frame = (Frame) en.nextElement(); if (log.isDebugEnabled()) { log.debug("Observed removed "+frame); } }
do_execute(bbs);
    public void execute(BlackboardService bbs)    {	if (sub == null /* || !sub.hasChanged() */) {	    if (log.isDebugEnabled())		log.debug("No Frame changes");	    return;	}	RolePlayer player = getPlayer();	Enumeration en;			// New Frames	en = sub.getAddedList();	while (en.hasMoreElements()) {	    Frame frame = (Frame) en.nextElement();	    if (log.isDebugEnabled()) {		log.debug("Observed added "+frame);	    }	    Object fact = frameToFact(frame);	    if (fact instanceof Collection) {		Iterator itr = ((Collection) fact).iterator();		while (itr.hasNext())  player.assertFact(itr.next());	    } else if (fact != null) {		player.assertFact(fact);	    }	}					// Changed Frames	en = sub.getChangedList();	while (en.hasMoreElements()) {	    Frame frame = (Frame) en.nextElement();	    if (log.isDebugEnabled()) {		log.debug("Observed changed "+frame);	    }	    Collection changes = sub.getChangeReports(frame);	    Object fact = changesToFact(frame, changes);	    if (fact instanceof Collection) {		Iterator itr = ((Collection) fact).iterator();		while (itr.hasNext())  player.assertFact(itr.next());	    } else if (fact != null) {		player.assertFact(fact);	    }	}			// Remove Frames.  TBD/	en = sub.getRemovedList();	while (en.hasMoreElements()) {	    Frame frame = (Frame) en.nextElement();	    if (log.isDebugEnabled()) {					log.debug("Observed removed "+frame);	    }	}    }