Source:
<code>public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); errors.add(validator.getValidityInfoForNonNullField("feedback session name", feedbackSessionName)); errors.add(validator.getValidityInfoForNonNullField("course ID", courseId)); errors.add(validator.getValidityInfoForNonNullField("instructions to students", instructions)); errors.add(validator.getValidityInfoForNonNullField( "time for the session to become visible", sessionVisibleFromTime)); errors.add(validator.getValidityInfoForNonNullField("creator's email", creatorEmail)); errors.add(validator.getValidityInfoForNonNullField("session creation time", createdTime)); errors = getNonEmptyErrors(errors); if (!errors.isEmpty()) { return errors; } errors.add(validator.getInvalidityInfoForFeedbackSessionName(feedbackSessionName)); errors.add(validator.getInvalidityInfoForCourseId(courseId)); errors.add(validator.getInvalidityInfoForEmail(creatorEmail)); errors = getNonEmptyErrors(errors); if (this.isPrivateSession()) { return errors; } <START> errors.add(validator.getValidityInfoForNonNullField("submission opening time", startTime)); <END> errors.add(validator.getValidityInfoForNonNullField("submission closing time", endTime)); errors.add(validator.getValidityInfoForNonNullField( "time for the responses to become visible", resultsVisibleFromTime)); errors = getNonEmptyErrors(errors); if (!errors.isEmpty()) { return errors; } errors.add(validator.getInvalidityInfoForTimeForSessionStartAndEnd(startTime, endTime)); errors.add(validator.getInvalidityInfoForTimeForVisibilityStartAndSessionStart( sessionVisibleFromTime, startTime)); Date actualSessionVisibleFromTime = sessionVisibleFromTime; if (actualSessionVisibleFromTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING)) { actualSessionVisibleFromTime = startTime; } errors.add(validator.getInvalidityInfoForTimeForVisibilityStartAndResultsPublish( actualSessionVisibleFromTime, resultsVisibleFromTime)); return getNonEmptyErrors(errors); }</code><technical_language>a query: fields defined constants somewhere? If so, instead of hardcoded names</technical_language>

Target:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); addNonEmptyError(validator.getValidityInfoForNonNullField( FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, feedbackSessionName), errors); addNonEmptyError(validator.getValidityInfoForNonNullField(FieldValidator.COURSE_ID_FIELD_NAME, courseId), errors); addNonEmptyError(validator.getValidityInfoForNonNullField("instructions to students", instructions), errors); addNonEmptyError(validator.getValidityInfoForNonNullField( "time for the session to become visible", sessionVisibleFromTime), errors); addNonEmptyError(validator.getValidityInfoForNonNullField("creator's email", creatorEmail), errors); addNonEmptyError(validator.getValidityInfoForNonNullField("session creation time", createdTime), errors); if (!errors.isEmpty()) { return errors; } addNonEmptyError(validator.getInvalidityInfoForFeedbackSessionName(feedbackSessionName), errors); addNonEmptyError(validator.getInvalidityInfoForCourseId(courseId), errors); addNonEmptyError(validator.getInvalidityInfoForEmail(creatorEmail), errors); if (this.isPrivateSession()) { return errors; } addNonEmptyError(validator.getValidityInfoForNonNullField("submission opening time", startTime), errors); addNonEmptyError(validator.getValidityInfoForNonNullField("submission closing time", endTime), errors); addNonEmptyError(validator.getValidityInfoForNonNullField( "time for the responses to become visible", resultsVisibleFromTime), errors); if (!errors.isEmpty()) { return errors; } addNonEmptyError(validator.getInvalidityInfoForTimeForSessionStartAndEnd(startTime, endTime), errors); addNonEmptyError(validator.getInvalidityInfoForTimeForVisibilityStartAndSessionStart( sessionVisibleFromTime, startTime), errors); Date actualSessionVisibleFromTime = sessionVisibleFromTime; if (actualSessionVisibleFromTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING)) { actualSessionVisibleFromTime = startTime; } addNonEmptyError(validator.getInvalidityInfoForTimeForVisibilityStartAndResultsPublish( actualSessionVisibleFromTime, resultsVisibleFromTime), errors); return errors; }