Skip to content

Commit 221b416

Browse files
committed
non nullable handling
1 parent 1800f77 commit 221b416

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/main/java/graphql/EngineRunningState.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ public void updateExecutionId(ExecutionId executionId) {
182182
}
183183

184184
private void changeOfState(EngineRunningObserver.RunningState runningState) {
185+
Assert.assertNotNull(engineRunningObserver);
186+
Assert.assertNotNull(executionId);
187+
Assert.assertNotNull(graphQLContext);
185188
engineRunningObserver.runningStateChanged(executionId, graphQLContext, runningState);
186189
}
187190

src/main/java/graphql/ProfilerResult.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ProfilerResult {
2020

2121
public static final String PROFILER_CONTEXT_KEY = "__GJ_PROFILER";
2222

23+
@Nullable
2324
private volatile ExecutionId executionId;
2425
private long startTime;
2526
private long endTime;
@@ -34,7 +35,9 @@ public class ProfilerResult {
3435
private final Map<String, DataFetcherType> dataFetcherTypeMap = new ConcurrentHashMap<>();
3536

3637
private final Map<String, DataFetcherResultType> dataFetcherResultType = new ConcurrentHashMap<>();
38+
@Nullable
3739
private volatile String operationName;
40+
@Nullable
3841
private volatile String operationType;
3942
private volatile boolean dataLoaderChainingEnabled;
4043
private final Set<Integer> oldStrategyDispatchingAll = ConcurrentHashMap.newKeySet();
@@ -152,10 +155,12 @@ void addDispatchEvent(String dataLoaderName, @Nullable Integer level, int count)
152155
// public getters
153156

154157
public String getOperationName() {
158+
Assert.assertNotNull(operationName);
155159
return operationName;
156160
}
157161

158162
public String getOperationType() {
163+
Assert.assertNotNull(operationType);
159164
return operationType;
160165
}
161166

src/main/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ private void dispatchAll(DataLoaderRegistry dataLoaderRegistry, int level) {
516516
for (DataLoader<?, ?> dataLoader : dataLoaderRegistry.getDataLoaders()) {
517517
dataLoader.dispatch().whenComplete((objects, throwable) -> {
518518
if (objects != null && objects.size() > 0) {
519+
Assert.assertNotNull(dataLoader.getName());
519520
profiler.batchLoadedOldStrategy(dataLoader.getName(), level, objects.size());
520521
}
521522
});

src/main/java/graphql/schema/DataFetchingEnvironmentImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public static class DFEInternalState {
471471
final Profiler profiler;
472472
final AlternativeCallContext alternativeCallContext;
473473

474-
public DFEInternalState(DataLoaderDispatchStrategy dataLoaderDispatchStrategy, AlternativeCallContext deferredCallContext, Profiler profiler) {
474+
public DFEInternalState(DataLoaderDispatchStrategy dataLoaderDispatchStrategy, AlternativeCallContext alternativeCallContext, Profiler profiler) {
475475
this.dataLoaderDispatchStrategy = dataLoaderDispatchStrategy;
476476
this.alternativeCallContext = alternativeCallContext;
477477
this.profiler = profiler;

0 commit comments

Comments
 (0)