Skip to content

Commit aa9a93d

Browse files
authored
removing unused methods (#2045)
1 parent 07ca7ee commit aa9a93d

2 files changed

Lines changed: 0 additions & 44 deletions

File tree

src/main/java/graphql/execution/Async.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -126,48 +126,11 @@ public static <T> CompletableFuture<T> exceptionallyCompletedFuture(Throwable ex
126126
return result;
127127
}
128128

129-
public static <T> void copyResults(CompletableFuture<T> source, CompletableFuture<T> target) {
130-
source.whenComplete((o, throwable) -> {
131-
if (throwable != null) {
132-
target.completeExceptionally(throwable);
133-
return;
134-
}
135-
target.complete(o);
136-
});
137-
}
138-
139-
140-
public static <U, T> CompletableFuture<U> reduce(List<CompletableFuture<T>> values, U initialValue, BiFunction<U, T, U> aggregator) {
141-
CompletableFuture<U> result = new CompletableFuture<>();
142-
reduceImpl(values, 0, initialValue, aggregator, result);
143-
return result;
144-
}
145-
146-
public static <U, T> CompletableFuture<U> reduce(CompletableFuture<List<T>> values, U initialValue, BiFunction<U, T, U> aggregator) {
147-
return values.thenApply(list -> {
148-
U result = initialValue;
149-
for (T value : list) {
150-
result = aggregator.apply(result, value);
151-
}
152-
return result;
153-
});
154-
}
155-
156129
public static <U, T> CompletableFuture<List<U>> flatMap(List<T> inputs, Function<T, CompletableFuture<U>> mapper) {
157130
List<CompletableFuture<U>> collect = ImmutableKit.map(inputs, mapper);
158131
return Async.each(collect);
159132
}
160133

161-
private static <U, T> void reduceImpl(List<CompletableFuture<T>> values, int curIndex, U curValue, BiFunction<U, T, U> aggregator, CompletableFuture<U> result) {
162-
if (curIndex == values.size()) {
163-
result.complete(curValue);
164-
return;
165-
}
166-
values.get(curIndex).
167-
thenApply(oneValue -> aggregator.apply(curValue, oneValue))
168-
.thenAccept(newValue -> reduceImpl(values, curIndex + 1, newValue, aggregator, result));
169-
}
170-
171134
public static <U, T> CompletableFuture<List<U>> map(CompletableFuture<List<T>> values, Function<T, U> mapper) {
172135
return values.thenApply(list -> ImmutableKit.map(list, mapper));
173136
}

src/main/java/graphql/execution/ExecutionStrategy.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,6 @@ protected CompletableFuture<FieldValueInfo> resolveFieldWithInfo(ExecutionContex
211211
return result;
212212
}
213213

214-
protected CompletableFuture<FieldValueInfo> resolveFieldWithInfoToNull(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
215-
FetchedValue fetchedValue = FetchedValue.newFetchedValue().build();
216-
FieldValueInfo fieldValueInfo = completeField(executionContext, parameters, fetchedValue);
217-
return CompletableFuture.completedFuture(fieldValueInfo);
218-
}
219-
220-
221214
/**
222215
* Called to fetch a value for a field from the {@link DataFetcher} associated with the field
223216
* {@link GraphQLFieldDefinition}.

0 commit comments

Comments
 (0)