Source:
public QueryResponse checkVariantExists(@PathVariable("variantId") String variantId, @RequestParam(name = "studies", required = false) List<String> studies, @RequestParam("species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, UnknownHostException, IOException { initializeQuery(); if (species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<VariantEntity> variantEntities; Long numTotalResults; String invalidCoordinatesMessage = "Invalid position and alleles combination, please use chr:pos:ref or chr:pos:ref:alt"; if (variantId.contains(":")) { String[] regionId = variantId.split(":", -1); if (regionId.length < 3) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setErrorQueryResponse(invalidCoordinatesMessage); } String alternate = (regionId.length > 3) ? regionId[3] : null; if (studies != null && !studies.isEmpty()) { variantEntities = queryByCoordinatesAndAllelesAndStudyIds(regionId[0], Integer.parseInt(regionId[1]), regionId[2], alternate, studies); } else { variantEntities = queryByCoordinatesAndAlleles(regionId[0], Integer.parseInt(regionId[1]), regionId[2], alternate); } numTotalResults = (long) variantEntities.size(); } else { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setErrorQueryResponse(invalidCoordinatesMessage); } QueryResult queryResult = new QueryResult(); queryResult.setResult(Arrays.asList(numTotalResults > 0)); queryResult.setResultType(Boolean.class.getCanonicalName()); return setQueryResponse(queryResult); }

Target:
public QueryResponse checkVariantExists(@PathVariable("variantId") String variantId, @RequestParam(name = "studies", required = false) List<String> studies, @RequestParam("species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, UnknownHostException, IOException { initializeQuery(); if (species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<VariantEntity> variantEntities; Long numTotalResults; String invalidCoordinatesMessage = "Invalid position and alleles combination, please use chr:pos:ref or chr:pos:ref:alt"; if (variantId.contains(":")) { String[] regionId = variantId.split(":", -1); if (regionId.length < 3) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setErrorQueryResponse(invalidCoordinatesMessage); } String alternate = (regionId.length > 3) ? regionId[3] : null; if (studies != null && !studies.isEmpty()) { variantEntities = queryByCoordinatesAndAllelesAndStudyIds(regionId[0], Integer.parseInt(regionId[1]), regionId[2], alternate, studies); } else { variantEntities = queryByCoordinatesAndAlleles(regionId[0], Integer.parseInt(regionId[1]), regionId[2], alternate); } } else { List<VariantEntityRepositoryFilter> filters = new FilterBuilder().withStudies(studies).build(); variantEntities = variantEntityRepository.findByIdsAndComplexFilters(variantId, filters, null, Utils.getPageRequest(queryOptions)); } numTotalResults = (long) variantEntities.size(); QueryResult queryResult = new QueryResult(); queryResult.setResult(Arrays.asList(numTotalResults > 0)); queryResult.setResultType(Boolean.class.getCanonicalName()); return setQueryResponse(queryResult); }