Program: 115355
Project: 115355
Buggy source:
public void setFlags(EventCRFBean eventCRF,UserAccountBean user,StudyUserRoleBean surb,boolean doubleDataEntryPermitted){
  this.eventCRF=eventCRF;
  stage=eventCRF.getStage();
  Role r=surb.getRole();
  boolean isSuper=isSuper(user,r);
  boolean isEditor=isEditor(user,r);
  if (!isSuper && !r.equals(Role.INVESTIGATOR) && !r.equals(Role.RESEARCHASSISTANT)) {
    return;
  }
  if (stage.equals(DataEntryStage.LOCKED)) {
    locked=true;
    return;
  }
  if (stage.equals(DataEntryStage.UNCOMPLETED)) {
    startInitialDataEntryPermitted=true;
  }
 else   if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY)) {
    if (eventCRF.getOwner().equals(user) || isSuper) {
      continueInitialDataEntryPermitted=true;
    }
  }
 else   if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE)) {
    if (doubleDataEntryPermitted) {
      logger.info("String_Node_Str");
      if (eventCRF.getOwner().equals(user)) {
        logger.info("String_Node_Str");
        if (initialDataEntryCompletedMoreThanTwelveHoursAgo(eventCRF) || isSuper) {
          logger.info("String_Node_Str" + isSuper);
          startDoubleDataEntryPermitted=true;
        }
 else {
          startDoubleDataEntryPermitted=false;
          twelveHourWaitRequired=true;
        }
      }
 else {
        logger.info("String_Node_Str");
        startDoubleDataEntryPermitted=true;
      }
    }
 else {
      if (isEditor) {
        performAdministrativeEditingPermitted=true;
      }
    }
  }
 else   if (stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY) && doubleDataEntryPermitted) {
    if (eventCRF.getValidatorId() == user.getId() || isSuper) {
      continueDoubleDataEntryPermitted=true;
    }
  }
 else   if (stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE)) {
    if (isEditor) {
      performAdministrativeEditingPermitted=true;
    }
  }
 else   if (stage.equals(DataEntryStage.INVALID)) {
  }
}

Fixed version (ground truth):
public void setFlags(EventCRFBean eventCRF,UserAccountBean user,StudyUserRoleBean surb,boolean doubleDataEntryPermitted){
  this.eventCRF=eventCRF;
  stage=eventCRF.getStage();
  Role r=surb.getRole();
  boolean isSuper=isSuper(user,r);
  boolean isEditor=isEditor(user,r);
  if (!isSuper && !r.equals(Role.INVESTIGATOR) && !r.equals(Role.RESEARCHASSISTANT)) {
    return;
  }
  if (stage.equals(DataEntryStage.LOCKED)) {
    locked=true;
    return;
  }
  if (stage.equals(DataEntryStage.UNCOMPLETED)) {
    startInitialDataEntryPermitted=true;
  }
 else   if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY)) {
    continueInitialDataEntryPermitted=true;
  }
 else   if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE)) {
    if (doubleDataEntryPermitted) {
      logger.info("String_Node_Str");
      if (eventCRF.getOwner().equals(user)) {
        logger.info("String_Node_Str");
        if (initialDataEntryCompletedMoreThanTwelveHoursAgo(eventCRF) || isSuper) {
          logger.info("String_Node_Str" + isSuper);
          startDoubleDataEntryPermitted=true;
        }
 else {
          startDoubleDataEntryPermitted=false;
          twelveHourWaitRequired=true;
        }
      }
 else {
        logger.info("String_Node_Str");
        startDoubleDataEntryPermitted=true;
      }
    }
 else {
      if (isEditor) {
        performAdministrativeEditingPermitted=true;
      }
    }
  }
 else   if (stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY) && doubleDataEntryPermitted) {
    if (eventCRF.getValidatorId() == user.getId() || isSuper) {
      continueDoubleDataEntryPermitted=true;
    }
  }
 else   if (stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE)) {
    if (isEditor) {
      performAdministrativeEditingPermitted=true;
    }
  }
 else   if (stage.equals(DataEntryStage.INVALID)) {
  }
}