Program: 25673
Project: 25673
Buggy source:
public Study updateStudy(Study study,boolean isAdminUpdate){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  Study originalStudy=studyDao.getStudy(study.getIdentifier());
  checkViolationConstraints(originalStudy,study);
  if (!isAdminUpdate) {
    if (!originalStudy.isActive()) {
      throw new EntityNotFoundException(Study.class,"String_Node_Str" + study.getIdentifier() + "String_Node_Str");
    }
    study.setHealthCodeExportEnabled(originalStudy.isHealthCodeExportEnabled());
    study.setEmailVerificationEnabled(originalStudy.isEmailVerificationEnabled());
    study.setExternalIdValidationEnabled(originalStudy.isExternalIdValidationEnabled());
    study.setExternalIdRequiredOnSignup(originalStudy.isExternalIdRequiredOnSignup());
    study.setEmailSignInEnabled(originalStudy.isEmailSignInEnabled());
    study.setPhoneSignInEnabled(originalStudy.isPhoneSignInEnabled());
    study.setReauthenticationEnabled(originalStudy.isReauthenticationEnabled());
    study.setAccountLimit(originalStudy.getAccountLimit());
    study.setStudyIdExcludedInExport(originalStudy.isStudyIdExcludedInExport());
  }
  if (originalStudy.isActive() && !study.isActive()) {
    throw new BadRequestException("String_Node_Str");
  }
  setDefaultsIfAbsent(study);
  sanitizeHTML(study);
  Validate.entityThrowingException(validator,study);
  if (originalStudy.isConsentNotificationEmailVerified() == null) {
    study.setConsentNotificationEmailVerified(true);
  }
 else   if (!originalStudy.isConsentNotificationEmailVerified()) {
    study.setConsentNotificationEmailVerified(false);
  }
  boolean consentHasChanged=!Objects.equals(originalStudy.getConsentNotificationEmail(),study.getConsentNotificationEmail());
  if (consentHasChanged) {
    study.setConsentNotificationEmailVerified(false);
  }
  if (!isAdminUpdate) {
    checkUploadMetadataConstraints(originalStudy,study);
  }
  Study updatedStudy=updateAndCacheStudy(study);
  if (!originalStudy.getSupportEmail().equals(study.getSupportEmail())) {
    emailVerificationService.verifyEmailAddress(study.getSupportEmail());
  }
  if (consentHasChanged && study.getConsentNotificationEmail() != null) {
    sendVerifyEmail(study,StudyEmailType.CONSENT_NOTIFICATION);
  }
  return updatedStudy;
}

Fixed version (ground truth):
public Study updateStudy(Study study,boolean isAdminUpdate){
  checkNotNull(study,Validate.CANNOT_BE_NULL,"String_Node_Str");
  Study originalStudy=studyDao.getStudy(study.getIdentifier());
  checkViolationConstraints(originalStudy,study);
  if (!isAdminUpdate) {
    if (!originalStudy.isActive()) {
      throw new EntityNotFoundException(Study.class,"String_Node_Str" + study.getIdentifier() + "String_Node_Str");
    }
    study.setHealthCodeExportEnabled(originalStudy.isHealthCodeExportEnabled());
    study.setEmailVerificationEnabled(originalStudy.isEmailVerificationEnabled());
    study.setExternalIdValidationEnabled(originalStudy.isExternalIdValidationEnabled());
    study.setExternalIdRequiredOnSignup(originalStudy.isExternalIdRequiredOnSignup());
    study.setEmailSignInEnabled(originalStudy.isEmailSignInEnabled());
    study.setPhoneSignInEnabled(originalStudy.isPhoneSignInEnabled());
    study.setReauthenticationEnabled(originalStudy.isReauthenticationEnabled());
    study.setAccountLimit(originalStudy.getAccountLimit());
    study.setStudyIdExcludedInExport(originalStudy.isStudyIdExcludedInExport());
  }
  if (originalStudy.isActive() && !study.isActive()) {
    throw new BadRequestException("String_Node_Str");
  }
  setDefaultsIfAbsent(study);
  sanitizeHTML(study);
  Validate.entityThrowingException(validator,study);
  if (originalStudy.isConsentNotificationEmailVerified() == null) {
    study.setConsentNotificationEmailVerified(true);
  }
 else   if (!originalStudy.isConsentNotificationEmailVerified()) {
    study.setConsentNotificationEmailVerified(false);
  }
  boolean consentHasChanged=!Objects.equals(originalStudy.getConsentNotificationEmail(),study.getConsentNotificationEmail());
  if (consentHasChanged) {
    study.setConsentNotificationEmailVerified(false);
  }
  if (!isAdminUpdate) {
    checkUploadMetadataConstraints(originalStudy,study);
  }
  Study updatedStudy=updateAndCacheStudy(study);
  if (!originalStudy.getSupportEmail().equals(study.getSupportEmail())) {
    emailVerificationService.verifyEmailAddress(study.getSupportEmail());
  }
  if (consentHasChanged && StringUtils.isNotBlank(study.getConsentNotificationEmail())) {
    sendVerifyEmail(study,StudyEmailType.CONSENT_NOTIFICATION);
  }
  return updatedStudy;
}