Program: 135680
Project: 135680
Buggy source:
/** 
 * REST endpoint to create a user. Name and domain are required attributes, and all other fields (description, email, password, enabled) are optional. Optional fields default in the following manner: <code>description</code>: An empty string (<code>""</code>). <code>email</code>: An empty string (<code>""</code>). <code>password</code>: <code>changeme</code> <code>enabled</code>: <code>true</code> <p> If a password is not provided, please ensure you change the default password ASAP for security reasons!
 * @param info passed from Jersey
 * @param user the user defined in the JSON payload
 * @return A response stating success or failure of user creation
 */
@POST @Consumes("String_Node_Str") @Produces("String_Node_Str") public Response createUser(@Context UriInfo info,User user){
  LOG.info("String_Node_Str");
  if (user.getUserid() != null) {
    final String errorMessage="String_Node_Str";
    LOG.debug(errorMessage);
    final IDMError idmError=new IDMError();
    idmError.setMessage(errorMessage);
    return Response.status(400).entity(idmError).build();
  }
  if (user.isEnabled() == null) {
    user.setEnabled(true);
  }
  final String userName=user.getName();
  if (userName == null) {
    return missingRequiredField("String_Node_Str");
  }
  if (userName.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String domainId=user.getDomainid();
  if (domainId == null) {
    return missingRequiredField("String_Node_Str");
  }
  if (domainId.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String userDescription=user.getDescription();
  if (userDescription == null) {
    user.setDescription(DEFAULT_DESCRIPTION);
  }
  if (userDescription.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  String userEmail=user.getEmail();
  if (userEmail == null) {
    user.setEmail(DEFAULT_EMAIL);
    userEmail=DEFAULT_EMAIL;
  }
  if (userEmail.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String userPassword=user.getPassword();
  if (userPassword == null) {
    user.setPassword(DEFAULT_PWD);
  }
 else   if (userPassword.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  try {
    final User createdUser=iidMStore.writeUser(user);
    user.setUserid(createdUser.getUserid());
  }
 catch (  IDMStoreException se) {
    return internalError("String_Node_Str",se);
  }
  redactUserPasswordInfo(user);
  return Response.status(201).entity(user).build();
}

Fixed version (ground truth):
/** 
 * REST endpoint to create a user. Name and domain are required attributes, and all other fields (description, email, password, enabled) are optional. Optional fields default in the following manner: <code>description</code>: An empty string (<code>""</code>). <code>email</code>: An empty string (<code>""</code>). <code>password</code>: <code>changeme</code> <code>enabled</code>: <code>true</code> <p> If a password is not provided, please ensure you change the default password ASAP for security reasons!
 * @param info passed from Jersey
 * @param user the user defined in the JSON payload
 * @return A response stating success or failure of user creation
 */
@POST @Consumes("String_Node_Str") @Produces("String_Node_Str") public Response createUser(@Context UriInfo info,User user){
  LOG.info("String_Node_Str");
  if (user.getUserid() != null) {
    final String errorMessage="String_Node_Str";
    LOG.debug(errorMessage);
    final IDMError idmError=new IDMError();
    idmError.setMessage(errorMessage);
    return Response.status(400).entity(idmError).build();
  }
  if (user.isEnabled() == null) {
    user.setEnabled(true);
  }
  final String userName=user.getName();
  if (userName == null) {
    return missingRequiredField("String_Node_Str");
  }
  if (userName.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String domainId=user.getDomainid();
  if (domainId == null) {
    return missingRequiredField("String_Node_Str");
  }
  if (domainId.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  String userDescription=user.getDescription();
  if (userDescription == null) {
    user.setDescription(DEFAULT_DESCRIPTION);
  }
 else   if (userDescription.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String userEmail=user.getEmail();
  if (userEmail == null) {
    user.setEmail(DEFAULT_EMAIL);
  }
 else   if (userEmail.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  final String userPassword=user.getPassword();
  if (userPassword == null) {
    user.setPassword(DEFAULT_PWD);
  }
 else   if (userPassword.length() > IdmLightApplication.MAX_FIELD_LEN) {
    return providedFieldTooLong("String_Node_Str",IdmLightApplication.MAX_FIELD_LEN);
  }
  try {
    final User createdUser=iidMStore.writeUser(user);
    user.setUserid(createdUser.getUserid());
  }
 catch (  IDMStoreException se) {
    return internalError("String_Node_Str",se);
  }
  redactUserPasswordInfo(user);
  return Response.status(201).entity(user).build();
}