Skip to content

Commit a8fd5d3

Browse files
dugenkui03dugenkui
andauthored
avoid create redundant object; fix typo (#2090)
Co-authored-by: dugenkui <dugenkui@dugenkuideMBP.lan>
1 parent d576991 commit a8fd5d3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/graphql/execution/AbortExecutionException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public List<GraphQLError> getUnderlyingErrors() {
6767
* This is useful for turning this abort signal into an execution result which
6868
* is an error state with the underlying errors in it.
6969
*
70-
* @return an excution result with the errors from this exception
70+
* @return an execution result with the errors from this exception
7171
*/
7272
public ExecutionResult toExecutionResult() {
73-
ExecutionResult executionResult = new ExecutionResultImpl(this);
7473
if (!this.getUnderlyingErrors().isEmpty()) {
75-
executionResult = new ExecutionResultImpl(this.getUnderlyingErrors());
74+
return new ExecutionResultImpl(this.getUnderlyingErrors());
7675
}
77-
return executionResult;
76+
77+
return new ExecutionResultImpl(this);
7878
}
7979
}

src/test/groovy/graphql/execution/AbortExecutionExceptionTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AbortExecutionExceptionTest extends Specification {
2626
}
2727
}
2828

29-
def "to excution result handling"() {
29+
def "to execution result handling"() {
3030
AbortExecutionException e
3131
when:
3232
e = new AbortExecutionException("No underlying errors")

0 commit comments

Comments
 (0)