public void setMission(Mission mission) {
        final Mission oldMission = this.mission;
        if (mission == oldMission) {
            return;
        } else if (oldMission == null) {
            if (!mission.isOneTime()) {
                logger.fine("Replacing null mission with " + mission);
            }
        } else {
            String reason = oldMission.invalidReason();
            reason = (reason != null) ? "(" + reason + ")"
                : (oldMission.isOneTime()) ? "(oneTime)"
                : "(forced)";
            if (!(oldMission.isOneTime() && mission.isOneTime())) {
                logger.fine("Replacing " + reason + " old mission "
                    + oldMission + " with " + mission);
            }
            oldMission.dispose();
        }
        this.mission = mission;
        this.dynamicPriority = 0;
    }