diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java index b26884897c9..065ff38d6f7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java @@ -64,15 +64,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Nonnull; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Function; +import javax.annotation.Nonnull; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; public class PersistedJpaBundleProvider implements IBundleProvider { @@ -258,8 +258,8 @@ public class PersistedJpaBundleProvider implements IBundleProvider { // we request 1 more resource than we need // this is so we can be sure of when we hit the last page // (when doing offset searches) - final List pidsSubList = - mySearchCoordinatorSvc.getResources(myUuid, theFromIndex, theToIndex + 1, myRequest, requestPartitionId); + final List pidsSubList = mySearchCoordinatorSvc.getResources( + myUuid, theFromIndex, theToIndex + 1, myRequest, requestPartitionId); int maxSize = Math.min(theToIndex, pidsSubList.size()); theResponsePageBuilder.setTotalRequestedResourcesFetched(pidsSubList.size()); List resources = myTxService diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java index c6f575b033e..77c02105714 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/IBundleProvider.java @@ -26,12 +26,12 @@ import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public interface IBundleProvider { diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResponsePage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResponsePage.java index e8e0f7c7a74..eecda23ec0f 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResponsePage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/ResponsePage.java @@ -148,7 +148,7 @@ public class ResponsePage { // (sometimes it's 0, even if it's not a currentpageoffset search) // so we have to make sure either next or prev links are not null return (StringUtils.isNotBlank(myBundleProvider.getNextPageId()) - || StringUtils.isNotBlank(myBundleProvider.getPreviousPageId())); + || StringUtils.isNotBlank(myBundleProvider.getPreviousPageId())); } } @@ -172,8 +172,9 @@ public class ResponsePage { } else { myPagingStyle = PagingStyle.NONE; // only end up here if no paging is desired - ourLog.debug("No accurate paging will be generated." + - " If accurate paging is desired, ResponsePageBuilder must be provided with additioanl information."); + ourLog.debug( + "No accurate paging will be generated." + + " If accurate paging is desired, ResponsePageBuilder must be provided with additioanl information."); } } @@ -260,9 +261,10 @@ public class ResponsePage { // resourceList.size - included resources + omitted resources == pagesize // -> we (most likely) have more resources if (myPageSize == myResourceList.size() - myIncludedResourceCount + myOmittedResourceCount) { - ourLog.warn("Returning a next page based on calculated resource count." - + " This could be inaccurate if the exact number of resources were fetched is equal to the pagesize requested. " - + " Consider setting ResponseBundleBuilder.setTotalResourcesFetchedRequest after fetching resources."); + ourLog.warn( + "Returning a next page based on calculated resource count." + + " This could be inaccurate if the exact number of resources were fetched is equal to the pagesize requested. " + + " Consider setting ResponseBundleBuilder.setTotalResourcesFetchedRequest after fetching resources."); return true; } } @@ -457,7 +459,7 @@ public class ResponsePage { myOmittedResourceCount, // omitted resources myTotalRequestedResourcesFetched, // total count of requested resources myBundleProvider // the bundle provider - ); + ); } }