Skip to content

Commit dbc9896

Browse files
committed
Change Instrumentation production implementations to use non deprecated methods. Cleaned up SimpleInstrumentation
1 parent 5fa0962 commit dbc9896

1 file changed

Lines changed: 3 additions & 45 deletions

File tree

‎src/main/java/graphql/execution/instrumentation/SimpleInstrumentation.java‎

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
/**
1818
* An implementation of {@link graphql.execution.instrumentation.Instrumentation} that does nothing. It can be used
19-
* as a base for derived classes where you only implement the methods you want to
19+
* as a base for derived classes where you only implement the methods you want to. With all the methods in {@link Instrumentation}
20+
* now defaulted (post Java 6) this class is really not needed anymore but has been retained for backwards compatibility
21+
* reasons.
2022
*/
2123
@PublicApi
2224
public class SimpleInstrumentation implements Instrumentation {
@@ -26,48 +28,4 @@ public class SimpleInstrumentation implements Instrumentation {
2628
*/
2729
public static final SimpleInstrumentation INSTANCE = new SimpleInstrumentation();
2830

29-
@Override
30-
public InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters) {
31-
return SimpleInstrumentationContext.noOp();
32-
}
33-
34-
@Override
35-
public InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters) {
36-
return SimpleInstrumentationContext.noOp();
37-
}
38-
39-
@Override
40-
public InstrumentationContext<List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters) {
41-
return SimpleInstrumentationContext.noOp();
42-
}
43-
44-
@Override
45-
public ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters) {
46-
return new ExecutionStrategyInstrumentationContext() {
47-
@Override
48-
public void onDispatched(CompletableFuture<ExecutionResult> result) {
49-
50-
}
51-
52-
@Override
53-
public void onCompleted(ExecutionResult result, Throwable t) {
54-
55-
}
56-
};
57-
}
58-
59-
@Override
60-
public InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters) {
61-
return SimpleInstrumentationContext.noOp();
62-
}
63-
64-
@Override
65-
public InstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters) {
66-
return SimpleInstrumentationContext.noOp();
67-
}
68-
69-
@Override
70-
public InstrumentationContext<Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters) {
71-
return SimpleInstrumentationContext.noOp();
72-
}
7331
}

0 commit comments

Comments
 (0)