nus-yam/ex-repair huggingface dataset:
Program: 25794
Project: 25794
Buggy source:
public String getStormpathApplicationHref(){
  return getProperty(STORMPATH_APPLICATION_HREF);
}

Fixed version (ground truth):
public String getStormpathApplicationHref(){
  return getProperty(ENTERPRISE_STORMPATH_APPLICATION_HREF);
}
Program: 25795
Project: 25795
Buggy source:
public String getStormpathId(){
  return getProperty(STORMPATH_ID);
}

Fixed version (ground truth):
public String getStormpathId(){
  return getProperty(ENTERPRISE_STORMPATH_ID);
}
Program: 25796
Project: 25796
Buggy source:
@Bean(name="String_Node_Str") @Autowired public Client getStormpathClient(BridgeConfig bridgeConfig){
  ApiKey apiKey=ApiKeys.builder().setId(bridgeConfig.getStormpathId().trim()).setSecret(bridgeConfig.getStormpathSecret().trim()).build();
  return Clients.builder().setApiKey(apiKey).build();
}

Fixed version (ground truth):
@Bean(name="String_Node_Str") @Autowired public Client getStormpathClient(BridgeConfig bridgeConfig){
  ApiKey apiKey=ApiKeys.builder().setId(bridgeConfig.getStormpathId().trim()).setSecret(bridgeConfig.getStormpathSecret().trim()).build();
  ClientBuilder clientBuilder=Clients.builder().setApiKey(apiKey);
  ((DefaultClientBuilder)clientBuilder).setBaseUrl("String_Node_Str");
  return clientBuilder.build();
}
Program: 25797
Project: 25797
Buggy source:
@Override public void onApplicationEvent(final ContextRefreshedEvent event){
  Map<Environment,Map<String,String>> targetMap=backMap;
  Environment env=BridgeConfigFactory.getConfig().getEnvironment();
  for (  Study study : studyService.getStudies()) {
    String studyId=study.getIdentifier();
    String targetHref=targetMap.get(env).get(studyId);
    try {
      if (targetHref != null) {
        if (!study.getStormpathHref().equals(targetHref)) {
          log("String_Node_Str",studyId,targetHref);
          study.setStormpathHref(targetHref);
          studyDao.updateStudy(study);
          cacheProvider.setStudy(study);
        }
 else {
          log("String_Node_Str",studyId,targetHref);
        }
      }
 else {
        log("String_Node_Str",studyId,"String_Node_Str");
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void onApplicationEvent(final ContextRefreshedEvent event){
  Map<Environment,Map<String,String>> targetMap=foreMap;
  Environment env=BridgeConfigFactory.getConfig().getEnvironment();
  for (  Study study : studyService.getStudies()) {
    String studyId=study.getIdentifier();
    String targetHref=targetMap.get(env).get(studyId);
    try {
      if (targetHref != null) {
        if (!study.getStormpathHref().equals(targetHref)) {
          log("String_Node_Str",studyId,targetHref);
          study.setStormpathHref(targetHref);
          studyDao.updateStudy(study);
          cacheProvider.setStudy(study);
        }
 else {
          log("String_Node_Str",studyId,targetHref);
        }
      }
 else {
        log("String_Node_Str",studyId,"String_Node_Str");
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}
Program: 25798
Project: 25798
Buggy source:
@Override public Account verifyEmail(StudyIdentifier study,EmailVerification verification){
  checkNotNull(study);
  checkNotNull(verification);
  try {
    com.stormpath.sdk.account.Account acct=client.getCurrentTenant().verifyAccountEmail(verification.getSptoken());
    return (acct == null) ? null : new StormpathAccount(study,acct,encryptors);
  }
 catch (  ResourceException e) {
    rethrowResourceException(e,null);
  }
  return null;
}

Fixed version (ground truth):
@Override public Account verifyEmail(StudyIdentifier study,EmailVerification verification){
  checkNotNull(study);
  checkNotNull(verification);
  try {
    com.stormpath.sdk.account.Account acct=client.verifyAccountEmail(verification.getSptoken());
    return (acct == null) ? null : new StormpathAccount(study,acct,encryptors);
  }
 catch (  ResourceException e) {
    rethrowResourceException(e,null);
  }
  return null;
}
Program: 25800
Project: 25800
Buggy source:
public Study getStudy(String identifier){
  try {
    String redisKey=RedisKey.STUDY.getRedisKey(identifier);
    String ser=stringOps.get(redisKey).execute();
    if (ser != null) {
      stringOps.expire(redisKey,BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS);
      return DynamoStudy.fromJson(BridgeObjectMapper.get().readTree(ser));
    }
  }
 catch (  Throwable e) {
    promptToStartRedisIfLocalEnv(e);
    throw new BridgeServiceException(e);
  }
  return null;
}

Fixed version (ground truth):
public Study getStudy(String identifier){
  try {
    String redisKey=RedisKey.STUDY.getRedisKey(identifier);
    String ser=stringOps.get(redisKey).execute();
    if (ser != null) {
      stringOps.expire(redisKey,BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS);
      return DynamoStudy.fromCacheJson(BridgeObjectMapper.get().readTree(ser));
    }
  }
 catch (  Throwable e) {
    promptToStartRedisIfLocalEnv(e);
    throw new BridgeServiceException(e);
  }
  return null;
}
Program: 25801
Project: 25801
Buggy source:
private UserSession createSessionFromAccount(Study study,Account account){
  final UserSession session=new UserSession();
  session.setAuthenticated(true);
  session.setEnvironment(config.getEnvironment().name().toLowerCase());
  session.setSessionToken(BridgeUtils.generateGuid());
  final User user=new User(account);
  user.setStudyKey(study.getIdentifier());
  HealthId healthId=accountEncryptionService.getHealthCode(study,account);
  if (healthId != null) {
    String healthCode=healthId.getCode();
    user.setHealthCode(healthCode);
    boolean consent=consentService.hasUserConsentedToResearch(user,study);
    user.setConsent(consent);
    if (healthCode != null) {
      boolean dataSharing=optionsService.getBooleanOption(healthCode,Option.DATA_SHARING);
      user.setDataSharing(dataSharing);
    }
  }
  if (user.isInRole(BridgeConstants.ADMIN_GROUP) || user.isInRole(study.getResearcherRole())) {
    user.setConsent(true);
  }
  String adminUser=BridgeConfigFactory.getConfig().getProperty("String_Node_Str");
  if (adminUser != null && adminUser.equals(account.getEmail())) {
    user.setConsent(true);
  }
  session.setUser(user);
  return session;
}

Fixed version (ground truth):
private UserSession createSessionFromAccount(Study study,Account account){
  final UserSession session=new UserSession();
  session.setAuthenticated(true);
  session.setEnvironment(config.getEnvironment().name().toLowerCase());
  session.setSessionToken(BridgeUtils.generateGuid());
  final User user=new User(account);
  user.setStudyKey(study.getIdentifier());
  final String healthCode=getHealthCode(study,account);
  user.setHealthCode(healthCode);
  user.setConsent(consentService.hasUserConsentedToResearch(user,study));
  user.setDataSharing(optionsService.getBooleanOption(healthCode,Option.DATA_SHARING));
  if (user.isInRole(BridgeConstants.ADMIN_GROUP) || user.isInRole(study.getResearcherRole())) {
    user.setConsent(true);
  }
  String adminUser=BridgeConfigFactory.getConfig().getProperty("String_Node_Str");
  if (adminUser != null && adminUser.equals(account.getEmail())) {
    user.setConsent(true);
  }
  session.setUser(user);
  return session;
}
Program: 25803
Project: 25803
Buggy source:
@Override public void validate(Errors errors){
  int percentage=0;
  for (  ScheduleGroup group : groups) {
    percentage+=group.getPercentage();
  }
  if (percentage != 100) {
    errors.reject(String.format("String_Node_Str",percentage));
  }
  for (  ScheduleGroup group : groups) {
    if (group.getSchedule() == null) {
      errors.reject("String_Node_Str");
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void validate(Errors errors){
  int percentage=0;
  for (  ScheduleGroup group : groups) {
    percentage+=group.getPercentage();
  }
  if (percentage != 100) {
    errors.reject(String.format("String_Node_Str",percentage));
  }
  for (int i=0; i < groups.size(); i++) {
    ScheduleGroup group=groups.get(i);
    errors.pushNestedPath("String_Node_Str" + i + "String_Node_Str");
    if (group.getSchedule() == null) {
      errors.reject("String_Node_Str");
      errors.popNestedPath();
      return;
    }
 else {
      errors.pushNestedPath("String_Node_Str");
      new ScheduleValidator().validate(group.getSchedule(),errors);
      errors.popNestedPath();
    }
    errors.popNestedPath();
  }
  for (  ScheduleGroup group : groups) {
    if (group.getSchedule() == null) {
      errors.reject("String_Node_Str");
      return;
    }
 else {
      errors.pushNestedPath("String_Node_Str");
      new ScheduleValidator().validate(group.getSchedule(),errors);
      errors.popNestedPath();
    }
  }
}
Program: 25804
Project: 25804
Buggy source:
@Override public void validate(Errors errors){
  if (schedule == null) {
    errors.reject("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void validate(Errors errors){
  if (schedule == null) {
    errors.reject("String_Node_Str");
  }
 else {
    errors.pushNestedPath("String_Node_Str");
    new ScheduleValidator().validate(schedule,errors);
    errors.popNestedPath();
  }
}
Program: 25805
Project: 25805
Buggy source:
@Override public void validate(Object obj,Errors errors){
  SchedulePlan plan=(SchedulePlan)obj;
  if (StringUtils.isBlank(plan.getStudyKey())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (plan.getStrategy() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
 else {
    plan.getStrategy().validate(errors);
  }
}

Fixed version (ground truth):
@Override public void validate(Object obj,Errors errors){
  SchedulePlan plan=(SchedulePlan)obj;
  if (StringUtils.isBlank(plan.getStudyKey())) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
  if (plan.getStrategy() == null) {
    errors.rejectValue("String_Node_Str","String_Node_Str");
  }
 else {
    errors.pushNestedPath("String_Node_Str");
    plan.getStrategy().validate(errors);
    errors.popNestedPath();
  }
}
Program: 25806
Project: 25806
Buggy source:
@Override public void validate(Object object,Errors errors){
  Schedule schedule=(Schedule)object;
  if (StringUtils.isBlank(schedule.getLabel())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (StringUtils.isBlank(schedule.getActivityRef())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (StringUtils.isBlank(schedule.getSchedulePlanGuid())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (StringUtils.isBlank(schedule.getStudyUserCompoundKey())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (schedule.getActivityType() == null) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_NULL);
  }
  if (schedule.getScheduleType() == null) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_NULL);
  }
  if (schedule.getScheduleType() == ScheduleType.ONCE) {
    if (StringUtils.isNotBlank(schedule.getCronTrigger())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
  }
  if (schedule.getScheduleType() == ScheduleType.RECURRING) {
    if (StringUtils.isBlank(schedule.getCronTrigger())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void validate(Object object,Errors errors){
  Schedule schedule=(Schedule)object;
  if (StringUtils.isBlank(schedule.getLabel())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (StringUtils.isBlank(schedule.getActivityRef())) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_BLANK);
  }
  if (schedule.getActivityType() == null) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_NULL);
  }
  if (schedule.getScheduleType() == null) {
    errors.rejectValue("String_Node_Str",CANNOT_BE_NULL);
  }
  if (schedule.getScheduleType() == ScheduleType.ONCE) {
    if (StringUtils.isNotBlank(schedule.getCronTrigger())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
  }
  if (schedule.getScheduleType() == ScheduleType.RECURRING) {
    if (StringUtils.isBlank(schedule.getCronTrigger())) {
      errors.rejectValue("String_Node_Str","String_Node_Str");
    }
  }
}
Program: 25807
Project: 25807
Buggy source:
private void validateRules(Errors errors,List<SurveyQuestion> questions){
  Set<String> alreadySeenIdentifiers=Sets.newHashSet();
  for (int i=0; i < questions.size(); i++) {
    SurveyQuestion question=questions.get(i);
    Constraints c=question.getConstraints();
    if (c != null && c.getRules() != null) {
      for (      SurveyRule rule : c.getRules()) {
        if (alreadySeenIdentifiers.contains(rule.getSkipToTarget())) {
          errors.pushNestedPath("String_Node_Str" + i);
          rejectField(errors,"String_Node_Str","String_Node_Str",rule.getSkipToTarget());
          errors.popNestedPath();
        }
      }
    }
    alreadySeenIdentifiers.add(question.getIdentifier());
  }
  for (int i=0; i < questions.size(); i++) {
    SurveyQuestion question=questions.get(i);
    Constraints c=question.getConstraints();
    if (c != null && c.getRules() != null) {
      for (      SurveyRule rule : c.getRules()) {
        if (!alreadySeenIdentifiers.contains(rule.getSkipToTarget())) {
          errors.pushNestedPath("String_Node_Str" + i);
          rejectField(errors,"String_Node_Str","String_Node_Str",rule.getSkipToTarget());
          errors.popNestedPath();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void validateRules(Errors errors,List<SurveyQuestion> questions){
  Set<String> alreadySeenIdentifiers=Sets.newHashSet();
  for (int i=0; i < questions.size(); i++) {
    SurveyQuestion question=questions.get(i);
    for (    SurveyRule rule : question.getConstraints().getRules()) {
      if (alreadySeenIdentifiers.contains(rule.getSkipToTarget())) {
        errors.pushNestedPath("String_Node_Str" + i);
        rejectField(errors,"String_Node_Str","String_Node_Str",rule.getSkipToTarget());
        errors.popNestedPath();
      }
    }
    alreadySeenIdentifiers.add(question.getIdentifier());
  }
  for (int i=0; i < questions.size(); i++) {
    SurveyQuestion question=questions.get(i);
    for (    SurveyRule rule : question.getConstraints().getRules()) {
      if (!alreadySeenIdentifiers.contains(rule.getSkipToTarget())) {
        errors.pushNestedPath("String_Node_Str" + i);
        rejectField(errors,"String_Node_Str","String_Node_Str",rule.getSkipToTarget());
        errors.popNestedPath();
      }
    }
  }
}
Program: 25808
Project: 25808
Buggy source:
private void doValidateConstraints(SurveyQuestion question,Constraints con,Errors errors){
  if (con.getDataType() == null) {
    errors.reject("String_Node_Str");
    return;
  }
  UIHint hint=question.getUiHint();
  if (hint == null) {
    rejectField(errors,"String_Node_Str","String_Node_Str");
  }
 else   if (!con.getSupportedHints().contains(hint)) {
    rejectField(errors,"String_Node_Str","String_Node_Str",con.getDataType().name().toLowerCase(),hint.name().toLowerCase());
  }
 else   if (con instanceof MultiValueConstraints) {
    MultiValueConstraints mcon=(MultiValueConstraints)con;
    String hintName=hint.name().toLowerCase();
    if (hint == UIHint.COMBOBOX && (mcon.getAllowMultiple() || !mcon.getAllowOther())) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (mcon.getAllowMultiple() && hint != UIHint.CHECKBOX && hint != UIHint.LIST) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (!mcon.getAllowMultiple() && (hint == UIHint.CHECKBOX || hint == UIHint.LIST)) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
  }
 else   if (con instanceof StringConstraints) {
    StringConstraints scon=(StringConstraints)con;
    if (StringUtils.isNotBlank(scon.getPattern())) {
      try {
        Pattern.compile(scon.getPattern());
      }
 catch (      PatternSyntaxException exception) {
        rejectField(errors,"String_Node_Str","String_Node_Str",scon.getPattern());
      }
    }
  }
}

Fixed version (ground truth):
private void doValidateConstraints(SurveyQuestion question,Constraints con,Errors errors){
  if (con.getDataType() == null) {
    errors.reject("String_Node_Str");
    return;
  }
  UIHint hint=question.getUiHint();
  if (hint == null) {
    return;
  }
  if (!con.getSupportedHints().contains(hint)) {
    rejectField(errors,"String_Node_Str","String_Node_Str",con.getDataType().name().toLowerCase(),hint.name().toLowerCase());
  }
 else   if (con instanceof MultiValueConstraints) {
    MultiValueConstraints mcon=(MultiValueConstraints)con;
    String hintName=hint.name().toLowerCase();
    if (hint == UIHint.COMBOBOX && (mcon.getAllowMultiple() || !mcon.getAllowOther())) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (mcon.getAllowMultiple() && hint != UIHint.CHECKBOX && hint != UIHint.LIST) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (!mcon.getAllowMultiple() && (hint == UIHint.CHECKBOX || hint == UIHint.LIST)) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
  }
 else   if (con instanceof StringConstraints) {
    StringConstraints scon=(StringConstraints)con;
    if (StringUtils.isNotBlank(scon.getPattern())) {
      try {
        Pattern.compile(scon.getPattern());
      }
 catch (      PatternSyntaxException exception) {
        rejectField(errors,"String_Node_Str","String_Node_Str",scon.getPattern());
      }
    }
  }
}
Program: 25809
Project: 25809
Buggy source:
@Override public void validate(Object object,Errors errors){
  Survey survey=(Survey)object;
  if (StringUtils.isBlank(survey.getIdentifier())) {
    errors.reject("String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getStudyKey())) {
    errors.reject("String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getGuid())) {
    errors.reject("String_Node_Str");
  }
  for (int i=0; i < survey.getQuestions().size(); i++) {
    SurveyQuestion question=survey.getQuestions().get(i);
    errors.pushNestedPath("String_Node_Str" + i);
    doValidateQuestion(question,i,errors);
    errors.popNestedPath();
  }
  validateRules(errors,survey.getQuestions());
}

Fixed version (ground truth):
@Override public void validate(Object object,Errors errors){
  Survey survey=(Survey)object;
  if (StringUtils.isBlank(survey.getIdentifier())) {
    errors.reject("String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getStudyKey())) {
    errors.reject("String_Node_Str");
  }
  if (StringUtils.isBlank(survey.getGuid())) {
    errors.reject("String_Node_Str");
  }
  for (int i=0; i < survey.getQuestions().size(); i++) {
    SurveyQuestion question=survey.getQuestions().get(i);
    errors.pushNestedPath("String_Node_Str" + i);
    doValidateQuestion(question,i,errors);
    errors.popNestedPath();
  }
  if (!errors.hasErrors()) {
    validateRules(errors,survey.getQuestions());
  }
}
Program: 25810
Project: 25810
Buggy source:
static Map<String,TableDescription> getExistingTables(){
  Map<String,TableDescription> existingTables=new HashMap<String,TableDescription>();
  ListTablesResult listResult=DYNAMO.listTables();
  for (  String tableName : listResult.getTableNames()) {
    DescribeTableResult describeResult=DYNAMO.describeTable(new DescribeTableRequest(tableName));
    TableDescription table=describeResult.getTable();
    existingTables.put(tableName,table);
  }
  return existingTables;
}

Fixed version (ground truth):
static Map<String,TableDescription> getExistingTables(){
  Map<String,TableDescription> existingTables=new HashMap<String,TableDescription>();
  ListTablesResult listResult=DYNAMO.listTables(Integer.MAX_VALUE);
  for (  String tableName : listResult.getTableNames()) {
    DescribeTableResult describeResult=DYNAMO.describeTable(new DescribeTableRequest(tableName));
    TableDescription table=describeResult.getTable();
    existingTables.put(tableName,table);
  }
  return existingTables;
}
Program: 25811
Project: 25811
Buggy source:
static Map<String,TableDescription> getExistingTables(){
  Map<String,TableDescription> existingTables=new HashMap<String,TableDescription>();
  ListTablesResult listResult=DYNAMO.listTables(Integer.MAX_VALUE);
  for (  String tableName : listResult.getTableNames()) {
    DescribeTableResult describeResult=DYNAMO.describeTable(new DescribeTableRequest(tableName));
    TableDescription table=describeResult.getTable();
    existingTables.put(tableName,table);
  }
  return existingTables;
}

Fixed version (ground truth):
static Map<String,TableDescription> getExistingTables(){
  Map<String,TableDescription> existingTables=new HashMap<String,TableDescription>();
  String lastTableName=null;
  ListTablesResult listTablesResult=DYNAMO.listTables();
  do {
    for (    String tableName : listTablesResult.getTableNames()) {
      DescribeTableResult describeResult=DYNAMO.describeTable(new DescribeTableRequest(tableName));
      TableDescription table=describeResult.getTable();
      existingTables.put(tableName,table);
    }
    lastTableName=listTablesResult.getLastEvaluatedTableName();
    if (lastTableName != null) {
      listTablesResult=DYNAMO.listTables(lastTableName);
    }
  }
 while (lastTableName != null);
  return existingTables;
}
Program: 25812
Project: 25812
Buggy source:
public Result resetPassword() throws Exception {
  PasswordReset passwordReset=PasswordReset.fromJson(request().body().asJson());
  authenticationService.resetPassword(passwordReset);
  return okResult("String_Node_Str");
}

Fixed version (ground truth):
public Result resetPassword() throws Exception {
  PasswordReset passwordReset=PasswordReset.fromJson(requestToJSON(request()));
  authenticationService.resetPassword(passwordReset);
  return okResult("String_Node_Str");
}
Program: 25813
Project: 25813
Buggy source:
public Result requestResetPassword() throws Exception {
  Email email=Email.fromJson(request().body().asJson());
  authenticationService.requestResetPassword(email);
  return okResult("String_Node_Str");
}

Fixed version (ground truth):
public Result requestResetPassword() throws Exception {
  Email email=Email.fromJson(requestToJSON(request()));
  authenticationService.requestResetPassword(email);
  return okResult("String_Node_Str");
}
Program: 25814
Project: 25814
Buggy source:
public Result signIn() throws Exception {
  final long start=System.nanoTime();
  UserSession session=getSessionIfItExists();
  if (session != null) {
    setSessionToken(session.getSessionToken());
    return okResult(new UserSessionInfo(session));
  }
  Study study=studyService.getStudyByHostname(getHostname());
  SignIn signIn=SignIn.fromJson(request().body().asJson());
  session=authenticationService.signIn(study,signIn);
  setSessionToken(session.getSessionToken());
  Result result=okResult(new UserSessionInfo(session));
  final long end=System.nanoTime();
  logger.info("String_Node_Str" + (end - start));
  return result;
}

Fixed version (ground truth):
public Result signIn() throws Exception {
  final long start=System.nanoTime();
  UserSession session=getSessionIfItExists();
  if (session != null) {
    setSessionToken(session.getSessionToken());
    return okResult(new UserSessionInfo(session));
  }
  Study study=studyService.getStudyByHostname(getHostname());
  SignIn signIn=SignIn.fromJson(requestToJSON(request()));
  session=authenticationService.signIn(study,signIn);
  setSessionToken(session.getSessionToken());
  Result result=okResult(new UserSessionInfo(session));
  final long end=System.nanoTime();
  logger.info("String_Node_Str" + (end - start));
  return result;
}
Program: 25815
Project: 25815
Buggy source:
public Result signUp() throws Exception {
  SignUp signUp=SignUp.fromJson(request().body().asJson(),false);
  Study study=studyService.getStudyByHostname(getHostname());
  authenticationService.signUp(signUp,study,true);
  return createdResult("String_Node_Str");
}

Fixed version (ground truth):
public Result signUp() throws Exception {
  SignUp signUp=SignUp.fromJson(requestToJSON(request()),false);
  Study study=studyService.getStudyByHostname(getHostname());
  authenticationService.signUp(signUp,study,true);
  return createdResult("String_Node_Str");
}
Program: 25816
Project: 25816
Buggy source:
public Result verifyEmail() throws Exception {
  Study study=studyService.getStudyByHostname(getHostname());
  EmailVerification ev=EmailVerification.fromJson(request().body().asJson());
  UserSession session=authenticationService.verifyEmail(study,ev);
  setSessionToken(session.getSessionToken());
  return okResult(new UserSessionInfo(session));
}

Fixed version (ground truth):
public Result verifyEmail() throws Exception {
  Study study=studyService.getStudyByHostname(getHostname());
  EmailVerification ev=EmailVerification.fromJson(requestToJSON(request()));
  UserSession session=authenticationService.verifyEmail(study,ev);
  setSessionToken(session.getSessionToken());
  return okResult(new UserSessionInfo(session));
}
Program: 25817
Project: 25817
Buggy source:
public boolean setIfNotExist(String code){
  try {
    DynamoHealthCode toSave=new DynamoHealthCode(code);
    mapper.save(toSave);
    return true;
  }
 catch (  ConditionalCheckFailedException e) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean setIfNotExist(String code){
  try {
    DynamoHealthCode toSave=new DynamoHealthCode(code);
    mapper.save(toSave);
    return true;
  }
 catch (  ConditionalCheckFailedException e) {
    return false;
  }
}
Program: 25818
Project: 25818
Buggy source:
public boolean setIfNotExist(String id,String code){
  checkArgument(StringUtils.isNotBlank(id),"String_Node_Str");
  checkArgument(StringUtils.isNotBlank(code),"String_Node_Str");
  try {
    DynamoHealthId toSave=new DynamoHealthId();
    toSave.setId(id);
    toSave.setCode(code);
    mapper.save(toSave);
    return true;
  }
 catch (  ConditionalCheckFailedException e) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean setIfNotExist(String id,String code){
  checkArgument(StringUtils.isNotBlank(id),"String_Node_Str");
  checkArgument(StringUtils.isNotBlank(code),"String_Node_Str");
  try {
    DynamoHealthId toSave=new DynamoHealthId();
    toSave.setId(id);
    toSave.setCode(code);
    mapper.save(toSave);
    return true;
  }
 catch (  ConditionalCheckFailedException e) {
    return false;
  }
}
Program: 25819
Project: 25819
Buggy source:
public String getCode(String id){
  checkArgument(StringUtils.isNotBlank(id),"String_Node_Str");
  DynamoHealthId healthId=mapper.load(DynamoHealthId.class,id);
  if (healthId != null) {
    return healthId.getCode();
  }
  return null;
}

Fixed version (ground truth):
@Override public String getCode(String id){
  checkArgument(StringUtils.isNotBlank(id),"String_Node_Str");
  DynamoHealthId healthId=mapper.load(DynamoHealthId.class,id);
  if (healthId != null) {
    return healthId.getCode();
  }
  return null;
}
Program: 25820
Project: 25820
Buggy source:
private void deleteUserInStudy(User user,Study study) throws BridgeServiceException {
  checkNotNull(user,"String_Node_Str");
  checkNotNull(study,"String_Node_Str");
  final String lock=study.getKey() + "String_Node_Str" + user.getId();
  String uuid=null;
  try {
    uuid=lockDao.createLock(User.class,lock);
    Directory directory=getDirectory(study);
    Account account=getUserAccountByEmail(directory,user.getEmail());
    if (account != null) {
      revokeAllConsentRecords(user,study);
      removeAllHealthDataRecords(user,study);
      deleteUserAccount(study,user.getEmail());
    }
  }
  finally {
    if (uuid != null) {
      lockDao.releaseLock(User.class,lock,uuid);
    }
  }
}

Fixed version (ground truth):
private void deleteUserInStudy(User user,Study study) throws BridgeServiceException {
  checkNotNull(user,"String_Node_Str");
  checkNotNull(study,"String_Node_Str");
  final String lock=study.getKey() + "String_Node_Str" + user.getId();
  String uuid=null;
  try {
    uuid=lockDao.createLock(User.class,lock);
    Directory directory=getDirectory(study);
    Account account=getUserAccountByEmail(directory,user.getEmail());
    if (account != null) {
      revokeAllConsentRecords(user,study);
      removeAllHealthDataRecords(user,study);
      removeHealthCodeAndIdMappings(user);
      deleteUserAccount(study,user.getEmail());
    }
  }
  finally {
    if (uuid != null) {
      lockDao.releaseLock(User.class,lock,uuid);
    }
  }
}
Program: 25821
Project: 25821
Buggy source:
private void validate(List<SurveyAnswer> answers,Survey survey){
  Map<String,SurveyQuestion> questions=getQuestionsMap(survey);
  for (int i=0; i < answers.size(); i++) {
    SurveyAnswer answer=answers.get(i);
    SurveyAnswerValidator validator=new SurveyAnswerValidator(questions.get(answer.getQuestionGuid()));
    Validate.entityThrowingException(validator,answer);
  }
}

Fixed version (ground truth):
private void validate(List<SurveyAnswer> answers,Survey survey){
  Map<String,SurveyQuestion> questions=getQuestionsMap(survey);
  MapBindingResult errors=new MapBindingResult(Maps.newHashMap(),"String_Node_Str");
  for (int i=0; i < answers.size(); i++) {
    SurveyAnswer answer=answers.get(i);
    SurveyQuestion question=questions.get(answer.getQuestionGuid());
    SurveyAnswerValidator validator=new SurveyAnswerValidator(question);
    Validate.entity(validator,errors,answer);
  }
  Validate.throwException(errors,survey);
}
Program: 25823
Project: 25823
Buggy source:
private void doValidateConstraints(SurveyQuestion question,Constraints con,Errors errors){
  if (con.getDataType() == null) {
    errors.reject("String_Node_Str");
    return;
  }
  UIHint hint=question.getUiHint();
  if (!con.getSupportedHints().contains(hint)) {
    rejectField(errors,"String_Node_Str","String_Node_Str",con.getDataType().name().toLowerCase(),hint.name().toLowerCase());
  }
 else   if (con instanceof MultiValueConstraints) {
    MultiValueConstraints mcon=(MultiValueConstraints)con;
    String hintName=hint.name().toLowerCase();
    if (hint == UIHint.COMBOBOX && (mcon.getAllowMultiple() || !mcon.getAllowOther())) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (mcon.getAllowMultiple() && hint != UIHint.CHECKBOX && hint != UIHint.LIST) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (!mcon.getAllowMultiple() && (hint == UIHint.CHECKBOX || hint == UIHint.LIST)) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
  }
 else   if (con instanceof StringConstraints) {
    StringConstraints scon=(StringConstraints)con;
    if (StringUtils.isNotBlank(scon.getPattern())) {
      try {
        Pattern.compile(scon.getPattern());
      }
 catch (      PatternSyntaxException exception) {
        rejectField(errors,"String_Node_Str","String_Node_Str",scon.getPattern());
      }
    }
  }
}

Fixed version (ground truth):
private void doValidateConstraints(SurveyQuestion question,Constraints con,Errors errors){
  if (con.getDataType() == null) {
    errors.reject("String_Node_Str");
    return;
  }
  UIHint hint=question.getUiHint();
  if (hint == null) {
    rejectField(errors,"String_Node_Str","String_Node_Str");
  }
 else   if (!con.getSupportedHints().contains(hint)) {
    rejectField(errors,"String_Node_Str","String_Node_Str",con.getDataType().name().toLowerCase(),hint.name().toLowerCase());
  }
 else   if (con instanceof MultiValueConstraints) {
    MultiValueConstraints mcon=(MultiValueConstraints)con;
    String hintName=hint.name().toLowerCase();
    if (hint == UIHint.COMBOBOX && (mcon.getAllowMultiple() || !mcon.getAllowOther())) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (mcon.getAllowMultiple() && hint != UIHint.CHECKBOX && hint != UIHint.LIST) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
 else     if (!mcon.getAllowMultiple() && (hint == UIHint.CHECKBOX || hint == UIHint.LIST)) {
      rejectField(errors,"String_Node_Str","String_Node_Str",hintName);
    }
  }
 else   if (con instanceof StringConstraints) {
    StringConstraints scon=(StringConstraints)con;
    if (StringUtils.isNotBlank(scon.getPattern())) {
      try {
        Pattern.compile(scon.getPattern());
      }
 catch (      PatternSyntaxException exception) {
        rejectField(errors,"String_Node_Str","String_Node_Str",scon.getPattern());
      }
    }
  }
}
Program: 25824
Project: 25824
Buggy source:
public BeanSerializerBase withFilterId(Object object){
  return this;
}

Fixed version (ground truth):
public BeanSerializerBase withFilterId(Object object){
  return null;
}
Program: 25825
Project: 25825
Buggy source:
public Result createSurveyResponse(String surveyGuid,Long surveyVersion) throws Exception {
  UserSession session=getAuthenticatedAndConsentedSession();
  List<SurveyAnswer> answers=deserializeSurveyAnswers();
  SurveyResponse response=responseDao.createSurveyResponse(surveyGuid,surveyVersion,session.getUser().getHealthDataCode(),answers);
  return createdResult(new GuidHolder(response.getGuid()));
}

Fixed version (ground truth):
public Result createSurveyResponse(String surveyGuid,String surveyVersionString) throws Exception {
  UserSession session=getAuthenticatedAndConsentedSession();
  List<SurveyAnswer> answers=deserializeSurveyAnswers();
  Long surveyVersion=DateUtils.convertToMillisFromEpoch(surveyVersionString);
  SurveyResponse response=responseDao.createSurveyResponse(surveyGuid,surveyVersion,session.getUser().getHealthDataCode(),answers);
  return createdResult(new GuidHolder(response.getGuid()));
}
Program: 25826
Project: 25826
Buggy source:
public void validate(Messages messages,SurveyAnswer answer){
  long time=(Long)answer.getAnswer();
  if (!allowFuture && time > (DateUtils.getCurrentMillisFromEpoch() + FIVE_MINUTES)) {
    messages.add("String_Node_Str");
  }
}

Fixed version (ground truth):
public void validate(Messages messages,SurveyAnswer answer){
  long time=(Long)answer.getAnswer();
  long now=(DateUtils.getCurrentMillisFromEpoch() + FIVE_MINUTES);
  if (!allowFuture && time > now) {
    messages.add("String_Node_Str",time,now);
  }
}
Program: 25827
Project: 25827
Buggy source:
private Body createSignedDocument(ConsentSignature consent,Study study) throws UnsupportedEncodingException, IOException {
  InputStreamReader isr=new InputStreamReader(study.getConsentAgreement().getInputStream(),"String_Node_Str");
  String consentAgreementHTML=CharStreams.toString(isr);
  String signingDate=fmt.print(DateUtils.getCurrentMillisFromEpoch());
  String birthdate=fmt.print(DateUtils.convertToMillisFromEpoch(consent.getBirthdate()));
  String html=consentAgreementHTML.replace("String_Node_Str",consent.getName());
  html=html.replace("String_Node_Str",birthdate);
  html=html.replace("String_Node_Str",signingDate);
  Content textBody=new Content().withData(html);
  return new Body().withHtml(textBody);
}

Fixed version (ground truth):
private Body createSignedDocument(ConsentSignature consent,Study study) throws UnsupportedEncodingException, IOException {
  InputStreamReader isr=new InputStreamReader(study.getConsentAgreement().getInputStream(),"String_Node_Str");
  String consentAgreementHTML=CharStreams.toString(isr);
  String signingDate=fmt.print(DateUtils.getCurrentMillisFromEpoch());
  LocalDate localDate=LocalDate.parse(consent.getBirthdate());
  String birthdate=fmt.print(localDate);
  String html=consentAgreementHTML.replace("String_Node_Str",consent.getName());
  html=html.replace("String_Node_Str",birthdate);
  html=html.replace("String_Node_Str",signingDate);
  Content textBody=new Content().withData(html);
  return new Body().withHtml(textBody);
}
Program: 25829
Project: 25829
Buggy source:
public void setDynamoDbClient(AmazonDynamoDB client){
  DynamoDBMapperConfig mapperConfig=new DynamoDBMapperConfig(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES,ConsistentReads.CONSISTENT,TableNameOverrideFactory.getTableNameOverride(DynamoUserConsent.class));
  mapper=new DynamoDBMapper(client,mapperConfig);
}

Fixed version (ground truth):
public void setDynamoDbClient(AmazonDynamoDB client){
  DynamoDBMapperConfig mapperConfig=new DynamoDBMapperConfig(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES,ConsistentReads.CONSISTENT,TableNameOverrideFactory.getTableNameOverride(DynamoUserConsent.class));
  mapperOld=new DynamoDBMapper(client,mapperConfig);
  mapperConfig=new DynamoDBMapperConfig(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES,ConsistentReads.CONSISTENT,TableNameOverrideFactory.getTableNameOverride(DynamoUserConsent1.class));
  mapper=new DynamoDBMapper(client,mapperConfig);
}
Program: 25830
Project: 25830
Buggy source:
private ResearchConsent getConsentSignatureOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
  consent=mapper.load(consent);
  return new ResearchConsent(consent.getName(),consent.getBirthdate());
}

Fixed version (ground truth):
private ResearchConsent getConsentSignatureOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
  consent=mapperOld.load(consent);
  return new ResearchConsent(consent.getName(),consent.getBirthdate());
}
Program: 25831
Project: 25831
Buggy source:
private void withdrawConsentOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consentToDelete=new DynamoUserConsent(healthCode,studyConsent);
  consentToDelete.setWithdraw(NOT_WITHDRAW_YET);
  consentToDelete=mapper.load(consentToDelete);
  mapper.delete(consentToDelete);
  DynamoUserConsent consentToWithdraw=new DynamoUserConsent(consentToDelete);
  consentToWithdraw.setWithdraw(DateTime.now(DateTimeZone.UTC).getMillis());
  consentToWithdraw.setVersion(null);
  mapper.save(consentToWithdraw);
}

Fixed version (ground truth):
private void withdrawConsentOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consentToDelete=new DynamoUserConsent(healthCode,studyConsent);
  consentToDelete.setWithdraw(NOT_WITHDRAW_YET);
  consentToDelete=mapperOld.load(consentToDelete);
  mapperOld.delete(consentToDelete);
  DynamoUserConsent consentToWithdraw=new DynamoUserConsent(consentToDelete);
  consentToWithdraw.setWithdraw(DateTime.now(DateTimeZone.UTC).getMillis());
  consentToWithdraw.setVersion(null);
  mapperOld.save(consentToWithdraw);
}
Program: 25832
Project: 25832
Buggy source:
private void giveConsentOld(String healthCode,StudyConsent studyConsent,ResearchConsent researchConsent){
  try {
    DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
    consent.setName(researchConsent.getName());
    consent.setBirthdate(researchConsent.getBirthdate());
    consent.setGive(DateTime.now(DateTimeZone.UTC).getMillis());
    consent.setWithdraw(NOT_WITHDRAW_YET);
    mapper.save(consent);
  }
 catch (  ConditionalCheckFailedException e) {
    throw new ConsentAlreadyExistsException();
  }
}

Fixed version (ground truth):
private void giveConsentOld(String healthCode,StudyConsent studyConsent,ResearchConsent researchConsent){
  try {
    DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
    consent.setName(researchConsent.getName());
    consent.setBirthdate(researchConsent.getBirthdate());
    consent.setGive(DateTime.now(DateTimeZone.UTC).getMillis());
    consent.setWithdraw(NOT_WITHDRAW_YET);
    mapperOld.save(consent);
  }
 catch (  ConditionalCheckFailedException e) {
    throw new ConsentAlreadyExistsException();
  }
}
Program: 25833
Project: 25833
Buggy source:
private boolean hasConsentedOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
  consent.setWithdraw(NOT_WITHDRAW_YET);
  return mapper.load(consent) != null;
}

Fixed version (ground truth):
private boolean hasConsentedOld(String healthCode,StudyConsent studyConsent){
  DynamoUserConsent consent=new DynamoUserConsent(healthCode,studyConsent);
  consent.setWithdraw(NOT_WITHDRAW_YET);
  return mapperOld.load(consent) != null;
}
Program: 25834
Project: 25834
Buggy source:
@Before public void before(){
  DynamoTestUtil.clearTable(DynamoUserConsent.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  DynamoTestUtil.clearTable(DynamoUserConsent1.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Before public void before(){
  DynamoInitializer.init("String_Node_Str");
  DynamoTestUtil.clearTable(DynamoUserConsent.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  DynamoTestUtil.clearTable(DynamoUserConsent1.class,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 25835
Project: 25835
Buggy source:
public void setDynamoDbClient(AmazonDynamoDB client){
  DynamoDBMapperConfig mapperConfig=new DynamoDBMapperConfig(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES,ConsistentReads.CONSISTENT,TableNameOverrideFactory.getTableNameOverride(DynamoStudyConsent.class));
  mapper=new DynamoDBMapper(client,mapperConfig);
}

Fixed version (ground truth):
public void setDynamoDbClient(AmazonDynamoDB client){
  DynamoDBMapperConfig mapperConfig=new DynamoDBMapperConfig(SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES,ConsistentReads.CONSISTENT,TableNameOverrideFactory.getTableNameOverride(DynamoUserConsent.class));
  mapper=new DynamoDBMapper(client,mapperConfig);
}
Program: 25836
Project: 25836
Buggy source:
public Result signUp() throws Exception {
  UserSession session=getSession();
  return jsonResult(Boolean.toString(session.isConsent()));
}

Fixed version (ground truth):
public Result signUp() throws Exception {
  UserSession session=getSession();
  return ok(Boolean.toString(session.isConsent()));
}
Program: 25837
Project: 25837
Buggy source:
public Result send() throws Exception {
  UserSession session=getSession();
  return jsonResult(Boolean.toString(session.isConsent()));
}

Fixed version (ground truth):
public Result send() throws Exception {
  UserSession session=getSession();
  return ok(Boolean.toString(session.isConsent()));
}
Program: 25838
Project: 25838
Buggy source:
public Result withdraw() throws Exception {
  UserSession session=getSession();
  return jsonResult(Boolean.toString(session.isConsent()));
}

Fixed version (ground truth):
public Result withdraw() throws Exception {
  UserSession session=getSession();
  return ok(Boolean.toString(session.isConsent()));
}
Program: 25840
Project: 25840
Buggy source:
public DynamoRecord(String key,HealthDataEntry entry){
  this.key=key;
  this.recordId=entry.getRecordId();
  this.startDate=entry.getStartDate();
  this.endDate=entry.getEndDate();
  this.data=entry.getData();
}

Fixed version (ground truth):
public DynamoRecord(String key,String recordId,HealthDataEntry entry){
  this.key=key;
  this.recordId=recordId;
  this.startDate=entry.getStartDate();
  this.endDate=entry.getEndDate();
  this.data=entry.getData();
}
Program: 25841
Project: 25841
Buggy source:
@Override public void deleteHealthDataEntry(HealthDataKey key,String recordId) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (recordId == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    HealthDataEntry entry=getHealthDataEntry(key,recordId);
    if (entry == null) {
      throw new BridgeServiceException("String_Node_Str" + key.toString() + "String_Node_Str"+ recordId);
    }
    DynamoDBMapper mapper=getUpdateMapper();
    mapper.delete(entry);
  }
 catch (  Exception e) {
    throw new BridgeServiceException(e);
  }
}

Fixed version (ground truth):
@Override public void deleteHealthDataEntry(HealthDataKey key,String recordId) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (recordId == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    HealthDataEntry entry=getHealthDataEntry(key,recordId);
    if (entry == null) {
      throw new BridgeServiceException("String_Node_Str" + key.toString() + "String_Node_Str"+ recordId);
    }
    DynamoDBMapper mapper=getUpdateMapper();
    String anonKey=healthDataKeyToAnonimizedKeyString(key);
    DynamoRecord record=new DynamoRecord(anonKey,recordId,entry);
    mapper.delete(record);
  }
 catch (  Exception e) {
    throw new BridgeServiceException(e);
  }
}
Program: 25842
Project: 25842
Buggy source:
@Override public void updateHealthDataEntry(HealthDataKey key,HealthDataEntry entry) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry.getStartDate() == 0L) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry.getRecordId() == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    DynamoDBMapper mapper=getUpdateMapper();
    String recordId=healthDataKeyToAnonimizedKeyString(key);
    DynamoRecord record=new DynamoRecord(recordId,entry);
    mapper.save(record);
  }
 catch (  BridgeServiceException e) {
    throw new BridgeServiceException(e);
  }
}

Fixed version (ground truth):
@Override public void updateHealthDataEntry(HealthDataKey key,HealthDataEntry entry) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry.getStartDate() == 0L) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (entry.getRecordId() == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    DynamoDBMapper mapper=getUpdateMapper();
    String anonKey=healthDataKeyToAnonimizedKeyString(key);
    DynamoRecord record=new DynamoRecord(anonKey,entry);
    mapper.save(record);
  }
 catch (  Exception e) {
    throw new BridgeServiceException(e);
  }
}
Program: 25844
Project: 25844
Buggy source:
private String healthDataKeyToAnonimizedKeyString(HealthDataKey key){
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getStudyId() == 0) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getTrackerId() == 0) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getSessionToken() == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  return String.format("String_Node_Str",key.getStudyId(),key.getTrackerId(),"String_Node_Str");
}

Fixed version (ground truth):
private String healthDataKeyToAnonimizedKeyString(HealthDataKey key) throws BridgeServiceException, SynapseException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getStudyId() == 0) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getTrackerId() == 0) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (key.getSessionToken() == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  UserSessionData data=getSynapseClient(key.getSessionToken()).getUserSessionData();
  String ownerId=data.getProfile().getOwnerId();
  if (StringUtils.isBlank(ownerId)) {
    throw new BridgeServiceException("String_Node_Str");
  }
  String encryptedValue=encryptor.encrypt(ownerId);
  return String.format("String_Node_Str",key.getStudyId(),key.getTrackerId(),encryptedValue);
}