Source:
public CourseEditSectionRow(String sectionName, List<String> sectionNames, int sectionIndex, InstructorAttributes instructor, int instructorIndex, List<String> feedbackNames) { this.sectionName = sectionName; this.instructor = instructor; feedbackSessions = new ArrayList<CourseEditFeedbackSessionRow>(); specialSections = createSpecialSectionsForSectionRow(sectionNames, sectionIndex); permissionInputGroup2 = createPermissionInputGroup2ForSectionRow(sectionIndex); permissionInputGroup3 = createPermissionInputGroup3ForSectionRow(sectionIndex); String content = ""; String onClick = ""; if (!isSessionsInSectionSpecial()) { content = "Give different permissions for sessions in this section"; onClick = "showTuneSessionnPermissionsDiv(" + instructorIndex + ", " + sectionIndex + ")"; } else { content = "Hide session-level permissions"; onClick = "hideTuneSessionnPermissionsDiv(" + instructorIndex + ", " + sectionIndex + ")"; } String id = "toggleSessionLevelInSection" + sectionIndex + "ForInstructor" + instructorIndex; toggleSessionLevelInSectionButton = createButton(content, "small col-sm-5", id, "javascript:;", null, onClick, false); for (String feedbackName : feedbackNames) { String[] privileges = {Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS}; List<ElementTag> checkBoxList = new ArrayList<ElementTag>(); for (String privilege : privileges) { String name = privilege + Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionIndex + "feedback" + feedbackName; boolean isChecked = (instructor != null) && instructor.isAllowedForPrivilege(sectionName, feedbackName, privilege); checkBoxList.add(createCheckBox(null, name, "true", isChecked)); } CourseEditFeedbackSessionRow feedbackSessionRow = new CourseEditFeedbackSessionRow(feedbackName, checkBoxList); feedbackSessions.add(feedbackSessionRow); } }

Target:
public CourseEditSectionRow(String sectionName, List<String> sectionNames, int sectionIndex, InstructorAttributes instructor, int instructorIndex, List<String> feedbackNames) { this.sectionName = sectionName; this.instructor = instructor; feedbackSessions = new ArrayList<CourseEditFeedbackSessionRow>(); specialSections = createSpecialSectionsForSectionRow(sectionNames, sectionIndex); permissionInputGroup2 = createPermissionInputGroup2ForSectionRow(sectionIndex); permissionInputGroup3 = createPermissionInputGroup3ForSectionRow(sectionIndex); String content = ""; String onClick = ""; if (!isSessionsInSectionSpecial()) { content = "Give different permissions for sessions in this section"; onClick = "showTuneSessionnPermissionsDiv(" + instructorIndex + ", " + sectionIndex + ")"; } else { content = "Hide session-level permissions"; onClick = "hideTuneSessionnPermissionsDiv(" + instructorIndex + ", " + sectionIndex + ")"; } String id = "toggleSessionLevelInSection" + sectionIndex + "ForInstructor" + instructorIndex; toggleSessionLevelInSectionButton = createButton(content, "small col-sm-5", id, "javascript:;", onClick); String[] privileges = {Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS}; for (String feedbackName : feedbackNames) { List<ElementTag> checkBoxList = new ArrayList<ElementTag>(); for (String privilege : privileges) { String name = privilege + Const.ParamsNames.INSTRUCTOR_SECTION_GROUP + sectionIndex + "feedback" + feedbackName; boolean isChecked = (instructor != null) && instructor.isAllowedForPrivilege(sectionName, feedbackName, privilege); checkBoxList.add(createCheckBox(null, name, "true", isChecked)); } CourseEditFeedbackSessionRow feedbackSessionRow = new CourseEditFeedbackSessionRow(feedbackName, checkBoxList); feedbackSessions.add(feedbackSessionRow); } }