if(GLMDebug.printDebug()) GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), No DueOuts or DueIns, resetting schedule.");
if (logger.isDebugEnabled()) { logger.debug("UpdateContentSchedule(), No DueOuts or DueIns, resetting schedule."); }
  public int updateContentSchedule(Inventory inventory) {    ScheduledContentPG scp = inventory.getScheduledContentPG();    QuantityScheduleElement qse;    Vector new_elements = new Vector();    if (level_ == null) {      determineInventoryLevels();    }    if (level_ == null) {      if(GLMDebug.printDebug()) GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), No DueOuts or DueIns, resetting schedule.");      clearContentSchedule(inventory);    } else {      int days = level_.length;      updateLevels(days - 1); // Be sure we have all the days computed.      //  	    if(GLMDebug.printDebug()) GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), Creating new Schedule for "+AssetUtils.assetDesc(inventory));      for (int i = 0; i < days; i++) {	// start time is eigher today or time 1st request was received + number of planning days	long start = TimeUtils.addNDaysTime(getStartTime(), i);	// end time is a millisecond before start time of next day	long end = TimeUtils.addNDaysTime(getStartTime(), (i+1));	try {	  qse = ScheduleUtils.buildQuantityScheduleElement(level_[i], start, end);	} catch (IllegalArgumentException iae) {	  iae.printStackTrace();	  continue;	}//  		if(GLMDebug.printDebug()) GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), Start:"+TimeUtils.dateString(start)+//  			       ", End:"+TimeUtils.dateString(end)+", Qty: "+level_[i]);	new_elements.add(qse);      }    }    Schedule new_schedule = GLMFactory.newQuantitySchedule(new_elements.elements(), 							   PlanScheduleType.TOTAL_INVENTORY);    if (ScheduleUtils.isOffendingSchedule(new_schedule)) {      GLMDebug.ERROR("InventoryBG", "UpdateContentSchedule(),  CREATED BAD SCHEDULE ");      printQuantityScheduleTimes(new_schedule);    }    ((NewScheduledContentPG)scp).setSchedule(new_schedule);    return 0;  }