Program: 24919
Project: 24919
Buggy source:
private Navigation createUser(Application app) throws Exception {
  log.info("String_Node_Str" + KeyFactory.keyToString(app.getKey()));
  Validators v=new Validators(request);
  v.add("String_Node_Str",v.required());
  v.add("String_Node_Str",v.required());
  try {
    JSONObject json=new JSONObject(new JSONTokener(request.getReader()));
    requestScope("String_Node_Str",json.getString("String_Node_Str"));
    requestScope("String_Node_Str",json.getString("String_Node_Str"));
  }
 catch (  Exception e) {
    log.warning("String_Node_Str" + e.getMessage());
    response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);
    return null;
  }
  if (!v.validate()) {
    log.warning(String.format("String_Node_Str",KeyFactory.keyToString(app.getKey()),request.getReader().toString()));
    response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);
    return null;
  }
  UserMeta userMeta=UserMeta.get();
  if (Datastore.query(userMeta).filter(userMeta.name.equal(asString("String_Node_Str")),userMeta.applicationRef.equal(app.getKey())).count() != 0) {
    log.warning(String.format("String_Node_Str",asString("String_Node_Str"),KeyFactory.keyToString(app.getKey())));
    response.setStatus(HttpURLConnection.HTTP_CONFLICT);
    return null;
  }
  log.info(String.format("String_Node_Str",asString("String_Node_Str"),KeyFactory.keyToString(app.getKey()),asString("String_Node_Str")));
  User user=new User();
  BeanUtil.copy(request,user);
  user.getApplicationRef().setModel(app);
  Datastore.put(user);
  response.setStatus(HttpURLConnection.HTTP_CREATED);
  response.setHeader("String_Node_Str",UserHelper.getLocationHeaderForUser(user));
  return null;
}

Fixed version (ground truth):
private Navigation createUser(Application app) throws Exception {
  log.info("String_Node_Str" + KeyFactory.keyToString(app.getKey()));
  Validators v=new Validators(request);
  v.add("String_Node_Str",v.required());
  v.add("String_Node_Str",v.required());
  JSONObject json;
  try {
    json=new JSONObject(new JSONTokener(request.getReader()));
    requestScope("String_Node_Str",json.getString("String_Node_Str"));
    requestScope("String_Node_Str",json.getString("String_Node_Str"));
  }
 catch (  Exception e) {
    log.warning("String_Node_Str" + e.getMessage());
    response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);
    return null;
  }
  if (!v.validate()) {
    log.warning(String.format("String_Node_Str",KeyFactory.keyToString(app.getKey()),json.toString()));
    response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);
    return null;
  }
  UserMeta userMeta=UserMeta.get();
  if (Datastore.query(userMeta).filter(userMeta.name.equal(asString("String_Node_Str")),userMeta.applicationRef.equal(app.getKey())).count() != 0) {
    log.warning(String.format("String_Node_Str",asString("String_Node_Str"),KeyFactory.keyToString(app.getKey())));
    response.setStatus(HttpURLConnection.HTTP_CONFLICT);
    return null;
  }
  log.info(String.format("String_Node_Str",asString("String_Node_Str"),KeyFactory.keyToString(app.getKey()),asString("String_Node_Str")));
  User user=new User();
  BeanUtil.copy(request,user);
  user.getApplicationRef().setModel(app);
  Datastore.put(user);
  response.setStatus(HttpURLConnection.HTTP_CREATED);
  response.setHeader("String_Node_Str",UserHelper.getLocationHeaderForUser(user));
  return null;
}