Program: 135719
Project: 135719
Buggy source:
private static Claim dbAuthenticate(PasswordCredentials creds,String domainName){
  Domain domain=null;
  User user=null;
  debug("String_Node_Str");
  try {
    Domains domains=domainStore.getDomains(domainName);
    List<Domain> domainList=domains.getDomains();
    if (domainList.size() == 0) {
      throw new AuthenticationException("String_Node_Str" + domainName + "String_Node_Str");
    }
    domain=domainList.get(0);
  }
 catch (  StoreException se) {
    throw new AuthenticationException("String_Node_Str" + se.toString() + se);
  }
  try {
    debug("String_Node_Str");
    Users users=userStore.getUsers(creds.username());
    List<User> userList=users.getUsers();
    if (userList.size() == 0) {
      throw new AuthenticationException("String_Node_Str" + creds.username() + "String_Node_Str");
    }
    user=userList.get(0);
    if (!creds.password().equalsIgnoreCase(user.getPassword())) {
      throw new AuthenticationException("String_Node_Str");
    }
    debug("String_Node_Str");
    List<String> roles=new ArrayList<String>();
    Grants grants=grantStore.getGrants(domain.getDomainid(),user.getUserid());
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Role role=roleStore.getRole(grant.getRoleid());
      roles.add(role.getName());
    }
    debug("String_Node_Str");
    ClaimBuilder claim=new ClaimBuilder();
    claim.setUserId(user.getUserid().toString());
    claim.setUser(creds.username());
    claim.setDomain(domainName);
    for (int z=0; z < roles.size(); z++) {
      claim.addRole(roles.get(z));
    }
    return claim.build();
  }
 catch (  StoreException se) {
    throw new AuthenticationException("String_Node_Str" + se.toString() + se);
  }
}

Fixed version (ground truth):
private static Claim dbAuthenticate(PasswordCredentials creds,String domainName){
  Domain domain=null;
  User user=null;
  debug("String_Node_Str");
  try {
    Domains domains=domainStore.getDomains(domainName);
    List<Domain> domainList=domains.getDomains();
    if (domainList.size() == 0) {
      throw new AuthenticationException("String_Node_Str" + domainName + "String_Node_Str");
    }
    domain=domainList.get(0);
  }
 catch (  StoreException se) {
    throw new AuthenticationException("String_Node_Str" + se.toString() + se);
  }
  try {
    debug("String_Node_Str");
    Users users=userStore.getUsers(creds.username());
    List<User> userList=users.getUsers();
    if (userList.size() == 0) {
      throw new AuthenticationException("String_Node_Str" + creds.username() + "String_Node_Str");
    }
    user=userList.get(0);
    if (!SHA256Calculator.getSHA256(creds.password(),user.getSalt()).equals(user.getPassword())) {
      throw new AuthenticationException("String_Node_Str");
    }
    debug("String_Node_Str");
    List<String> roles=new ArrayList<String>();
    Grants grants=grantStore.getGrants(domain.getDomainid(),user.getUserid());
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Role role=roleStore.getRole(grant.getRoleid());
      roles.add(role.getName());
    }
    debug("String_Node_Str");
    ClaimBuilder claim=new ClaimBuilder();
    claim.setUserId(user.getUserid().toString());
    claim.setUser(creds.username());
    claim.setDomain(domainName);
    for (int z=0; z < roles.size(); z++) {
      claim.addRole(roles.get(z));
    }
    return claim.build();
  }
 catch (  StoreException se) {
    throw new AuthenticationException("String_Node_Str" + se.toString() + se);
  }
}