Program: 5389
Project: 5389
Buggy source:
/** 
 * Gets stream properties from the request. If there is request is invalid, response will be made and   {@code null}will be return.
 */
private StreamProperties getAndValidateConfig(HttpRequest request,HttpResponder responder){
  Reader reader=new InputStreamReader(new ChannelBufferInputStream(request.getContent()));
  StreamProperties properties;
  try {
    properties=GSON.fromJson(reader,StreamProperties.class);
  }
 catch (  Exception e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
    return null;
  }
  Long ttl=properties.getTTL();
  if (ttl != null && ttl < 0) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    return null;
  }
  FormatSpecification formatSpec=properties.getFormat();
  if (formatSpec != null) {
    String formatName=formatSpec.getName();
    if (formatName == null) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
      return null;
    }
    try {
      RecordFormat<?,?> format=RecordFormats.createInitializedFormat(formatSpec);
      formatSpec=new FormatSpecification(formatSpec.getName(),format.getSchema(),formatSpec.getSettings());
    }
 catch (    UnsupportedTypeException e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str" + formatName + "String_Node_Str");
      return null;
    }
catch (    Exception e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str" + formatName);
      return null;
    }
  }
  Integer threshold=properties.getNotificationThresholdMB();
  if (threshold != null && threshold <= 0) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    return null;
  }
  if (properties.getOwnerPrincipal() != null) {
    SecurityUtil.validateKerberosPrincipal(properties.getOwnerPrincipal());
  }
  return new StreamProperties(ttl,formatSpec,threshold,properties.getDescription(),properties.getOwnerPrincipal());
}

Fixed version (ground truth):
/** 
 * Gets stream properties from the request. If there is request is invalid, a BadRequestException will be thrown.
 */
private StreamProperties getAndValidateConfig(HttpRequest request) throws BadRequestException {
  Reader reader=new InputStreamReader(new ChannelBufferInputStream(request.getContent()));
  StreamProperties properties;
  try {
    properties=GSON.fromJson(reader,StreamProperties.class);
  }
 catch (  Exception e) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  Long ttl=properties.getTTL();
  if (ttl != null && ttl < 0) {
    throw new BadRequestException("String_Node_Str" + ttl + "String_Node_Str");
  }
  FormatSpecification formatSpec=properties.getFormat();
  if (formatSpec != null) {
    String formatName=formatSpec.getName();
    if (formatName == null) {
      throw new BadRequestException("String_Node_Str");
    }
    try {
      RecordFormat<?,?> format=RecordFormats.createInitializedFormat(formatSpec);
      formatSpec=new FormatSpecification(formatSpec.getName(),format.getSchema(),formatSpec.getSettings());
    }
 catch (    UnsupportedTypeException e) {
      throw new BadRequestException("String_Node_Str" + formatName + "String_Node_Str");
    }
catch (    Exception e) {
      throw new BadRequestException("String_Node_Str" + formatName);
    }
  }
  Integer threshold=properties.getNotificationThresholdMB();
  if (threshold != null && threshold <= 0) {
    throw new BadRequestException("String_Node_Str" + threshold + "String_Node_Str");
  }
  if (properties.getOwnerPrincipal() != null) {
    SecurityUtil.validateKerberosPrincipal(properties.getOwnerPrincipal());
  }
  return new StreamProperties(ttl,formatSpec,threshold,properties.getDescription(),properties.getOwnerPrincipal());
}