if (log.isDebugEnabled()) {
if (log.isErrorEnabled()) {
  public void execute() {    if(log.isDebugEnabled()) {      String msg = "execute: " + this;      log.debug(msg);    }    long currentTime = currentTimeMillis();    Enumeration addedRWEs = rweSub.getAddedList();    while(addedRWEs.hasMoreElements()) {      RealWorldEvent rwe = (RealWorldEvent)addedRWEs.nextElement();      if (rwe == null) {	// error!	if (log.isDebugEnabled()) {	  log.error("execute: " + this + " got null RWE on subscription");	}	continue;      }      ImpactModel model = rwe.getModel();      if (model == null) {	// error!	if (log.isDebugEnabled()) {	  log.error("execute: " + this + " got null RWE model from event: " + rwe);	}	continue;      }      if (log.isDebugEnabled()) {	log.debug("execute: " + this + ": about to get impacts of " + rwe);      }      // give the model the world and a factory      Iterator effects = model.getImpact(world, theIEF);      // the effects should already have Time set      // as well as the IE specific fields            if (effects == null) {	// error!  No impact!	if (log.isDebugEnabled()) {	  log.debug("execute: " + this + " null effects on the world for " + rwe);	}	continue;      } else if (effects.equals(EmptyIterator.iterator())) {	// error!  No impact!	if (log.isDebugEnabled()) {	  log.debug("execute: " + this + " empty Iterator effects on the world for " + rwe);	}	continue;      } else if (!(effects.hasNext())) {	// error!  No impact!	if (log.isDebugEnabled()) {	  log.debug("execute: " + this + " iterator wo next effects on the world for " + rwe);	}	continue;      } else {	if (log.isDebugEnabled()) {	  log.debug("execute: " + this + " got effects for " + rwe);	}	for ( ; effects.hasNext(); ) {	  // publish each of the events	  InfrastructureEvent ie = (InfrastructureEvent)effects.next();	  if (ie != null) {	    // log something	    if (log.isDebugEnabled()) {	      log.debug("execute: " + this + " publishing effect: " + ie);	    }	    // Right here, I could not publish ies destined to a Customer Agent	    // Note that isolating a customer node is OK, just not	    // effecting the Node itself	    if (ie.getDestination().toString().indexOf("Customer") != -1) {	      // This is heading to a customer agent!	      if (ie.isNodeType()) {		// to effect the Node (vs the wire)//  		if (log.isDebugEnabled()) {//  		  log.debug("execute: " + this + " not publishing effect on Customer agent node: " + ie);//  		}//  		continue;	      }	    }	    // Make sure all the fields are filled in:	    ((NewInfrastructureEvent)ie).setSource(getAgentIdentifier());	    ((NewInfrastructureEvent)ie).setPublisher(this.toString());	    // ie.setPlan(???)???	    	    // Should this be publishAddAfter(ie, ie.getTime())???	    //	    publishAdd(ie);	    publishAddAt(ie, ie.getTime());	  } else {	    if (log.isDebugEnabled()) {	      log.error("execute: " + this + " got null IE as an effect!");	    }	  }	} // end of loop to publish the IEs      }    } // end of loop over rweSub  } // end of execute()