Program: 91229
Project: 91229
Buggy source:
/** 
 * API for uploading JSON file to allow massive device registration (aka import). The Endpoint is protected using <code>HTTP Basic</code> (credentials <code>VariantID:secret</code>). <pre> curl -u "variantID:secret" -v -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "file=@/path/to/my-devices-for-import.json" -X POST https://SERVER:PORT/context/rest/registry/device/importer </pre> The format of the JSON file is an array, containing several objects that follow the same syntax used on the <code>/rest/registry/device</code> endpoint. <p/> Here is an example: <pre> [ { "deviceToken" : "someTokenString", "deviceType" : "iPad", "operatingSystem" : "iOS", "osVersion" : "6.1.2", "alias" : "someUsername or email adress...", "categories" : ["football", "sport"] }, { "deviceToken" : "someOtherTokenString", ... }, ... ] </pre>
 * @param form  JSON file to import
 * @return      empty JSON body
 * @responseheader WWW-Authenticate Basic realm="AeroGear UnifiedPush Server" (only for 401 response)
 * @statuscode 200 Successful submission of import job
 * @statuscode 400 The format of the client request was incorrect
 * @statuscode 401 The request requires authentication
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @BodyType("String_Node_Str") @ReturnType("String_Node_Str") public Response importDevice(@MultipartForm ImporterForm form,@Context HttpServletRequest request){
  final Variant variant=loadVariantWhenAuthorized(request);
  if (variant == null) {
    return create401Response(request);
  }
  List<Installation> devices;
  try {
    devices=mapper.readValue(form.getJsonFile(),new TypeReference<List<Installation>>(){
    }
);
  }
 catch (  IOException e) {
    logger.severe("String_Node_Str",e);
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.info("String_Node_Str" + devices.size());
  clientInstallationService.addInstallations(variant,devices);
  return Response.ok(EmptyJSON.STRING).build();
}

Fixed version (ground truth):
/** 
 * API for uploading JSON file to allow massive device registration (aka import). The Endpoint is protected using <code>HTTP Basic</code> (credentials <code>VariantID:secret</code>). <pre> curl -u "variantID:secret" -v -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "file=@/path/to/my-devices-for-import.json" -X POST https://SERVER:PORT/context/rest/registry/device/importer </pre> The format of the JSON file is an array, containing several objects that follow the same syntax used on the <code>/rest/registry/device</code> endpoint. <p> Here is an example: <pre> [ { "deviceToken" : "someTokenString", "deviceType" : "iPad", "operatingSystem" : "iOS", "osVersion" : "6.1.2", "alias" : "someUsername or email adress...", "categories" : ["football", "sport"] }, { "deviceToken" : "someOtherTokenString", ... }, ... ] </pre>
 * @param form  JSON file to import
 * @return      empty JSON body
 * @responseheader WWW-Authenticate Basic realm="AeroGear UnifiedPush Server" (only for 401 response)
 * @statuscode 200 Successful submission of import job
 * @statuscode 400 The format of the client request was incorrect
 * @statuscode 401 The request requires authentication
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @BodyType("String_Node_Str") @ReturnType("String_Node_Str") public Response importDevice(@MultipartForm ImporterForm form,@Context HttpServletRequest request){
  final Variant variant=loadVariantWhenAuthorized(request);
  if (variant == null) {
    return create401Response(request);
  }
  List<Installation> devices;
  try {
    devices=mapper.readValue(form.getJsonFile(),new TypeReference<List<Installation>>(){
    }
);
  }
 catch (  IOException e) {
    logger.severe("String_Node_Str",e);
    return Response.status(Status.BAD_REQUEST).build();
  }
  logger.info("String_Node_Str" + devices.size());
  clientInstallationService.addInstallations(variant,devices);
  return Response.ok(EmptyJSON.STRING).build();
}