Source:
<code>public InstructorAttributes joinCourseForInstructor(String encryptedKey, String googleId, String institute, String mac) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { if (institute != null && !StringHelper.isCorrectSignature(institute, mac)) { <START> throw new InvalidParametersException("Institute authentication failed."); <END> } InstructorAttributes instructor = validateInstructorJoinRequest(encryptedKey, googleId); instructor.googleId = googleId; try { instructorsLogic.updateInstructorByEmail( InstructorAttributes.updateOptionsWithEmailBuilder(instructor.courseId, instructor.email) .withGoogleId(instructor.googleId) .build()); } catch (EntityDoesNotExistException e) { Assumption.fail("Instructor disappeared while trying to register " + TeammatesException.toStringWithStackTrace(e)); } AccountAttributes account = accountsDb.getAccount(googleId); String instituteToSave = institute == null ? getCourseInstitute(instructor.courseId) : institute; if (account == null) { try { createAccount(AccountAttributes.builder(googleId) .withName(instructor.name) .withEmail(instructor.email) .withInstitute(instituteToSave) .withIsInstructor(true) .build()); } catch (EntityAlreadyExistsException e) { Assumption.fail("Account already exists."); } } else { makeAccountInstructor(googleId); } StudentAttributes student = studentsLogic.getStudentForEmail(instructor.courseId, instructor.email); if (student != null) { student.googleId = googleId; studentsLogic.updateStudentCascade( StudentAttributes.updateOptionsBuilder(student.course, student.email) .withGoogleId(student.googleId) .build()); } return instructor; }</code><technical_language>wrong - throw Invalid Parameter Exception hash match</technical_language>

Target:
public InstructorAttributes joinCourseForInstructor(String encryptedKey, String googleId, String institute, String mac) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { InstructorAttributes instructor = validateInstructorJoinRequest(encryptedKey, googleId, institute, mac); instructor.googleId = googleId; try { instructorsLogic.updateInstructorByEmail( InstructorAttributes.updateOptionsWithEmailBuilder(instructor.courseId, instructor.email) .withGoogleId(instructor.googleId) .build()); } catch (EntityDoesNotExistException e) { Assumption.fail("Instructor disappeared while trying to register " + TeammatesException.toStringWithStackTrace(e)); } AccountAttributes account = accountsDb.getAccount(googleId); String instituteToSave = institute == null ? getCourseInstitute(instructor.courseId) : institute; if (account == null) { try { createAccount(AccountAttributes.builder(googleId) .withName(instructor.name) .withEmail(instructor.email) .withInstitute(instituteToSave) .withIsInstructor(true) .build()); } catch (EntityAlreadyExistsException e) { Assumption.fail("Account already exists."); } } else { makeAccountInstructor(googleId); } StudentAttributes student = studentsLogic.getStudentForEmail(instructor.courseId, instructor.email); if (student != null) { student.googleId = googleId; studentsLogic.updateStudentCascade( StudentAttributes.updateOptionsBuilder(student.course, student.email) .withGoogleId(student.googleId) .build()); } return instructor; }