previousExecutionCourse.adjustShiftNames(previousShiftType); newExecutionCourse.adjustShiftNames(newShiftType);
previousExecutionCourse.setShiftNames(); if (newExecutionCourse != previousExecutionCourse) { newExecutionCourse.setShiftNames(); }
	public Object run(InfoShift infoShiftOld, InfoShift infoShiftNew) throws FenixServiceException,			ExcepcaoPersistencia {		newShiftIsValid(infoShiftOld, infoShiftNew.getTipo(), infoShiftNew.getInfoDisciplinaExecucao(), infoShiftNew.getLotacao());		final Shift shiftToEdit = rootDomainObject.readShiftByOID(infoShiftOld.getIdInternal());		final ExecutionCourse previousExecutionCourse = shiftToEdit.getDisciplinaExecucao();		final ExecutionCourse newExecutionCourse = rootDomainObject.readExecutionCourseByOID(infoShiftNew.getInfoDisciplinaExecucao().getIdInternal());		final ShiftType previousShiftType = shiftToEdit.getTipo();		final ShiftType newShiftType = infoShiftNew.getTipo();		final int capacityDiference = infoShiftNew.getLotacao().intValue() - shiftToEdit.getLotacao().intValue();		if (shiftToEdit.getAvailabilityFinal().intValue() + capacityDiference < 0) {			throw new InvalidFinalAvailabilityException();		}		final Shift otherShiftWithSameNewName = newExecutionCourse.findShiftByName(infoShiftNew.getNome());		if (otherShiftWithSameNewName != null && otherShiftWithSameNewName != shiftToEdit) {			throw new ExistingServiceException("Duplicate Entry: " + otherShiftWithSameNewName.getNome());		}		//shiftToEdit.setNome(infoShiftNew.getNome());		shiftToEdit.setTipo(infoShiftNew.getTipo());		shiftToEdit.setLotacao(infoShiftNew.getLotacao());		shiftToEdit.setAvailabilityFinal(new Integer(shiftToEdit.getAvailabilityFinal().intValue()				+ capacityDiference));        if (shiftToEdit.getDisciplinaExecucao() != newExecutionCourse) {            shiftToEdit.setDisciplinaExecucao(newExecutionCourse);        }		// Also change the type of associated lessons and lessons execution		// course		if (shiftToEdit.getAssociatedLessons() != null) {			for (int i = 0; i < shiftToEdit.getAssociatedLessons().size(); i++) {				shiftToEdit.getAssociatedLessons().get(i).setTipo(infoShiftNew.getTipo());			}		}		previousExecutionCourse.adjustShiftNames(previousShiftType);		newExecutionCourse.adjustShiftNames(newShiftType);		return InfoShift.newInfoFromDomain(shiftToEdit);	}