Program: 147513
Project: 147513
Buggy source:
/** 
 * This method allows to create a new component.
 * @param component component as a JSON object
 * @return Response with the created project as a JSON object.
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str") @ApiResponses(value={@ApiResponse(code=HttpURLConnection.HTTP_CREATED,message="String_Node_Str"),@ApiResponse(code=HttpURLConnection.HTTP_UNAUTHORIZED,message="String_Node_Str"),@ApiResponse(code=HttpURLConnection.HTTP_INTERNAL_ERROR,message="String_Node_Str")}) public HttpResponse createComponent(@ApiParam(value="String_Node_Str",required=true) String component){
  DALFacade dalFacade=null;
  try {
    long userId=((UserAgent)getActiveAgent()).getId();
    String registratorErrors=bazaarService.notifyRegistrators(EnumSet.of(BazaarFunction.VALIDATION,BazaarFunction.USER_FIRST_LOGIN_HANDLING));
    if (registratorErrors != null) {
      ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE,ErrorCode.UNKNOWN,registratorErrors);
    }
    Gson gson=new Gson();
    Component componentToCreate=gson.fromJson(component,Component.class);
    Vtor vtor=bazaarService.getValidators();
    vtor.validate(componentToCreate);
    if (vtor.hasViolations()) {
      ExceptionHandler.getInstance().handleViolations(vtor.getViolations());
    }
    dalFacade=bazaarService.createConnection();
    Integer internalUserId=dalFacade.getUserIdByLAS2PeerId(userId);
    boolean authorized=new AuthorizationManager().isAuthorized(internalUserId,PrivilegeEnum.Create_COMPONENT,String.valueOf(componentToCreate.getProjectId()),dalFacade);
    if (!authorized) {
      ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE,ErrorCode.AUTHORIZATION,Localization.getInstance().getResourceBundle().getString("String_Node_Str"));
    }
    componentToCreate.setLeaderId(internalUserId);
    Component createdComponent=dalFacade.createComponent(componentToCreate);
    return new HttpResponse(gson.toJson(createdComponent),HttpURLConnection.HTTP_CREATED);
  }
 catch (  BazaarException bex) {
    return new HttpResponse(ExceptionHandler.getInstance().toJSON(bex),HttpURLConnection.HTTP_INTERNAL_ERROR);
  }
catch (  Exception ex) {
    BazaarException bazaarException=ExceptionHandler.getInstance().convert(ex,ExceptionLocation.BAZAARSERVICE,ErrorCode.UNKNOWN,"String_Node_Str");
    return new HttpResponse(ExceptionHandler.getInstance().toJSON(bazaarException),HttpURLConnection.HTTP_INTERNAL_ERROR);
  }
 finally {
    bazaarService.closeConnection(dalFacade);
  }
}

Fixed version (ground truth):
/** 
 * This method allows to create a new component.
 * @param component component as a JSON object
 * @return Response with the created project as a JSON object.
 */
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str") @ApiResponses(value={@ApiResponse(code=HttpURLConnection.HTTP_CREATED,message="String_Node_Str"),@ApiResponse(code=HttpURLConnection.HTTP_UNAUTHORIZED,message="String_Node_Str"),@ApiResponse(code=HttpURLConnection.HTTP_INTERNAL_ERROR,message="String_Node_Str")}) public HttpResponse createComponent(@ApiParam(value="String_Node_Str",required=true) @ContentParam String component){
  DALFacade dalFacade=null;
  try {
    long userId=((UserAgent)getActiveAgent()).getId();
    String registratorErrors=bazaarService.notifyRegistrators(EnumSet.of(BazaarFunction.VALIDATION,BazaarFunction.USER_FIRST_LOGIN_HANDLING));
    if (registratorErrors != null) {
      ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE,ErrorCode.UNKNOWN,registratorErrors);
    }
    Gson gson=new Gson();
    Component componentToCreate=gson.fromJson(component,Component.class);
    Vtor vtor=bazaarService.getValidators();
    vtor.validate(componentToCreate);
    if (vtor.hasViolations()) {
      ExceptionHandler.getInstance().handleViolations(vtor.getViolations());
    }
    dalFacade=bazaarService.createConnection();
    Integer internalUserId=dalFacade.getUserIdByLAS2PeerId(userId);
    boolean authorized=new AuthorizationManager().isAuthorized(internalUserId,PrivilegeEnum.Create_COMPONENT,String.valueOf(componentToCreate.getProjectId()),dalFacade);
    if (!authorized) {
      ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE,ErrorCode.AUTHORIZATION,Localization.getInstance().getResourceBundle().getString("String_Node_Str"));
    }
    componentToCreate.setLeaderId(internalUserId);
    Component createdComponent=dalFacade.createComponent(componentToCreate);
    return new HttpResponse(gson.toJson(createdComponent),HttpURLConnection.HTTP_CREATED);
  }
 catch (  BazaarException bex) {
    return new HttpResponse(ExceptionHandler.getInstance().toJSON(bex),HttpURLConnection.HTTP_INTERNAL_ERROR);
  }
catch (  Exception ex) {
    BazaarException bazaarException=ExceptionHandler.getInstance().convert(ex,ExceptionLocation.BAZAARSERVICE,ErrorCode.UNKNOWN,"String_Node_Str");
    return new HttpResponse(ExceptionHandler.getInstance().toJSON(bazaarException),HttpURLConnection.HTTP_INTERNAL_ERROR);
  }
 finally {
    bazaarService.closeConnection(dalFacade);
  }
}