Program: 102445
Project: 102445
Buggy source:
@GET @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str"),@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=500,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str")}) public Response getUsers(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String q,@ApiParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") @QueryParam("String_Node_Str") int offset,@ApiParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") @QueryParam("String_Node_Str") int limit,@ApiParam(value="String_Node_Str",defaultValue="String_Node_Str") @QueryParam("String_Node_Str") boolean returnSize,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  ProfileFilter filter=new ProfileFilter();
  filter.setName(q == null || q.isEmpty() ? "String_Node_Str" : q);
  ListAccess<Identity> list=CommonsUtils.getService(IdentityManager.class).getIdentitiesByProfileFilter(OrganizationIdentityProvider.NAME,filter,false);
  Identity[] identities=list.load(offset,limit);
  List<DataEntity> profileInfos=new ArrayList<DataEntity>();
  for (  Identity identity : identities) {
    UserEntity profileInfo=EntityBuilder.buildEntityProfile(identity.getProfile(),uriInfo.getPath(),expand);
    profileInfos.add(profileInfo.getDataEntity());
  }
  CollectionEntity collectionUser=new CollectionEntity(profileInfos,EntityBuilder.USERS_TYPE,offset,limit);
  if (returnSize) {
    collectionUser.setSize(list.getSize());
  }
  return EntityBuilder.getResponse(collectionUser,uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}

Fixed version (ground truth):
@GET @RolesAllowed("String_Node_Str") @ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str",response=Response.class,notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str"),@ApiResponse(code=404,message="String_Node_Str"),@ApiResponse(code=500,message="String_Node_Str"),@ApiResponse(code=400,message="String_Node_Str")}) public Response getUsers(@Context UriInfo uriInfo,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String q,@ApiParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") @QueryParam("String_Node_Str") int offset,@ApiParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") @QueryParam("String_Node_Str") int limit,@ApiParam(value="String_Node_Str",defaultValue="String_Node_Str") @QueryParam("String_Node_Str") boolean returnSize,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String expand) throws Exception {
  ProfileFilter filter=new ProfileFilter();
  filter.setName(q == null || q.isEmpty() ? "String_Node_Str" : q);
  ListAccess<Identity> list=CommonsUtils.getService(IdentityManager.class).getIdentitiesByProfileFilter(OrganizationIdentityProvider.NAME,filter,false);
  Identity[] identities=list.load(offset,limit);
  List<DataEntity> profileInfos=new ArrayList<DataEntity>();
  for (  Identity identity : identities) {
    UserEntity profileInfo=EntityBuilder.buildEntityProfile(identity.getProfile(),uriInfo.getPath(),expand);
    profileInfos.add(profileInfo.getDataEntity());
  }
  CollectionEntity collectionUser=new CollectionEntity(profileInfos,EntityBuilder.USERS_TYPE,offset,limit);
  if (returnSize) {
    collectionUser.setSize(list.getSize());
  }
  return EntityBuilder.getResponse(collectionUser,uriInfo,RestUtils.getJsonMediaType(),Response.Status.OK);
}