projSupplyList = tmpProjResupply; supplyList = (ArrayList)refillRequisitions.clone();
projSupplyList = deepClone(refillProjections); supplyList = deepClone(refillRequisitions);
    public void takeSnapshot(Inventory inventory) {        ArrayList tmpProjWdraw = new ArrayList();	ArrayList tmpWdraw = new ArrayList();	ArrayList tmpProjResupply = new ArrayList();	Iterator due_outs;	for (int i=0; i < dueOutList.size(); i++) {	    due_outs = ((ArrayList)dueOutList.get(i)).iterator();	    while (due_outs.hasNext()) {	        Task task = (Task)due_outs.next();		if (task.getVerb().equals(Constants.Verb.WITHDRAW)) {		    tmpWdraw.add(task);		} else { // PROJECTWITHDRAW		    if (!tmpProjWdraw.contains(task)) {		      tmpProjWdraw.add(task);		    }		}	    }	}	projWithdrawList =tmpProjWdraw;	withdrawList = tmpWdraw;	Iterator projResupplyIt = refillProjections.iterator();	while(projResupplyIt.hasNext()) {	    Task task = (Task) projResupplyIt.next();	    if(!tmpProjResupply.contains(task)) {	        tmpProjResupply.add(task);	    }	}	projSupplyList = tmpProjResupply;	supplyList = (ArrayList)refillRequisitions.clone();	// MWD took this out when converted list to a schedule.	//    bufferedTargetLevels = (ArrayList)targetLevelsList.clone();	ArrayList tmpActualDemandTasksList = new ArrayList();	for (int i=0; i < dueOutList.size(); i++) {	    tmpActualDemandTasksList.add(getActualDemandTasks(i));	}	actualDemandTasksList = tmpActualDemandTasksList;	Vector list = new Vector();	long start = convertBucketToTime(0);	//the length of the critical level and inventory level 	//arrays should match up        int length = Math.max(getMeaningfulLength(criticalLevelsArray),			      getMeaningfulLength(inventoryLevelsArray));	int maxArrayLength = Math.min(criticalLevelsArray.length,				   inventoryLevelsArray.length);	if((length > maxArrayLength)  && (logger.isWarnEnabled())) {	    logger.warn(getOrgName() + "-" + getItemName() + " Meaningful length is " + length + "but, criticalLevelsArray length is " + criticalLevelsArray.length + " and the inventoryLevelsArray length is " + inventoryLevelsArray.length + ". Will truncate to eliminate array index out of bounds error.");	}	//We want to make sure the meaningful length doesn't exceed	//the length of either array.	length = Math.min(length,maxArrayLength);	for (int i=0; i < length; i++) {	    if(criticalLevelsArray[i] >= 0.0) {	        list.add(ScheduleUtils.buildQuantityScheduleElement(criticalLevelsArray[i],								    start, start+MSEC_PER_BUCKET));	    }	    start += MSEC_PER_BUCKET;	}	bufferedCriticalLevels = GLMFactory.newQuantitySchedule(list.elements(),								PlanScheduleType.OTHER);	start = convertBucketToTime(0);	list.clear();	for (int i=0; i < targetLevelsList.size(); i++) {	    Double targetLevel = (Double)targetLevelsList.get(i);	    if(targetLevel != null) {	        list.add(ScheduleUtils.buildQuantityScheduleElement(targetLevel.doubleValue(),start,start+MSEC_PER_BUCKET));	    }	    start += MSEC_PER_BUCKET;	}	bufferedTargetLevels = GLMFactory.newQuantitySchedule(list.elements(),							      PlanScheduleType.OTHER);	start = convertBucketToTime(0);	list.clear();        //length = 	for (int i=0; i < length; i++) {	    list.add(ScheduleUtils.buildQuantityScheduleElement(inventoryLevelsArray[i],								start, start+MSEC_PER_BUCKET));	    start += MSEC_PER_BUCKET;	}	bufferedInventoryLevels = GLMFactory.newQuantitySchedule(list.elements(),							    PlanScheduleType.OTHER);	NewScheduledContentPG scp = (NewScheduledContentPG)inventory.getScheduledContentPG();	scp.setSchedule(bufferedInventoryLevels);    }