From 76fb7bd36fac1141d690a9524dc03942737aca13 Mon Sep 17 00:00:00 2001 From: Federico Rispo Date: Sat, 11 Feb 2023 23:42:16 +0100 Subject: [PATCH 1/2] fix(deps): update graphql-java to v20.0.0 To update graphql-java to version 20.0.0 some changes are necessary: - the signature of DataLoaderDispatcherInstrumentation methods now have the InstrumentationState parameter. The ConfigurableDispatchInstrumentation is aligned to these changes - The SimpleInstrumentation is replaced by SimplePerformantInstrumentation. Now all the codebase uses the new class --- gradle.properties | 2 +- .../execution/GraphQLQueryInvoker.java | 10 +-- .../execution/config/GraphQLBuilder.java | 4 +- .../ConfigurableDispatchInstrumentation.java | 65 +++++++++++-------- .../NoOpInstrumentationProvider.java | 4 +- graphql-java-servlet/build.gradle | 2 +- .../servlet/DataLoaderDispatchingSpec.groovy | 12 ++-- .../servlet/OsgiGraphQLHttpServletSpec.groovy | 4 +- 8 files changed, 57 insertions(+), 46 deletions(-) diff --git a/gradle.properties b/gradle.properties index fe7b7521..12dcffd0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ PROJECT_LICENSE=MIT PROJECT_LICENSE_URL=https://github.com/graphql-java-kickstart/spring-java-servlet/blob/master/LICENSE.md PROJECT_DEV_ID=oliemansm PROJECT_DEV_NAME=Michiel Oliemans -LIB_GRAPHQL_JAVA_VER=19.3 +LIB_GRAPHQL_JAVA_VER=20.0 LIB_JACKSON_VER=2.14.2 LIB_SLF4J_VER=2.0.6 LIB_LOMBOK_VER=1.18.26 diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java index 06982331..19370561 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java @@ -2,7 +2,7 @@ import graphql.execution.instrumentation.ChainedInstrumentation; import graphql.execution.instrumentation.Instrumentation; -import graphql.execution.instrumentation.SimpleInstrumentation; +import graphql.execution.instrumentation.SimplePerformantInstrumentation; import graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentationOptions; import graphql.execution.preparsed.NoOpPreparsedDocumentProvider; import graphql.execution.preparsed.PreparsedDocumentProvider; @@ -12,7 +12,9 @@ import java.util.List; import java.util.function.Supplier; -/** @author Andrew Potter */ +/** + * @author Andrew Potter + */ public class GraphQLQueryInvoker { private final Supplier getExecutionStrategyProvider; @@ -48,12 +50,12 @@ public static class Builder { private Supplier getExecutionStrategyProvider = DefaultExecutionStrategyProvider::new; - private Supplier getInstrumentation = () -> SimpleInstrumentation.INSTANCE; + private Supplier getInstrumentation = () -> SimplePerformantInstrumentation.INSTANCE; private Supplier getPreparsedDocumentProvider = () -> NoOpPreparsedDocumentProvider.INSTANCE; private Supplier dataLoaderDispatcherInstrumentationOptionsSupplier = - DataLoaderDispatcherInstrumentationOptions::newOptions; + DataLoaderDispatcherInstrumentationOptions::newOptions; public Builder withExecutionStrategyProvider(ExecutionStrategyProvider provider) { return withExecutionStrategyProvider(() -> provider); diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java index f275b48f..7f5c1dcd 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java @@ -4,7 +4,7 @@ import graphql.execution.ExecutionStrategy; import graphql.execution.instrumentation.ChainedInstrumentation; import graphql.execution.instrumentation.Instrumentation; -import graphql.execution.instrumentation.SimpleInstrumentation; +import graphql.execution.instrumentation.SimplePerformantInstrumentation; import graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentation; import graphql.execution.preparsed.NoOpPreparsedDocumentProvider; import graphql.execution.preparsed.PreparsedDocumentProvider; @@ -20,7 +20,7 @@ public class GraphQLBuilder { () -> NoOpPreparsedDocumentProvider.INSTANCE; @Getter - private Supplier instrumentationSupplier = () -> SimpleInstrumentation.INSTANCE; + private Supplier instrumentationSupplier = () -> SimplePerformantInstrumentation.INSTANCE; private Supplier graphQLBuilderConfigurerSupplier = () -> builder -> {}; diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java index 4a103fa8..23565b2e 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java @@ -35,7 +35,9 @@ public class ConfigurableDispatchInstrumentation extends DataLoaderDispatcherIns private final Function approachFunction; - /** Creates a DataLoaderDispatcherInstrumentation with the default options */ + /** + * Creates a DataLoaderDispatcherInstrumentation with the default options + */ public ConfigurableDispatchInstrumentation( Function approachFunction) { this(DataLoaderDispatcherInstrumentationOptions.newOptions(), approachFunction); @@ -46,8 +48,7 @@ public ConfigurableDispatchInstrumentation( * * @param options the options to control the behaviour */ - public ConfigurableDispatchInstrumentation( - DataLoaderDispatcherInstrumentationOptions options, + public ConfigurableDispatchInstrumentation(DataLoaderDispatcherInstrumentationOptions options, Function approachFunction) { this.options = options; this.approachFunction = approachFunction; @@ -59,26 +60,27 @@ public InstrumentationState createState(InstrumentationCreateStateParameters par return new DataLoaderDispatcherInstrumentationState( registry, approachFunction.apply(registry), - parameters.getExecutionInput().getExecutionId()); + parameters.getExecutionInput().getExecutionId() + ); } @Override - public DataFetcher instrumentDataFetcher( - DataFetcher dataFetcher, InstrumentationFieldFetchParameters parameters) { - DataLoaderDispatcherInstrumentationState state = parameters.getInstrumentationState(); + public DataFetcher instrumentDataFetcher(DataFetcher dataFetcher, + InstrumentationFieldFetchParameters parameters, InstrumentationState instrumentationState) { + DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( + instrumentationState); if (state.isAggressivelyBatching()) { return dataFetcher; } // // currently only AsyncExecutionStrategy with DataLoader and hence this allows us to "dispatch" - // on every object if its not using aggressive batching for other execution strategies + // on every object if it's not using aggressive batching for other execution strategies // which allows them to work if used. - return (DataFetcher) - environment -> { - Object obj = dataFetcher.get(environment); - doImmediatelyDispatch(state); - return obj; - }; + return (DataFetcher) environment -> { + Object obj = dataFetcher.get(environment); + doImmediatelyDispatch(state); + return obj; + }; } private void doImmediatelyDispatch(DataLoaderDispatcherInstrumentationState state) { @@ -87,12 +89,14 @@ private void doImmediatelyDispatch(DataLoaderDispatcherInstrumentationState stat @Override public InstrumentationContext beginExecuteOperation( - InstrumentationExecuteOperationParameters parameters) { + InstrumentationExecuteOperationParameters parameters, + InstrumentationState instrumentationState) { if (!isDataLoaderCompatible(parameters.getExecutionContext())) { - DataLoaderDispatcherInstrumentationState state = parameters.getInstrumentationState(); + DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( + instrumentationState); state.setAggressivelyBatching(false); } - return new SimpleInstrumentationContext<>(); + return SimpleInstrumentationContext.noOp(); } private boolean isDataLoaderCompatible(ExecutionContext executionContext) { @@ -111,8 +115,10 @@ private boolean isDataLoaderCompatible(ExecutionContext executionContext) { @Override public ExecutionStrategyInstrumentationContext beginExecutionStrategy( - InstrumentationExecutionStrategyParameters parameters) { - DataLoaderDispatcherInstrumentationState state = parameters.getInstrumentationState(); + InstrumentationExecutionStrategyParameters parameters, + InstrumentationState instrumentationState) { + DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( + instrumentationState); // // if there are no data loaders, there is nothing to do // @@ -134,36 +140,39 @@ public void onCompleted(ExecutionResult result, Throwable t) { @Override public InstrumentationContext beginFieldFetch( - InstrumentationFieldFetchParameters parameters) { - DataLoaderDispatcherInstrumentationState state = parameters.getInstrumentationState(); + InstrumentationFieldFetchParameters parameters, InstrumentationState instrumentationState) { + DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( + instrumentationState); // // if there are no data loaders, there is nothing to do // if (state.hasNoDataLoaders()) { - return new SimpleInstrumentationContext<>(); + return SimpleInstrumentationContext.noOp(); } return state.getApproach().beginFieldFetch(parameters); } @Override public CompletableFuture instrumentExecutionResult( - ExecutionResult executionResult, InstrumentationExecutionParameters parameters) { - DataLoaderDispatcherInstrumentationState state = parameters.getInstrumentationState(); + ExecutionResult executionResult, InstrumentationExecutionParameters parameters, + InstrumentationState instrumentationState) { + DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( + instrumentationState); state.getApproach().removeTracking(parameters.getExecutionInput().getExecutionId()); if (!options.isIncludeStatistics()) { return CompletableFuture.completedFuture(executionResult); } else { Map currentExt = executionResult.getExtensions(); - Map statsMap = - new LinkedHashMap<>(currentExt == null ? Collections.emptyMap() : currentExt); + Map statsMap = new LinkedHashMap<>( + currentExt == null ? Collections.emptyMap() : currentExt); Map dataLoaderStats = buildStatisticsMap(state); statsMap.put("dataloader", dataLoaderStats); log.debug("Data loader stats : {}", dataLoaderStats); return CompletableFuture.completedFuture( - new ExecutionResultImpl( - executionResult.getData(), executionResult.getErrors(), statsMap)); + new ExecutionResultImpl(executionResult.getData(), executionResult.getErrors(), + statsMap)); } } diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/NoOpInstrumentationProvider.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/NoOpInstrumentationProvider.java index 0190c731..e43d3f14 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/NoOpInstrumentationProvider.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/NoOpInstrumentationProvider.java @@ -1,13 +1,13 @@ package graphql.kickstart.execution.instrumentation; import graphql.execution.instrumentation.Instrumentation; -import graphql.execution.instrumentation.SimpleInstrumentation; +import graphql.execution.instrumentation.SimplePerformantInstrumentation; import graphql.kickstart.execution.config.InstrumentationProvider; public class NoOpInstrumentationProvider implements InstrumentationProvider { @Override public Instrumentation getInstrumentation() { - return SimpleInstrumentation.INSTANCE; + return SimplePerformantInstrumentation.INSTANCE; } } diff --git a/graphql-java-servlet/build.gradle b/graphql-java-servlet/build.gradle index 5d9eb6ec..9e741d03 100644 --- a/graphql-java-servlet/build.gradle +++ b/graphql-java-servlet/build.gradle @@ -29,7 +29,7 @@ dependencies { compileOnly 'org.osgi:org.osgi.service.metatype.annotations:1.4.1' compileOnly 'org.osgi:org.osgi.annotation:6.0.0' - testImplementation 'io.github.graphql-java:graphql-java-annotations:8.3' + testImplementation 'io.github.graphql-java:graphql-java-annotations:9.1' // Unit testing testImplementation "org.apache.groovy:groovy-all:4.0.10" diff --git a/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/DataLoaderDispatchingSpec.groovy b/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/DataLoaderDispatchingSpec.groovy index 58003651..89f1abe1 100644 --- a/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/DataLoaderDispatchingSpec.groovy +++ b/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/DataLoaderDispatchingSpec.groovy @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import graphql.ExecutionInput import graphql.execution.instrumentation.ChainedInstrumentation import graphql.execution.instrumentation.Instrumentation -import graphql.execution.instrumentation.SimpleInstrumentation +import graphql.execution.instrumentation.SimplePerformantInstrumentation import graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentationOptions import graphql.kickstart.execution.context.ContextSetting import graphql.kickstart.execution.context.DefaultGraphQLContext @@ -14,7 +14,7 @@ import graphql.kickstart.servlet.context.GraphQLServletContextBuilder import graphql.schema.DataFetcher import graphql.schema.DataFetchingEnvironment import org.dataloader.BatchLoader -import org.dataloader.DataLoader +import org.dataloader.DataLoaderFactory import org.dataloader.DataLoaderRegistry import org.springframework.mock.web.MockHttpServletRequest import org.springframework.mock.web.MockHttpServletResponse @@ -59,9 +59,9 @@ class DataLoaderDispatchingSpec extends Specification { def registry() { DataLoaderRegistry registry = new DataLoaderRegistry() - registry.register("A", DataLoader.newDataLoader(batchLoaderWithCounter(fetchCounterA))) - registry.register("B", DataLoader.newDataLoader(batchLoaderWithCounter(fetchCounterB))) - registry.register("C", DataLoader.newDataLoader(batchLoaderWithCounter(fetchCounterC))) + registry.register("A", DataLoaderFactory.newDataLoader(batchLoaderWithCounter(fetchCounterA))) + registry.register("B", DataLoaderFactory.newDataLoader(batchLoaderWithCounter(fetchCounterB))) + registry.register("C", DataLoaderFactory.newDataLoader(batchLoaderWithCounter(fetchCounterC))) registry } @@ -120,7 +120,7 @@ class DataLoaderDispatchingSpec extends Specification { mapper.readValue(response.getContentAsByteArray(), List) } - Instrumentation simpleInstrumentation = new SimpleInstrumentation() + Instrumentation simpleInstrumentation = new SimplePerformantInstrumentation() ChainedInstrumentation chainedInstrumentation = new ChainedInstrumentation(Collections.singletonList(simpleInstrumentation)) def simpleSupplier = { simpleInstrumentation } def chainedSupplier = { chainedInstrumentation } diff --git a/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/OsgiGraphQLHttpServletSpec.groovy b/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/OsgiGraphQLHttpServletSpec.groovy index 7556946a..ea4ed23d 100644 --- a/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/OsgiGraphQLHttpServletSpec.groovy +++ b/graphql-java-servlet/src/test/groovy/graphql/kickstart/servlet/OsgiGraphQLHttpServletSpec.groovy @@ -5,7 +5,7 @@ import graphql.annotations.annotationTypes.GraphQLField import graphql.annotations.annotationTypes.GraphQLName import graphql.annotations.processor.GraphQLAnnotations import graphql.execution.instrumentation.InstrumentationState -import graphql.execution.instrumentation.SimpleInstrumentation +import graphql.execution.instrumentation.SimplePerformantInstrumentation import graphql.execution.instrumentation.parameters.InstrumentationCreateStateParameters import graphql.kickstart.execution.GraphQLRequest import graphql.kickstart.execution.config.ExecutionStrategyProvider @@ -349,7 +349,7 @@ class OsgiGraphQLHttpServletSpec extends Specification { def "instrumentation provider is bound and unbound"() { setup: def servlet = new OsgiGraphQLHttpServlet() - def instrumentation = new SimpleInstrumentation() + def instrumentation = new SimplePerformantInstrumentation() def instrumentationProvider = Mock(InstrumentationProvider) instrumentationProvider.getInstrumentation() >> instrumentation def request = GraphQLRequest.createIntrospectionRequest() From 592c6bc68e3d2d183aeb625d8d9b1741385ad3e0 Mon Sep 17 00:00:00 2001 From: Federico Rispo Date: Sun, 12 Feb 2023 17:13:01 +0100 Subject: [PATCH 2/2] fix: linting --- .../execution/GraphQLQueryInvoker.java | 5 +- .../execution/config/GraphQLBuilder.java | 3 +- .../ConfigurableDispatchInstrumentation.java | 58 ++++++++++--------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java index 19370561..b03f2ec8 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/GraphQLQueryInvoker.java @@ -50,12 +50,13 @@ public static class Builder { private Supplier getExecutionStrategyProvider = DefaultExecutionStrategyProvider::new; - private Supplier getInstrumentation = () -> SimplePerformantInstrumentation.INSTANCE; + private Supplier getInstrumentation = + () -> SimplePerformantInstrumentation.INSTANCE; private Supplier getPreparsedDocumentProvider = () -> NoOpPreparsedDocumentProvider.INSTANCE; private Supplier dataLoaderDispatcherInstrumentationOptionsSupplier = - DataLoaderDispatcherInstrumentationOptions::newOptions; + DataLoaderDispatcherInstrumentationOptions::newOptions; public Builder withExecutionStrategyProvider(ExecutionStrategyProvider provider) { return withExecutionStrategyProvider(() -> provider); diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java index 7f5c1dcd..aa43deaa 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/config/GraphQLBuilder.java @@ -20,7 +20,8 @@ public class GraphQLBuilder { () -> NoOpPreparsedDocumentProvider.INSTANCE; @Getter - private Supplier instrumentationSupplier = () -> SimplePerformantInstrumentation.INSTANCE; + private Supplier instrumentationSupplier = + () -> SimplePerformantInstrumentation.INSTANCE; private Supplier graphQLBuilderConfigurerSupplier = () -> builder -> {}; diff --git a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java index 23565b2e..477071be 100644 --- a/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java +++ b/graphql-java-kickstart/src/main/java/graphql/kickstart/execution/instrumentation/ConfigurableDispatchInstrumentation.java @@ -35,9 +35,7 @@ public class ConfigurableDispatchInstrumentation extends DataLoaderDispatcherIns private final Function approachFunction; - /** - * Creates a DataLoaderDispatcherInstrumentation with the default options - */ + /** Creates a DataLoaderDispatcherInstrumentation with the default options */ public ConfigurableDispatchInstrumentation( Function approachFunction) { this(DataLoaderDispatcherInstrumentationOptions.newOptions(), approachFunction); @@ -48,7 +46,8 @@ public ConfigurableDispatchInstrumentation( * * @param options the options to control the behaviour */ - public ConfigurableDispatchInstrumentation(DataLoaderDispatcherInstrumentationOptions options, + public ConfigurableDispatchInstrumentation( + DataLoaderDispatcherInstrumentationOptions options, Function approachFunction) { this.options = options; this.approachFunction = approachFunction; @@ -60,15 +59,16 @@ public InstrumentationState createState(InstrumentationCreateStateParameters par return new DataLoaderDispatcherInstrumentationState( registry, approachFunction.apply(registry), - parameters.getExecutionInput().getExecutionId() - ); + parameters.getExecutionInput().getExecutionId()); } @Override - public DataFetcher instrumentDataFetcher(DataFetcher dataFetcher, - InstrumentationFieldFetchParameters parameters, InstrumentationState instrumentationState) { - DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( - instrumentationState); + public DataFetcher instrumentDataFetcher( + DataFetcher dataFetcher, + InstrumentationFieldFetchParameters parameters, + InstrumentationState instrumentationState) { + DataLoaderDispatcherInstrumentationState state = + InstrumentationState.ofState(instrumentationState); if (state.isAggressivelyBatching()) { return dataFetcher; } @@ -76,11 +76,12 @@ public DataFetcher instrumentDataFetcher(DataFetcher dataFetcher, // currently only AsyncExecutionStrategy with DataLoader and hence this allows us to "dispatch" // on every object if it's not using aggressive batching for other execution strategies // which allows them to work if used. - return (DataFetcher) environment -> { - Object obj = dataFetcher.get(environment); - doImmediatelyDispatch(state); - return obj; - }; + return (DataFetcher) + environment -> { + Object obj = dataFetcher.get(environment); + doImmediatelyDispatch(state); + return obj; + }; } private void doImmediatelyDispatch(DataLoaderDispatcherInstrumentationState state) { @@ -92,8 +93,8 @@ public InstrumentationContext beginExecuteOperation( InstrumentationExecuteOperationParameters parameters, InstrumentationState instrumentationState) { if (!isDataLoaderCompatible(parameters.getExecutionContext())) { - DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( - instrumentationState); + DataLoaderDispatcherInstrumentationState state = + InstrumentationState.ofState(instrumentationState); state.setAggressivelyBatching(false); } return SimpleInstrumentationContext.noOp(); @@ -117,8 +118,8 @@ private boolean isDataLoaderCompatible(ExecutionContext executionContext) { public ExecutionStrategyInstrumentationContext beginExecutionStrategy( InstrumentationExecutionStrategyParameters parameters, InstrumentationState instrumentationState) { - DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( - instrumentationState); + DataLoaderDispatcherInstrumentationState state = + InstrumentationState.ofState(instrumentationState); // // if there are no data loaders, there is nothing to do // @@ -141,8 +142,8 @@ public void onCompleted(ExecutionResult result, Throwable t) { @Override public InstrumentationContext beginFieldFetch( InstrumentationFieldFetchParameters parameters, InstrumentationState instrumentationState) { - DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( - instrumentationState); + DataLoaderDispatcherInstrumentationState state = + InstrumentationState.ofState(instrumentationState); // // if there are no data loaders, there is nothing to do // @@ -154,25 +155,26 @@ public InstrumentationContext beginFieldFetch( @Override public CompletableFuture instrumentExecutionResult( - ExecutionResult executionResult, InstrumentationExecutionParameters parameters, + ExecutionResult executionResult, + InstrumentationExecutionParameters parameters, InstrumentationState instrumentationState) { - DataLoaderDispatcherInstrumentationState state = InstrumentationState.ofState( - instrumentationState); + DataLoaderDispatcherInstrumentationState state = + InstrumentationState.ofState(instrumentationState); state.getApproach().removeTracking(parameters.getExecutionInput().getExecutionId()); if (!options.isIncludeStatistics()) { return CompletableFuture.completedFuture(executionResult); } else { Map currentExt = executionResult.getExtensions(); - Map statsMap = new LinkedHashMap<>( - currentExt == null ? Collections.emptyMap() : currentExt); + Map statsMap = + new LinkedHashMap<>(currentExt == null ? Collections.emptyMap() : currentExt); Map dataLoaderStats = buildStatisticsMap(state); statsMap.put("dataloader", dataLoaderStats); log.debug("Data loader stats : {}", dataLoaderStats); return CompletableFuture.completedFuture( - new ExecutionResultImpl(executionResult.getData(), executionResult.getErrors(), - statsMap)); + new ExecutionResultImpl( + executionResult.getData(), executionResult.getErrors(), statsMap)); } }